diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-03 19:04:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-03 19:06:14 +0300 |
commit | 4b3f1b7540c43999b94c5147eabd6b0b7a6693f8 (patch) | |
tree | fd13920bc783d6f2157b56d6cf4217b262aa9768 | |
parent | f7e220edbd7c0b7cb61f0d0cd6e430f671fb2df1 (diff) |
Cleanup: remove rarely used IDProp iterator
-rw-r--r-- | source/blender/blenkernel/BKE_idprop.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 50 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 5 |
3 files changed, 1 insertions, 57 deletions
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 2ab3d84dea5..cb73cc2896d 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -100,9 +100,6 @@ void IDP_FreeFromGroup(struct IDProperty *group, struct IDProperty *prop) ATTR_N IDProperty *IDP_GetPropertyFromGroup(struct IDProperty *prop, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); IDProperty *IDP_GetPropertyTypeFromGroup(struct IDProperty *prop, const char *name, const char type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -void *IDP_GetGroupIterator(struct IDProperty *prop) ATTR_WARN_UNUSED_RESULT; -IDProperty *IDP_GroupIterNext(void *vself) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -void IDP_FreeIterBeforeEnd(void *vself) ATTR_NONNULL(); /*-------- Main Functions --------*/ struct IDProperty *IDP_GetProperties(struct ID *id, const bool create_if_needed) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 4dbd15a3774..5c06d5bd86b 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -700,56 +700,6 @@ IDProperty *IDP_GetPropertyTypeFromGroup(IDProperty *prop, const char *name, con return (idprop && idprop->type == type) ? idprop : NULL; } -typedef struct IDPIter { - void *next; - IDProperty *parent; -} IDPIter; - -/** - * Get an iterator to iterate over the members of an id property group. - * Note that this will automatically free the iterator once iteration is complete; - * if you stop the iteration before hitting the end, make sure to call - * IDP_FreeIterBeforeEnd(). - */ -void *IDP_GetGroupIterator(IDProperty *prop) -{ - IDPIter *iter; - - BLI_assert(prop->type == IDP_GROUP); - iter = MEM_mallocN(sizeof(IDPIter), "IDPIter"); - iter->next = prop->data.group.first; - iter->parent = prop; - return (void *) iter; -} - -/** - * Returns the next item in the iteration. To use, simple for a loop like the following: - * while (IDP_GroupIterNext(iter) != NULL) { - * ... - * } - */ -IDProperty *IDP_GroupIterNext(void *vself) -{ - IDPIter *self = (IDPIter *) vself; - Link *next = (Link *) self->next; - if (self->next == NULL) { - MEM_freeN(self); - return NULL; - } - - self->next = next->next; - return (void *) next; -} - -/** - * Frees the iterator pointed to at vself, only use this if iteration is stopped early; - * when the iterator hits the end of the list it'll automatically free itself.\ - */ -void IDP_FreeIterBeforeEnd(void *vself) -{ - MEM_freeN(vself); -} - /* Ok, the way things work, Groups free the ID Property structs of their children. * This is because all ID Property freeing functions free only direct data (not the ID Property * struct itself), but for Groups the child properties *are* considered diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 739db7b7bdb..1fe5d345621 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -484,7 +484,6 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char AVDictionary **dictionary) { IDProperty *prop; - void *iter; IDProperty *curr; /* TODO(sergey): This is actually rather stupid, because changing @@ -509,9 +508,7 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char return; } - iter = IDP_GetGroupIterator(prop); - - while ((curr = IDP_GroupIterNext(iter)) != NULL) { + for (curr = prop->data.group.first; curr; curr = curr->next) { if (ffmpeg_proprty_valid(c, prop_name, curr)) set_ffmpeg_property_option(c, curr, dictionary); } |