From 04db8ad282ec305ab61245b7556e15121d9cdcc5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 08:16:15 +0000 Subject: misc cleanup - remove redundant casts - replace strcmp's with "" to just check first char. - added WM_event_print(), debug mode only to print events since the structs values are not that meaningful. - added warnings if locale/font dirs cant be found. --- source/blender/blenfont/intern/blf_lang.c | 7 +++++-- source/blender/blenfont/intern/blf_translation.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'source/blender/blenfont/intern') diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index ec9501c06a6..d5245073e59 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -103,10 +103,13 @@ void BLF_lang_init(void) BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name)); - if (messagepath) + if (messagepath) { BLI_strncpy(global_messagepath, messagepath, sizeof(global_messagepath)); - else + } + else { + printf("%s: 'locale' data path for translations not found, continuing\n", __func__); global_messagepath[0]= '\0'; + } } diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c index 8c0a26df4c2..90d9c4a5981 100644 --- a/source/blender/blenfont/intern/blf_translation.c +++ b/source/blender/blenfont/intern/blf_translation.c @@ -38,6 +38,7 @@ #include "MEM_guardedalloc.h" +#include "BLI_utildefines.h" #include "BLI_path_util.h" #include "BLI_string.h" #include "BLI_path_util.h" @@ -54,11 +55,16 @@ unsigned char *BLF_get_unifont(int *unifont_size_r) { if(unifont_ttf==NULL) { char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts"); - char unifont_path[1024]; + if (fontpath) { + char unifont_path[1024]; - BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename); + BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename); - unifont_ttf= (unsigned char*)BLI_ungzip_to_mem(unifont_path, &unifont_size); + unifont_ttf= (unsigned char*)BLI_ungzip_to_mem(unifont_path, &unifont_size); + } + else { + printf("%s: 'fonts' data path not found for international font, continuing\n", __func__); + } } *unifont_size_r= unifont_size; -- cgit v1.2.3