rename BKE_assert() --> BLI_assert().

This commit is contained in:
Campbell Barton 2011-01-09 15:12:08 +00:00
parent 9cb71d1159
commit 00b8c9e7ea
15 changed files with 30 additions and 30 deletions

@ -129,7 +129,7 @@ option(WITH_PYTHON_INSTALL "Copy system python into the blender install fo
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BKE_assert()" OFF)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
mark_as_advanced(WITH_ASSERT_ABORT)
if(APPLE)

@ -2452,7 +2452,7 @@ void DAG_id_tag_update(ID *id, short flag)
}
}
else {
BKE_assert(!"invalid flag for this 'idtype'");
BLI_assert(!"invalid flag for this 'idtype'");
}
}
}

@ -552,7 +552,7 @@ static short key_pointer_size(const Key *key, const int mode, int *poinsize, int
break;
default:
BKE_assert(!"invalid 'key->from' ID type");
BLI_assert(!"invalid 'key->from' ID type");
return FALSE;
}
@ -641,7 +641,7 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
/* should never happen */
if(freek1) MEM_freeN(freek1);
if(freekref) MEM_freeN(freekref);
BKE_assert(!"invalid 'cp[1]'");
BLI_assert(!"invalid 'cp[1]'");
return;
}
@ -777,7 +777,7 @@ void do_rel_key(const int start, int end, const int tot, char *basispoin, Key *k
/* should never happen */
if(freefrom) MEM_freeN(freefrom);
if(freereffrom) MEM_freeN(freereffrom);
BKE_assert(!"invalid 'cp[1]'");
BLI_assert(!"invalid 'cp[1]'");
return;
}
@ -944,7 +944,7 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
if(freek2) MEM_freeN(freek2);
if(freek3) MEM_freeN(freek3);
if(freek4) MEM_freeN(freek4);
BKE_assert(!"invalid 'cp[1]'");
BLI_assert(!"invalid 'cp[1]'");
return;
}

@ -2552,7 +2552,7 @@ void object_handle_update(Scene *scene, Object *ob)
{
#if 0 // XXX, comment for 2.56a release, background wont set 'scene->customdata_mask'
EditMesh *em = (ob == scene->obedit)? BKE_mesh_get_editmesh(ob->data): NULL;
BKE_assert((scene->customdata_mask & CD_MASK_BAREMESH) == CD_MASK_BAREMESH);
BLI_assert((scene->customdata_mask & CD_MASK_BAREMESH) == CD_MASK_BAREMESH);
if(em) {
makeDerivedMesh(scene, ob, em, scene->customdata_mask); /* was CD_MASK_BAREMESH */
BKE_mesh_end_editmesh(ob->data, em);

@ -181,7 +181,7 @@
#endif
/* BKE_assert(), default only to print
/* BLI_assert(), default only to print
* for aborting need to define WITH_ASSERT_ABORT
*/
#if !defined NDEBUG
@ -191,28 +191,28 @@
# define _dummy_abort() (void)0
# endif
# ifdef __GNUC__ /* just want to check if __func__ is available */
# define BKE_assert(a) \
# define BLI_assert(a) \
do { \
if (0 == (a)) { \
fprintf(stderr, \
"BKE_assert failed: %s, %s(), %d at \'%s\'\n", \
"BLI_assert failed: %s, %s(), %d at \'%s\'\n", \
__FILE__, __func__, __LINE__, STRINGIFY(a)); \
_dummy_abort(); \
} \
} while (0)
# else
# define BKE_assert(a) \
# define BLI_assert(a) \
do { \
if (0 == (a)) { \
fprintf(stderr, \
"BKE_assert failed: %s, %d at \'%s\'\n", \
"BLI_assert failed: %s, %d at \'%s\'\n", \
__FILE__, __LINE__, STRINGIFY(a)); \
_dummy_abort(); \
} \
} while (0)
# endif
#else
# define BKE_assert(a) (void)0
# define BLI_assert(a) (void)0
#endif
#endif // BLI_UTILDEFINES_H

@ -851,7 +851,7 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect),
/* sanity check */
if(w<=0 || h<=0 || w>2000 || h>2000) {
printf("icon_draw_rect: icons are %i x %i pixels?\n", w, h);
BKE_assert(!"invalid icon size");
BLI_assert(!"invalid icon size");
return;
}

@ -981,7 +981,7 @@ void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3]
dst_col[2]= src_col[2]>209?255:src_col[2]+46;
break;
default:
BKE_assert(!"invalid axis arg");
BLI_assert(!"invalid axis arg");
}
}

