Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-21 12:16:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-21 12:16:15 +0400
commit04db8ad282ec305ab61245b7556e15121d9cdcc5 (patch)
tree49bb50c8598051771b572b3ebfbfdc76ccff26a1 /source/blender/blenfont/intern
parentf9f5daed9bb0b1f239b3b3d3de7e6ff95b56e3d2 (diff)
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.
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r--source/blender/blenfont/intern/blf_lang.c7
-rw-r--r--source/blender/blenfont/intern/blf_translation.c12
2 files changed, 14 insertions, 5 deletions
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;