diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-09 02:13:53 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-09 02:13:53 +0000 |
commit | 77471d966e7252229e6379968b18a7ad789b56da (patch) | |
tree | 5e6ff026566c8f7443f132bb097e7325b7b5acee /Build/source/texk/gregorio/gregorio-src/src/vowel/vowel.c | |
parent | a286a15b8e122724c858631a30ad23e0e9bff1a1 (diff) |
gregorio 4.1.0-beta2
git-svn-id: svn://tug.org/texlive/trunk@39632 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/gregorio/gregorio-src/src/vowel/vowel.c')
-rw-r--r-- | Build/source/texk/gregorio/gregorio-src/src/vowel/vowel.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Build/source/texk/gregorio/gregorio-src/src/vowel/vowel.c b/Build/source/texk/gregorio/gregorio-src/src/vowel/vowel.c index b4843cf2a3c..8b108726610 100644 --- a/Build/source/texk/gregorio/gregorio-src/src/vowel/vowel.c +++ b/Build/source/texk/gregorio/gregorio-src/src/vowel/vowel.c @@ -26,9 +26,6 @@ #include <string.h> #include <assert.h> #include <errno.h> -#ifdef USE_KPSE - #include <kpathsea/kpathsea.h> -#endif #include "bool.h" #include "vowel.h" #include "unicode.h" @@ -131,9 +128,12 @@ static __inline void character_set_grow(character_set *const set) { assert(set); if (set->bins >= 0x4000L) { + /* this should not realistically be reached */ + /* LCOV_EXCL_START */ gregorio_message(_("character set too large"), "character_set_grow", VERBOSITY_FATAL, 0); return; + /* LCOV_EXCL_STOP */ } old_table = set->table; @@ -144,7 +144,7 @@ static __inline void character_set_grow(character_set *const set) { set->mask = (set->mask << 1) | 0x01; set->table = gregorio_calloc(set->bins, sizeof(grewchar)); if (old_next) { - set->table = gregorio_calloc(set->bins, sizeof(character_set *)); + set->next = gregorio_calloc(set->bins, sizeof(character_set *)); } for (i = 0; i < old_bins; ++i) { if (old_table[i]) { @@ -237,21 +237,19 @@ void gregorio_vowel_tables_init(void) void gregorio_vowel_tables_load(const char *const filename, char **const language, rulefile_parse_status *status) { -#ifdef USE_KPSE - if (!kpse_in_name_ok(filename)) { - gregorio_messagef("gregorio_vowel_tables_load", VERBOSITY_WARNING, 0, - _("kpse disallows read from %s"), filename); - return; - } -#endif + gregorio_check_file_access(read, filename, WARNING, return); gregorio_vowel_rulefile_in = fopen(filename, "r"); if (gregorio_vowel_rulefile_in) { gregorio_vowel_rulefile_parse(filename, language, status); fclose(gregorio_vowel_rulefile_in); gregorio_vowel_rulefile_in = NULL; } else { + /* tests cannot be expected to simulate the system error that would + * cause gregorio_vowel_rulefile_in to be NULL */ + /* LCOV_EXCL_START */ gregorio_messagef("gregorio_vowel_tables_load", VERBOSITY_WARNING, 0, _("unable to open %s: %s"), filename, strerror(errno)); + /* LCOV_EXCL_STOP */ } } @@ -414,7 +412,11 @@ bool gregorio_find_vowel_group(const grewchar *const string, int *const start, break; default: + /* not reachable unless there's a programming error */ + /* LCOV_EXCL_START */ assert(false); + break; + /* LCOV_EXCL_STOP */ } if (!*subject) { |