- turn RNA_warning into a macro which includes the function name (was being written in manually but had incorrect func names in places).

- add __func__ define to BLI_utildefines.h for MSVC.
This commit is contained in:
2011-09-09 01:29:53 +00:00
parent ae7401751c
commit a59ba9a519
7 changed files with 67 additions and 54 deletions

View File

@@ -5443,7 +5443,7 @@ static PyObject* pyrna_srna_ExternalType(StructRNA *srna)
if(bpy_types==NULL) {
PyErr_Print();
PyErr_Clear();
fprintf(stderr, "pyrna_srna_ExternalType: failed to find 'bpy_types' module\n");
fprintf(stderr, "%s: failed to find 'bpy_types' module\n", __func__);
return NULL;
}
bpy_types_dict= PyModule_GetDict(bpy_types); // borrow
@@ -5457,18 +5457,18 @@ static PyObject* pyrna_srna_ExternalType(StructRNA *srna)
PyObject *base_compare= pyrna_srna_PyBase(srna);
//PyObject *slots= PyObject_GetAttrString(newclass, "__slots__"); // cant do this because it gets superclasses values!
//PyObject *bases= PyObject_GetAttrString(newclass, "__bases__"); // can do this but faster not to.
PyObject *bases= ((PyTypeObject *)newclass)->tp_bases;
PyObject *slots= PyDict_GetItem(((PyTypeObject *)newclass)->tp_dict, bpy_intern_str___slots__);
PyObject *tp_bases= ((PyTypeObject *)newclass)->tp_bases;
PyObject *tp_slots= PyDict_GetItem(((PyTypeObject *)newclass)->tp_dict, bpy_intern_str___slots__);
if(slots==NULL) {
fprintf(stderr, "pyrna_srna_ExternalType: expected class '%s' to have __slots__ defined\n\nSee bpy_types.py\n", idname);
if(tp_slots==NULL) {
fprintf(stderr, "%s: expected class '%s' to have __slots__ defined\n\nSee bpy_types.py\n", __func__, idname);
newclass= NULL;
}
else if(PyTuple_GET_SIZE(bases)) {
PyObject *base= PyTuple_GET_ITEM(bases, 0);
else if(PyTuple_GET_SIZE(tp_bases)) {
PyObject *base= PyTuple_GET_ITEM(tp_bases, 0);
if(base_compare != base) {
fprintf(stderr, "pyrna_srna_ExternalType: incorrect subclassing of SRNA '%s'\nSee bpy_types.py\n", idname);
fprintf(stderr, "%s: incorrect subclassing of SRNA '%s'\nSee bpy_types.py\n", __func__, idname);
PyC_ObSpit("Expected! ", base_compare);
newclass= NULL;
}
@@ -5538,7 +5538,7 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna)
}
else {
/* this should not happen */
printf("Error registering '%s'\n", idname);
printf("%s: error registering '%s'\n", __func__, idname);
PyErr_Print();
PyErr_Clear();
}
@@ -5581,7 +5581,7 @@ PyObject *pyrna_struct_CreatePyObject(PointerRNA *ptr)
Py_DECREF(tp); /* srna owns, cant hold a ref */
}
else {
fprintf(stderr, "Could not make type\n");
fprintf(stderr, "%s: could not make type\n", __func__);
pyrna= (BPy_StructRNA *) PyObject_GC_New(BPy_StructRNA, &pyrna_struct_Type);
#ifdef USE_WEAKREFS
pyrna->in_weakreflist= NULL;
@@ -6231,10 +6231,10 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
#endif
py_class= RNA_struct_py_type_get(ptr->type);
/* rare case. can happen when registering subclasses */
if(py_class==NULL) {
fprintf(stderr, "bpy_class_call(): unable to get python class for rna struct '%.200s'\n", RNA_struct_identifier(ptr->type));
fprintf(stderr, "%s: unable to get python class for rna struct '%.200s'\n",
__func__, RNA_struct_identifier(ptr->type));
return -1;
}