diff options
-rw-r--r-- | source/blender/blenlib/BLI_callbacks.h | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 5 | ||||
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 39 | ||||
-rw-r--r-- | source/creator/creator.c | 13 |
4 files changed, 8 insertions, 53 deletions
diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h index e1775965444..4f727773cd2 100644 --- a/source/blender/blenlib/BLI_callbacks.h +++ b/source/blender/blenlib/BLI_callbacks.h @@ -63,8 +63,4 @@ void BLI_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt); void BLI_callback_global_init(void); void BLI_callback_global_finalize(void); - -/* This is blenlib internal only, unrelated to above */ -void callLocalErrorCallBack(const char *msg); - #endif /* __BLI_CALLBACKS_H__ */ diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 4809ba59aaf..55726565f59 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -215,6 +215,11 @@ bool BLI_file_touch(const char *file) #ifdef WIN32 +static void callLocalErrorCallBack(const char *err) +{ + printf("%s\n", err); +} + static char str[MAXPATHLEN + 12]; FILE *BLI_fopen(const char *filename, const char *mode) diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index ae9f36b957c..39d1378afdd 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -44,41 +44,6 @@ #include "BLI_scanfill.h" #include "BLI_utildefines.h" -/* callbacks for errors and interrupts and some goo */ -static void (*BLI_localErrorCallBack)(const char *) = NULL; - -/** - * Set a function taking a (char *) as argument to flag errors. If the - * callback is not set, the error is discarded. - * \param f The function to use as callback - * \attention used in creator.c - */ -void BLI_setErrorCallBack(void (*f)(const char *)) -{ - BLI_localErrorCallBack = f; -} - -/* just flush the error to /dev/null if the error handler is missing */ -void callLocalErrorCallBack(const char *msg) -{ - if (BLI_localErrorCallBack) { - BLI_localErrorCallBack(msg); - } -} - -#if 0 -/* ignore if the interrupt wasn't set */ -static int callLocalInterruptCallBack(void) -{ - if (BLI_localInterruptCallBack) { - return BLI_localInterruptCallBack(); - } - else { - return 0; - } -} -#endif - /* local types */ typedef struct PolyFill { int edges, verts; @@ -989,7 +954,9 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float no } if (eed) { /* otherwise it's impossible to be sure you can clear vertices */ - callLocalErrorCallBack("No vertices with 250 edges allowed!"); +#ifdef DEBUG + printf("No vertices with 250 edges allowed!\n"); +#endif return 0; } diff --git a/source/creator/creator.c b/source/creator/creator.c index 083fc5e128b..b442194bd7d 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -118,8 +118,6 @@ #include "GPU_draw.h" #include "GPU_extensions.h" -#include "BLI_scanfill.h" /* for BLI_setErrorCallBack, TODO, move elsewhere */ - #ifdef WITH_FREESTYLE # include "FRS_freestyle.h" #endif @@ -1685,12 +1683,6 @@ void main_python_exit(void) } #endif -static void error_cb(const char *err) -{ - - printf("%s\n", err); /* XXX do this in WM too */ -} - static void mem_error_cb(const char *errorStr) { fputs(errorStr, stderr); @@ -1701,9 +1693,4 @@ static void setCallbacks(void) { /* Error output from the alloc routines: */ MEM_set_error_callback(mem_error_cb); - - - /* BLI_blenlib: */ - - BLI_setErrorCallBack(error_cb); /* */ } |