Commit Graph
1440 Commits
Author SHA1 Message Date
Reece H. Dunn a2f751044c Remove unused letter assignment in MatchRule.
This was identified by the clang static analyser. The letter
variable is set in the various match_type switch cases, so
does not need to be initialised in the start of the while loop.
2017-09-12 07:46:53 +01:00
Reece H. Dunn ecdff298b0 last_letter in MatchRule is not used.
This was identified by the clang static analyser.
2017-09-12 07:43:00 +01:00
Reece H. Dunn 8a777385a8 Use wflags to access wtab->flags in LookupDict2.
Clang static analysis reports a 'Dereference of null pointer'
error when accessing wtab->flags. This is properly guarded
against when setting the wflags variable, so use that variable
instead.
2017-09-12 07:36:54 +01:00
Reece H. Dunn e6ea8fabea Initialise ending in RemoveEnding.
Clang static analysis reports this as several 'Result of operation
is garbage or undefined' errors, when `ending` has not been set
due to no matching endings.
2017-09-12 07:29:07 +01:00
Reece H. Dunn 988db184ea Prevent invalid access to word in LookupDictList.
Clang static analysis reports this as several 'Result of operation
is garbage or undefined' errors.
2017-09-12 07:17:46 +01:00
Anthony Cornehl 897fad64c1 Remove definitions for towlower/towupper
The definitions for towlower() and towupper() are defined in /usr/include/wctype.h on FreeBSD platforms. I just removed the define and used  the ucd_ equivilent where towlower/towupper were found.

/bin/sh ./libtool  --tag=CC   --mode=compile cc -DHAVE_CONFIG_H -I.    -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-
ng-data\" -DLIBESPEAK_NG_EXPORT  -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-lab
els    -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-readclause.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-readclause.Tpo -c -o src/libespeak-n
g/src_libespeak_ng_la-readclause.lo `test -f 'src/libespeak-ng/readclause.c' || echo './'`src/libespeak-ng/readclause.c
libtool: compile:  cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPO
RT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/li
bespeak-ng/src_libespeak_ng_la-readclause.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-readclause.Tpo -c src/libespeak-ng/readclause.c  -fPIC -DPIC -o src/l
ibespeak-ng/.libs/src_libespeak_ng_la-readclause.o
In file included from src/libespeak-ng/readclause.c:32:
In file included from src/include/compat/wctype.h:30:
/usr/include/wctype.h:73:8: error: conflicting types for 'ucd_tolower'
wint_t  towlower(wint_t);
        ^
src/include/compat/wchar.h:37:18: note: expanded from macro 'towlower'
                 ^
src/ucd-tools/src/include/ucd/ucd.h:503:13: note: previous declaration is here
codepoint_t ucd_tolower(codepoint_t c);
            ^
In file included from src/libespeak-ng/readclause.c:32:
In file included from src/include/compat/wctype.h:30:
/usr/include/wctype.h:74:8: error: conflicting types for 'ucd_toupper'
wint_t  towupper(wint_t);
        ^
src/include/compat/wchar.h:38:18: note: expanded from macro 'towupper'
                 ^
src/ucd-tools/src/include/ucd/ucd.h:491:13: note: previous declaration is here
codepoint_t ucd_toupper(codepoint_t c);
            ^
src/libespeak-ng/readclause.c:366:19: warning: implicit declaration of function 'mkstemp' is invalid in C99 [-Wimplicit-function-declaration]
                        if ((fd_temp = mkstemp(fname_temp)) >= 0)
                                       ^
1 warning and 2 errors generated.
2017-08-31 17:42:17 -07:00
Reece H. Dunn c8f83c6b1f Add ucd/ucd.h to readclause.c, to fix building on Android. 2017-08-20 22:47:56 +01:00
Reece H. Dunn 8585b0b47d Fix the return status code from Synthesize when the voices cannot be found. 2017-08-19 12:27:39 +01:00
Reece H. Dunn 882c2651e1 Fix setting the default voice from espeak_SetVoiceByProperties. 2017-08-19 12:08:39 +01:00
Reece H. Dunn 16bea7fd0f Don't crash in LoadVoice if langopts is NULL. 2017-08-19 11:44:13 +01:00
Reece H. Dunn cec0e773a4 Remove the tokenizer code. This is not currently used, and should be designed from espeak's behaviour. 2017-08-16 19:04:26 +01:00
Reece H. Dunn 22270bd259 Fix reading hash table entries > 128.
This is related to ebfa320956, but
when reading the hash chain entry length, not writing it.

If char is signed, then before this change the length would be
negative, causing problems loading the dictionary.
2017-07-26 21:11:44 +01:00
Reece H. Dunn ebfa320956 Fix storing the line length in the hash chain.
The length is stored as the first byte in the output from
compile_line. As the data pointer is char, if char is signed then
length could be negative resulting in undefined behaviour. This
commit fixes the issue by reading and writing that byte as a
uint8_t.

This bug was caused by 2a00ca79f6.
Previously, the entries could only be a maximum of 128 bytes, and
would not be negative on platforms with signed chars. That
commit was made to support long emoji entries, especially for
non-Latin languages where the utf-8 representations could be
longer than 128 bytes.

This change also adds some documentation to make it clearer what
is going on. NOTE: The code should really be using actual struct
objects instead of writing to opaque char buffers.

