[Bf-blender-cvs] [32c9146] master: Cleanup (mostly 0/1 -> false/true).

Bastien Montagne noreply at git.blender.org
Sat Nov 15 21:30:13 CET 2014


Commit: 32c9146a09501bc456d3aade39c5f809772736a3
Author: Bastien Montagne
Date:   Sat Nov 15 21:28:29 2014 +0100
Branches: master
https://developer.blender.org/rB32c9146a09501bc456d3aade39c5f809772736a3

Cleanup (mostly 0/1 -> false/true).

===================================================================

M	source/blender/blenkernel/intern/idprop.c

===================================================================

diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 23e7778..a7c76ac 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -321,8 +321,8 @@ static IDProperty *IDP_CopyArray(const IDProperty *prop)
  *
  * \param st  The string to assign.
  * \param name  The property name.
- * \param maxlen  The size of the new string (including the \0 terminator)
- * \return
+ * \param maxlen  The size of the new string (including the \0 terminator).
+ * \return The new string property.
  */
 IDProperty *IDP_NewString(const char *st, const char *name, int maxlen)
 {
@@ -630,8 +630,8 @@ void IDP_MergeGroup(IDProperty *dest, const IDProperty *src, const bool do_overw
  *
  * The sanity check just means the property is not added to the group if another property
  * exists with the same name; the client code using ID properties then needs to detect this
- * (the function that adds new properties to groups, IDP_AddToGroup,returns 0 if a property can't
- * be added to the group, and 1 if it can) and free the property.
+ * (the function that adds new properties to groups, IDP_AddToGroup, returns false if a property can't
+ * be added to the group, and true if it can) and free the property.
  *
  * Currently the code to free ID properties is designed to leave the actual struct
  * you pass it un-freed, this is needed for how the system works.  This means
@@ -646,10 +646,10 @@ bool IDP_AddToGroup(IDProperty *group, IDProperty *prop)
 	if (IDP_GetPropertyFromGroup(group, prop->name) == NULL) {
 		group->len++;
 		BLI_addtail(&group->data.group, prop);
-		return 1;
+		return true;
 	}
 
-	return 0;
+	return false;
 }
 
 /**
@@ -663,10 +663,10 @@ bool IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew
 	if (IDP_GetPropertyFromGroup(group, pnew->name) == NULL) {
 		group->len++;
 		BLI_insertlinkafter(&group->data.group, previous, pnew);
-		return 1;
+		return true;
 	}
 
-	return 0;
+	return false;
 }
 
 /**
@@ -768,11 +768,11 @@ IDProperty *IDP_GetProperties(ID *id, const bool create_if_needed)
 bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is_strict)
 {
 	if (prop1 == NULL && prop2 == NULL)
-		return 1;
+		return true;
 	else if (prop1 == NULL || prop2 == NULL)
-		return is_strict ? 0 : 1;
+		return is_strict ? false : true;
 	else if (prop1->type != prop2->type)
-		return 0;
+		return false;
 
 	switch (prop1->type) {
 		case IDP_INT:
@@ -800,22 +800,22 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
 			if (prop1->len == prop2->len && prop1->subtype == prop2->subtype) {
 				return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype] * prop1->len);
 			}
-			return 0;
+			return false;
 		case IDP_GROUP:
 		{
 			IDProperty *link1, *link2;
 
 			if (is_strict && prop1->len != prop2->len)
-				return 0;
+				return false;
 
 			for (link1 = prop1->data.group.first; link1; link1 = link1->next) {
 				link2 = IDP_GetPropertyFromGroup(prop2, link1->name);
 
 				if (!IDP_EqualsProperties_ex(link1, link2, is_strict))
-					return 0;
+					return false;
 			}
 
-			return 1;
+			return true;
 		}
 		case IDP_IDPARRAY:
 		{
@@ -824,12 +824,12 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
 			int i;
 
 			if (prop1->len != prop2->len)
-				return 0;
+				return false;
 
 			for (i = 0; i < prop1->len; i++)
 				if (!IDP_EqualsProperties(&array1[i], &array2[i]))
-					return 0;
-			return 1;
+					return false;
+			return true;
 		}
 		default:
 			/* should never get here */
@@ -837,7 +837,7 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
 			break;
 	}
 
-	return 1;
+	return true;
 }
 
 bool IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)




More information about the Bf-blender-cvs mailing list