Commit Graph
1617 Commits
Author SHA1 Message Date
Reece H. Dunn 6acec43043 synthesize.c: Fix -Wmissing-prototypes warnings. 2017-10-11 07:16:43 +01:00
Reece H. Dunn 8d8170ea0d translate.c: Fix -Wmissing-prototypes warnings. 2017-10-11 07:07:49 +01:00
Reece H. Dunn f605f79465 tr_languages.c: Fix -Wmissing-prototypes warnings. 2017-10-11 07:07:20 +01:00
Reece H. Dunn 74f9f5e34b wavegen.c: Fix -Wmissing-prototypes warnings. 2017-10-10 21:37:46 +01:00
Reece H. Dunn 7ea0d0d7e9 speech.c: Fix -Wmissing-prototypes warnings. 2017-10-06 07:36:09 +01:00
Reece H. Dunn 5c14e92f6b voices.c: Fix -Wmissing-prototypes warnings. 2017-10-06 07:23:57 +01:00
Reece H. Dunn 66a53cce02 klatt.c: Fix -Wmissing-prototypes warnings. 2017-10-06 07:17:31 +01:00
Reece H. Dunn 63b162c600 mbrowrap.c: Fix -Wmissing-prototypes warnings. 2017-10-06 07:13:26 +01:00
Reece H. Dunn ba62f9a162 event.c: Fix -Wmissing-prototypes warnings. 2017-10-06 07:11:17 +01:00
Reece H. Dunn 6d168ead22 fifo.c: Fix -Wmissing-prototypes warnings. 2017-10-06 07:09:41 +01:00
Reece H. Dunn 0915e02de3 Merge commit '05d9a4839c1ac792b9a3842e6bd0ad13c5316359' 2017-10-05 20:23:40 +01:00
Reece H. Dunn 256229b348 Enable and fix -Wreturn-type warnings. 2017-10-05 19:53:13 +01:00
Reece H. Dunn ed4d82c61b Fix the UCD version in the comments. 2017-10-05 19:50:22 +01:00
Reece H. Dunn 977c85ad6e Enable and fix -Wunused-but-set-variable warnings. 2017-10-05 07:35:10 +01:00
Reece H. Dunn d89fa59bed Enable and fix -Wunused-variable warnings. 2017-10-05 07:23:17 +01:00
Reece H. Dunn 6d9bb7ef17 Enable and fix -Wunused-parameter warnings. 2017-10-05 07:20:44 +01:00
Reece H. Dunn dd3df1d0a8 Enable and fix -Wunused-function warnings. 2017-10-05 07:05:47 +01:00
Reece H. Dunn 7f5914c0de Don't ignore ZWJ characters. 2017-10-01 12:24:30 +01:00
Reece H. Dunn 2442dd05ae Document the ignored characters in tr_languages.c. 2017-10-01 12:23:12 +01:00
Reece H. Dunn 119c200e00 Use strcpy instead of memcpy+strlen.
This replaces uses of:

	memcpy(dst, src, strlen(src))

with:

	strcpy(dst, src)

This fixes issues with reading past the end of the copied buffer
(e.g. when processing word-based replacements for emoji characters)
by ensuring that the destination buffer is null terminated.

Reported by Michael Curran <mick@nvaccess.org>
2017-10-01 08:50:56 +01:00
Reece H. Dunn 3a2663030b Update the version to 1.49.3-dev. 2017-09-24 10:46:15 +01:00
Reece H. Dunn 3ed34d3a74 eSpeak NG 1.49.2 2017-09-24 10:10:00 +01:00
Reece H. Dunn 4b4da73558 mbrowrap: fix building on Windows. 2017-09-24 09:53:13 +01:00
Reece H. Dunn df7e9a23e1 Ensure that flags in the syllables are initialised.
Clang static analysis reports this as 'Assigned value is garbage
or undefined'.
2017-09-14 07:57:50 +01:00
Reece H. Dunn 57108e1ed7 Add n_points guards in the LoadEnvelope2 loop.
Clang static analysis reports these as 'Result of operation is
garbage or undefined' errors.
2017-09-13 07:28:58 +01:00
Reece H. Dunn 4a882e21d3 Don't update env_x/y if no points were read.
Clang static analysis reports an 'Assigned value is garbage or
undefined' for this. If no points were read from the file, the
`n_points` variable is 0 and `env_x[n_points-1]` performs an
out-of-bounds access.
2017-09-13 07:13:29 +01:00
Reece H. Dunn 19b2bebc02 Don't save an intonation if it was not found.
Clang static analysis reports an 'Assigned value is garbage or
undefined' error. This happens if the default_tune data has not
been copied in the kTUNE case.

Extending this further, it does not make sense to save the tune
data if the tune was not found, or if the tune already exists.
2017-09-13 07:03:18 +01:00
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