Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee944700 authored by Juho Hiltunen's avatar Juho Hiltunen
Browse files

code cleanup: Check all local includes with include-what-you-use

Going through files in src/libespeak-ng/, include-what-you-use removed a
few unnecessary includes and included explanations on why a certain
header should be included. This makes tracking globals and dependencies easier.

Running the codebase through IWYU should be repeated after each major
code restIncludes to standard c library weren't checked to avoid
breaking builds with other platforms.

See https://github.com/include-what-you-use/include-what-you-use
parent 5e709818
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -35,17 +35,17 @@
#include <espeak-ng/speak_lib.h>
#include <espeak-ng/encoding.h>

#include "readclause.h"
#include "synthdata.h"
#include "wavegen.h"

#include "error.h"
#include "phoneme.h"
#include "voice.h"
#include "synthesize.h"
#include "spect.h"
#include "translate.h"
#include "dictionary.h"
#include "dictionary.h"               // for strncpy0
#include "error.h"                    // for create_file_error_context
#include "phoneme.h"                  // for PHONEME_TAB, PHONEME_TAB_LIST
#include "readclause.h"               // for Read4Bytes
#include "spect.h"                    // for SpectFrame, peak_t, SpectSeq
#include "speech.h"  // for path_home, MNEM_TAB, GetFileLength
#include "synthdata.h"                // for LoadPhData
#include "synthesize.h"               // for TUNE, frame_t, CONDITION_IS_OTHER
#include "translate.h"                // for utf8_out, utf8_in
#include "voice.h"                    // for LoadVoice, voice
#include "wavegen.h"                  // for WavegenInit, WavegenSetVoice

#define N_ITEM_STRING 256

+7 −6
Original line number Diff line number Diff line
@@ -37,12 +37,13 @@
#include "dictionary.h"
#include "readclause.h"

#include "error.h"
#include "speech.h"
#include "phoneme.h"
#include "voice.h"
#include "synthesize.h"
#include "translate.h"
#include "dictionary.h"           // for EncodePhonemes, strncpy0, HashDicti...
#include "error.h"                // for create_file_error_context
#include "phoneme.h"              // for PHONEME_TAB_LIST, phonSWITCH, phone...
#include "readclause.h"           // for towlower2
#include "speech.h"               // for LookupMnemName, MNEM_TAB, path_home
#include "synthesize.h"           // for Write4Bytes
#include "translate.h"            // for isspace2, IsDigit09, utf8_in, utf8_out

static FILE *f_log = NULL;

+5 −5
Original line number Diff line number Diff line
@@ -30,11 +30,11 @@

#include "mbrola.h"

#include "error.h"
#include "phoneme.h"
#include "speech.h"
#include "voice.h"
#include "synthesize.h"
#include "error.h"                // for create_file_error_context
#include "mbrola.h"               // for MBROLA_TAB
#include "phoneme.h"              // for N_PHONEME_TAB
#include "speech.h"               // for path_home
#include "synthesize.h"           // for Write4Bytes

static const char *basename(const char *filename)
{
+8 −9
Original line number Diff line number Diff line
@@ -32,15 +32,14 @@
#include <espeak-ng/encoding.h>

#include "dictionary.h"
#include "numbers.h"
#include "readclause.h"
#include "synthdata.h"

#include "speech.h"
#include "phoneme.h"
#include "voice.h"
#include "synthesize.h"
#include "translate.h"
#include "numbers.h"                       // for LookupAccentedLetter, Look...
#include "phoneme.h"                       // for PHONEME_TAB, phVOWEL, phon...
#include "readclause.h"                    // for WordToString2, is_str_tota...
#include "speech.h"                        // for GetFileLength, path_home
#include "compiledict.h"                   // for DecodeRule
#include "synthdata.h"                     // for PhonemeCode, InterpretPhoneme
#include "synthesize.h"                    // for STRESS_IS_PRIMARY, phoneme...
#include "translate.h"                     // for Translator, utf8_in, LANGU...

typedef struct {
	int points;
+4 −3
Original line number Diff line number Diff line
@@ -21,9 +21,10 @@
#ifndef ESPEAK_NG_DICTIONARY_H
#define ESPEAK_NG_DICTIONARY_H

#include "compiledict.h"
#include "synthesize.h"
#include "translate.h"
#include "espeak-ng/espeak_ng.h"       // for ESPEAK_NG_API
#include "phoneme.h"                   // for PHONEME_TAB
#include "synthesize.h"                // for PHONEME_LIST
#include "translate.h"                 // for Translator, WORD_TAB

#ifdef __cplusplus
extern "C"
Loading