add STREQ macro (commonly used macro like CLAMP, MAX2, STRINGIFY). Use for some areas of the python api, bmesh.

This commit is contained in:
2013-03-10 06:18:03 +00:00
parent f99be71850
commit f9f7070336
16 changed files with 61 additions and 39 deletions

View File

@@ -1265,9 +1265,11 @@ static int icon_id_from_name(const char *name)
int id;
if (name[0]) {
for (item = icon_items, id = 0; item->identifier; item++, id++)
if (strcmp(item->name, name) == 0)
for (item = icon_items, id = 0; item->identifier; item++, id++) {
if (STREQ(item->name, name)) {
return item->value;
}
}
}
return 0;
@@ -1353,7 +1355,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
tmp.value = i;
}
if (def && def_used == 0 && strcmp(def_cmp, tmp.identifier) == 0) {
if (def && def_used == 0 && STREQ(def_cmp, tmp.identifier)) {
*defvalue = tmp.value;
def_used++; /* only ever 1 */
}