@ -734,7 +734,7 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode, unsigned c
col[2]= 220;
break;
default:
BKE_assert(!"invalid axis arg");
BLI_assert(!"invalid axis arg");
}
}

@ -3348,7 +3348,7 @@ static char *rna_idp_path(PointerRNA *ptr, IDProperty *haystack, IDProperty *nee
IDProperty *iter;
int i;
BKE_assert(haystack->type == IDP_GROUP);
BLI_assert(haystack->type == IDP_GROUP);
link.up= parent_link;
link.name= NULL;
@ -3408,7 +3408,7 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr)
IDProperty *haystack;
IDProperty *needle;
BKE_assert(ptr->id.data != NULL);
BLI_assert(ptr->id.data != NULL);
RNA_id_pointer_create(ptr->id.data, &id_ptr);
haystack= RNA_struct_idprops(&id_ptr, FALSE);

@ -1516,7 +1516,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2)
}
}
else {
BKE_assert(!"internal error");
BLI_assert(!"internal error");
}
PyErr_Format(PyExc_TypeError, "Matrix multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);

@ -684,7 +684,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2)
}
}
else {
BKE_assert(!"internal error");
BLI_assert(!"internal error");
}
PyErr_Format(PyExc_TypeError, "Quaternion multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);

@ -1129,7 +1129,7 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2)
}
}
else {
BKE_assert(!"internal error");
BLI_assert(!"internal error");
}
PyErr_Format(PyExc_TypeError, "Vector multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);

@ -269,7 +269,7 @@ void BPY_python_start( int argc, char **argv )
Py_DECREF(mod);
}
else {
BKE_assert(!"unable to load 'imp' module.");
BLI_assert(!"unable to load 'imp' module.");
}
}
@ -319,7 +319,7 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text, st
PyObject *py_dict= NULL, *py_result= NULL;
PyGILState_STATE gilstate;
BKE_assert(fn || text);
BLI_assert(fn || text);
if (fn==NULL && text==NULL) {
return 0;

@ -75,7 +75,7 @@ static int rna_id_write_error(PointerRNA *ptr, PyObject *key)
else pyname= "<UNKNOWN>";
/* make a nice string error */
BKE_assert(idtype != NULL);
BLI_assert(idtype != NULL);
PyErr_Format(PyExc_RuntimeError, "Writing to ID classes in this context is not allowed: %.200s, %.200s datablock, error setting %.200s.%.200s", id->name+2, idtype, RNA_struct_identifier(ptr->type), pyname);
return TRUE;
@ -1572,7 +1572,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
break;
}
default:
BKE_assert(!"Invalid array type");
BLI_assert(!"Invalid array type");
PyErr_SetString(PyExc_TypeError, "not an array type");
Py_DECREF(tuple);
@ -2779,7 +2779,7 @@ static PyObject *pyrna_struct_getattro( BPy_StructRNA *self, PyObject *pyname )
break;
default:
/* should never happen */
BKE_assert(!"Invalid context type");
BLI_assert(!"Invalid context type");
PyErr_Format(PyExc_AttributeError, "bpy_struct: Context type invalid %d, can't get \"%.200s\" from context", newtype, name);
ret= NULL;
@ -3400,7 +3400,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
break;
case PROP_RAW_UNSET:
/* should never happen */
BKE_assert(!"Invalid array type - set");
BLI_assert(!"Invalid array type - set");
break;
}
@ -3455,7 +3455,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
break;
case PROP_RAW_UNSET:
/* should never happen */
BKE_assert(!"Invalid array type - get");
BLI_assert(!"Invalid array type - get");
break;
}
@ -3813,7 +3813,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
void *retdata_single= NULL;
/* Should never happen but it does in rare cases */
BKE_assert(self_ptr != NULL);
BLI_assert(self_ptr != NULL);
if(self_ptr==NULL) {
PyErr_SetString(PyExc_RuntimeError, "rna functions internal rna pointer is NULL, this is a bug. aborting");

@ -341,7 +341,7 @@ void WM_read_file(bContext *C, const char *name, ReportList *reports)
}
else {
BKE_reportf(reports, RPT_ERROR, "Unknown error loading: \"%s\".", name);
BKE_assert(!"invalid 'retval'");
BLI_assert(!"invalid 'retval'");
}
WM_cursor_wait(0);