diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-08 21:08:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-08 21:08:27 +0400 |
commit | 0c7b56cf39b0b0ac38ad9813a7d43b7098c891fd (patch) | |
tree | 75f8c40a8e7b10cfffcec1ee94557e8231dd5864 /source/blender/blenkernel | |
parent | 4c6abb8105c5c2747c182ef64dbc66dd990cbbe0 (diff) |
correct use of nonull attribute
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_idprop.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 88eb4dc6f97..0f9c987b47c 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -77,6 +77,9 @@ void IDP_FreeIDPArray(IDProperty *prop); /* shallow copies item */ void IDP_SetIndexArray(struct IDProperty *prop, int index, struct IDProperty *item); +#ifdef __GNUC__ +__attribute__((nonnull)) +#endif struct IDProperty *IDP_GetIndexArray(struct IDProperty *prop, int index) #ifdef __GNUC__ __attribute__((warn_unused_result)) @@ -95,7 +98,7 @@ void IDP_FreeArray(struct IDProperty *prop); IDProperty *IDP_NewString(const char *st, const char *name, int maxlen) /* maxlen excludes '\0' */ #ifdef __GNUC__ __attribute__((warn_unused_result)) -__attribute__((nonnull)) +__attribute__((nonnull (2))) /* 'name' arg */ #endif ; @@ -260,7 +263,6 @@ __attribute__((nonnull)) int IDP_EqualsProperties(struct IDProperty *prop1, struct IDProperty *prop2) #ifdef __GNUC__ __attribute__((warn_unused_result)) -__attribute__((nonnull)) #endif ; diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index cff6ab2f125..a65d03e64cf 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -604,7 +604,9 @@ IDProperty *IDP_CopyProperty(IDProperty *prop) IDProperty *IDP_GetProperties(ID *id, int create_if_needed) { - if (id->properties) return id->properties; + if (id->properties) { + return id->properties; + } else { if (create_if_needed) { id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty"); |