diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-07 11:27:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-07 11:27:11 +0300 |
commit | 84da76a96c5c2b59aeb67fa905398f656af25649 (patch) | |
tree | f2c69d002fe221ee3f9bf2b3acbdbf75b4e2a2eb /source/blender/blenlib | |
parent | 8618c4159c7b0c9bddf6b86522dee383de7207cf (diff) |
Cleanup: use POINTER_OFFSET macro
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/string_utils.c | 9 |
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); } /* ------------------------------------------------------------------------- */ |