Reported by Reef Turner <reef@nvaccess.org>
2017-07-26 20:44:27 +01:00
Reece H. Dunn e7ac4b819d hash_counts is never used, so remove it.
Reported by Reef Turner <reef@nvaccess.org>
2017-07-26 20:21:05 +01:00
Reece H. Dunn 0383e3525a Merge commit '0994206f710a4defc1eecfb78ab70ff57c58fcda' 2017-07-26 19:53:11 +01:00
Reece H. Dunn 921229259d Use int to store the value from GetFileLength.
This fixes the clang warning:

    comparison of unsigned expression < 0 is always false
    [-Wtautological-compare]

Reported by Reef Turner <reef@nvaccess.org>
2017-07-26 19:50:03 +01:00
Reef Turner 0994206f71 address buffer overrun when dict listx file has no trailling newline
See ar_listx as an example.
2017-07-25 14:29:45 +08:00
Reece H. Dunn 0b4d06dd9f Merge commit '3278ddaa721c9a9d7de2415e64cba941e2e908f8' 2017-07-10 07:22:20 +01:00
Reece H. Dunn 8566f2ee35 Merge commit 'f26aca0aa1b9485634314d0d1710d2a0bb67776d' 2017-07-10 07:17:42 +01:00
Reece H. Dunn 1cb4115eab Add Emoji_Component support from emoji-data.txt. 2017-06-25 15:51:37 +01:00
Reece H. Dunn 18d3a0819a Unicode Emoji 5.0 2017-06-25 15:41:46 +01:00
Reece H. Dunn 023ebace9a Add Regional_Indicator support from PropList.txt. 2017-06-25 15:27:53 +01:00
Reece H. Dunn 4c1ff765f1 Unicode Character Data 10.0.0 2017-06-25 15:13:08 +01:00
Reece H. Dunn 0b56f2e5bc Use C-style comments to support using a C89 compiler. 2017-06-25 12:23:28 +01:00
yorkie db79bd12eb build, encoding: include stdint
The stdint.h is not included when building test, then including this module inside encoding.h
2017-06-15 20:52:55 +08:00
yorkie 949de3f80f build: fix duplicated symbol when linking 2017-06-15 18:10:54 +08:00
Reece H. Dunn f946c6e227 windows: fix building the bs, hr and sr languages 2017-06-04 21:29:55 +01:00
Reece H. Dunn 2a00ca79f6 Increase dict_line to support long emoji entries. 2017-06-04 19:47:30 +01:00
Reece H. Dunn d5d980862e Guard against overflowing the dict_line bounds when compiling dictionary files. 2017-06-04 19:38:40 +01:00
Reece H. Dunn 4771cd4d5e windows: fix building the Chinese (Cantonese) voice 2017-06-04 18:20:36 +01:00
Reece H. Dunn 8d1ff99847 windows: fix building the Japanese voice 2017-06-04 18:16:16 +01:00
Reece H. Dunn ebe7ce827b windows: the installer depends on the data (voice, language) files 2017-06-04 18:13:42 +01:00
Reece H. Dunn b16ff0119e windows: update the project files to Visual Studio 2017 2017-06-04 18:11:59 +01:00
Reece H. Dunn 416bc66dca Fix pronouncing replacement text that is dependent on start of word rules. 2017-05-29 11:53:33 +01:00
Reece H. Dunn 7accbcd498 Only update the sample rate if the mbrola voice was successfully loaded. 2017-05-28 10:41:16 +01:00
Reece H. Dunn e41a78d819 Report the actual error from LoadMbrolaTable when loading the mbrola voice. 2017-05-28 10:38:15 +01:00
Reece H. Dunn 801753bdbd [Windows] Fix installing the cs, pl, ru and sk language files after fixing their language family. 2017-05-28 09:57:06 +01:00
Reece H. Dunn 133d44039a en: (emoji) -- zwj sequences - gendered gestures (Unicode Emoji 5.0). 2017-05-26 07:07:35 +01:00
Reece H. Dunn c163f19360 en: (emoji) -- zwj sequences - gendered activity (Unicode Emoji 5.0). 2017-05-26 07:06:37 +01:00
Reece H. Dunn 8dde51ca87 Remove the now unused emoji_zwj specifier. 2017-05-25 07:23:21 +01:00
Reece H. Dunn ea34ebcad5 en: (emoji) -- zwj sequences - gendered role (Unicode Emoji 5.0). 2017-05-25 07:16:16 +01:00
Reece H. Dunn 349695881e Merge commit '32912d6565d194aec92a74fd7a1f2209acd7374e' 2017-05-21 15:56:02 +01:00
Reece H. Dunn fbd2e679fc Don't crash if loading the default voice fails. 2017-05-21 12:44:10 +01:00
Reece H. Dunn dced9f58fd Clean up the decoder memory in espeak_Terminate. 2017-05-21 12:07:15 +01:00
Reece H. Dunn 63e2826753 Ensure that the old translator is not used after calling espeak_Terminate. 2017-05-21 12:01:46 +01:00
Reece H. Dunn ae6116bf97 Fix calling espeak_Synth without first setting a voice, with tests. 2017-05-21 10:47:47 +01:00
Reece H. Dunn 6ab1314843 Move outbuf_size to where it is actually used. 2017-05-21 10:02:27 +01:00
Reece H. Dunn 9fc2efb1fa Don't re-initialize my_audio if espeak_ng_InitializeOutput is called multiple times. 2017-05-21 09:49:35 +01:00
Reece H. Dunn ee07eaa733 Support capitalized words in text-based replacements. This is important in languages like German that differentiate pronunciation on case. Even English does this (e.g. Polish/polish). 2017-05-19 07:13:22 +01:00
Reece H. Dunn 0de7b6c7db en: (emoji) -- Unicode Emoji 4.0 (Emoji Gender Specifiers) 2017-05-18 08:00:08 +01:00