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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-03-07 11:27:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-07 11:27:11 +0300
commit84da76a96c5c2b59aeb67fa905398f656af25649 (patch)
treef2c69d002fe221ee3f9bf2b3acbdbf75b4e2a2eb /source
parent8618c4159c7b0c9bddf6b86522dee383de7207cf (diff)
Cleanup: use POINTER_OFFSET macro
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/intern/string_utils.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/string_utils.c b/source/blender/blenlib/intern/string_utils.c
index dbeb75570fb..dbe5c96260b 100644
--- a/source/blender/blenlib/intern/string_utils.c
+++ b/source/blender/blenlib/intern/string_utils.c
@@ -333,11 +333,6 @@ bool BLI_uniquename_cb(UniquenameCheckCallback unique_check,
return false;
}
-/* little helper macro for BLI_uniquename */
-#ifndef GIVE_STRADDR
-# define GIVE_STRADDR(data, offset) (((char *)data) + offset)
-#endif
-
/**
* Generic function to set a unique name. It is only designed to be used in situations
* where the name is part of the struct.
@@ -353,7 +348,7 @@ static bool uniquename_find_dupe(ListBase *list, void *vlink, const char *name,
for (link = list->first; link; link = link->next) {
if (link != vlink) {
- if (STREQ(GIVE_STRADDR(link, name_offs), name)) {
+ if (STREQ(POINTER_OFFSET((const char *)link, name_offs), name)) {
return true;
}
}
@@ -403,7 +398,7 @@ bool BLI_uniquename(
}
return BLI_uniquename_cb(
- uniquename_unique_check, &data, defname, delim, GIVE_STRADDR(vlink, name_offs), name_len);
+ uniquename_unique_check, &data, defname, delim, POINTER_OFFSET(vlink, name_offs), name_len);
}
/* ------------------------------------------------------------------------- */