[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48734] trunk/blender/source/blender/ blenkernel: correct use of nonull attribute

Campbell Barton ideasman42 at gmail.com
Sun Jul 8 19:08:27 CEST 2012


Revision: 48734
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48734
Author:   campbellbarton
Date:     2012-07-08 17:08:27 +0000 (Sun, 08 Jul 2012)
Log Message:
-----------
correct use of nonull attribute

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_idprop.h
    trunk/blender/source/blender/blenkernel/intern/idprop.c

Modified: trunk/blender/source/blender/blenkernel/BKE_idprop.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_idprop.h	2012-07-08 17:01:55 UTC (rev 48733)
+++ trunk/blender/source/blender/blenkernel/BKE_idprop.h	2012-07-08 17:08:27 UTC (rev 48734)
@@ -77,6 +77,9 @@
 
 /* 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 @@
 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 @@
 int IDP_EqualsProperties(struct IDProperty *prop1, struct IDProperty *prop2)
 #ifdef __GNUC__
 __attribute__((warn_unused_result))
-__attribute__((nonnull))
 #endif
 ;
 

Modified: trunk/blender/source/blender/blenkernel/intern/idprop.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/idprop.c	2012-07-08 17:01:55 UTC (rev 48733)
+++ trunk/blender/source/blender/blenkernel/intern/idprop.c	2012-07-08 17:08:27 UTC (rev 48734)
@@ -604,7 +604,9 @@
 
 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");




More information about the Bf-blender-cvs mailing list