diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-05 07:17:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-05 07:17:46 +0400 |
commit | f44b54d2a7866033025bd4e99992a72e3a27c428 (patch) | |
tree | e8c15aac4a82b206adf2d551fcc626592f23cd64 /source/blender/blenfont | |
parent | 47c1570e6839e3684bfe4b0c78a3404e5bb72184 (diff) |
patch [#34103]
from Lawrence D'Oliveiro (ldo)
More use of bool type, necessitating adding inclusion of BLI_utildefines.h, or moving it up in the inclusion order if it was already included, in various places
- storage.c: make some variables only used in bli_builddir local to that
- storage.c: BLI_file_descriptor_size should allow 0 as a valid file descriptor
- path_util.c: make pointers to non-reentrant storage returned from folder routines const, necessitating making variables holding these returned pointers const elsewhere as well
- path_util.c: BLI_string_to_utf8 closes iconv context in case of conversion error
- blf_lang.c: fill_locales routine now has its own "languages" local variable to construct paths (was stealing internal storage belonging to BLI_get_folder before)
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf_dir.c | 1 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_lang.c | 9 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_translation.c | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c index b6a98faa48c..116a55c0579 100644 --- a/source/blender/blenfont/intern/blf_dir.c +++ b/source/blender/blenfont/intern/blf_dir.c @@ -41,6 +41,7 @@ #include "DNA_vec_types.h" +#include "BLI_utildefines.h" #include "BLI_fileops.h" #include "BLI_listbase.h" #include "BLI_path_util.h" diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index 73294f1aed6..d1c037b0358 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -78,15 +78,16 @@ static void free_locales(void) static void fill_locales(void) { - char *languages_path = BLI_get_folder(BLENDER_DATAFILES, "locale"); + const char * const languages_path = BLI_get_folder(BLENDER_DATAFILES, "locale"); + char languages[FILE_MAX]; LinkNode *lines = NULL, *line; char *str; int idx = 0; free_locales(); - BLI_join_dirfile(languages_path, FILE_MAX, languages_path, "languages"); - line = lines = BLI_file_read_as_lines(languages_path); + BLI_join_dirfile(languages, FILE_MAX, languages_path, "languages"); + line = lines = BLI_file_read_as_lines(languages); /* This whole "parsing" code is a bit weak, in that it expects strictly formated input file... * Should not be a problem, though, as this file is script-generated! */ @@ -185,7 +186,7 @@ EnumPropertyItem *BLF_RNA_lang_enum_properties(void) void BLF_lang_init(void) { #ifdef WITH_INTERNATIONAL - char *messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale"); + const char * const messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale"); if (messagepath) { bl_locale_init(messagepath, TEXT_DOMAIN_NAME); diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c index b5b72b68677..750f310fade 100644 --- a/source/blender/blenfont/intern/blf_translation.c +++ b/source/blender/blenfont/intern/blf_translation.c @@ -56,7 +56,7 @@ unsigned char *BLF_get_unifont(int *unifont_size_r) { #ifdef WITH_INTERNATIONAL if (unifont_ttf == NULL) { - char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts"); + const char * const fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts"); if (fontpath) { char unifont_path[1024]; |