remove callback BLI_localErrorCallBack from scanfill, was here for years and only ever wrapped printf.
This commit is contained in:
parent
27df6a3b54
commit
9e561a641e
|
@ -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__ */
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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); /* */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue