Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-15 14:32:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-15 14:32:08 +0400
commit3cf56d46d19773cca897d99201cfa56c20a1b2e1 (patch)
tree61179e77930a6fcf9c01db324c51f1df554e4135 /source/blender/blenkernel/intern/idprop.c
parent4de917326b45d2678f23c60cfaa9d48dcd7aad18 (diff)
add IDP_EqualsProperties support for comparing non-null terminated byte strings.
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r--source/blender/blenkernel/intern/idprop.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index a07af5161db..a44957ddc01 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -40,8 +40,6 @@
#include "MEM_guardedalloc.h"
-#define BSTR_EQ(a, b) (*(a) == *(b) && !strcmp(a, b))
-
/* IDPropertyTemplate is a union in DNA_ID.h */
/*local size table.*/
@@ -464,7 +462,7 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src)
IDProperty *loop, *prop;
for (prop=src->data.group.first; prop; prop=prop->next) {
for (loop=dest->data.group.first; loop; loop=loop->next) {
- if (BSTR_EQ(loop->name, prop->name)) {
+ if (strcmp(loop->name, prop->name) == 0) {
IDProperty *copy = IDP_CopyProperty(prop);
BLI_insertlink(&dest->data.group, loop, copy);
@@ -635,7 +633,7 @@ int IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
else if(prop1->type == IDP_DOUBLE)
return (IDP_Double(prop1) == IDP_Double(prop2));
else if(prop1->type == IDP_STRING)
- return BSTR_EQ(IDP_String(prop1), IDP_String(prop2));
+ return ((prop1->len == prop2->len) && strncmp(IDP_String(prop1), IDP_String(prop2), prop1->len) == 0);
else if(prop1->type == IDP_ARRAY) {
if(prop1->len == prop2->len && prop1->subtype == prop2->subtype)
return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype]*prop1->len);