[Bf-blender-cvs] [b8a6cd0] master: Cleanup: comments, style

Campbell Barton noreply at git.blender.org
Mon Mar 23 12:53:12 CET 2015


Commit: b8a6cd0140cae6d4da1d17577f60dc7b854fdff1
Author: Campbell Barton
Date:   Mon Mar 23 22:51:12 2015 +1100
Branches: master
https://developer.blender.org/rBb8a6cd0140cae6d4da1d17577f60dc7b854fdff1

Cleanup: comments, style

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

M	source/blender/blenkernel/intern/bpath.c
M	source/blender/blenlib/intern/BLI_ghash.c
M	source/blender/blenlib/intern/BLI_linklist.c
M	source/blender/blenlib/intern/math_color_inline.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/editors/armature/pose_transform.c
M	source/blender/editors/space_view3d/view3d_view.c
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index 3488cff..e94f30d 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -393,7 +393,7 @@ static bool rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *a
 	}
 
 	if (visit_cb(userdata, path_dst, path_src)) {
-		MEM_freeN((*path));
+		MEM_freeN(*path);
 		(*path) = BLI_strdup(path_dst);
 		return true;
 	}
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index cd86bb8..f2705c7 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -298,14 +298,14 @@ static void ghash_buckets_contract(
 
 #ifdef GHASH_USE_MODULO_BUCKETS
 	while ((nentries    < gh->limit_shrink) &&
-		   (gh->cursize > gh->size_min))
+	       (gh->cursize > gh->size_min))
 	{
 		new_nbuckets = hashsizes[--gh->cursize];
 		gh->limit_shrink = GHASH_LIMIT_SHRINK(new_nbuckets);
 	}
 #else
 	while ((nentries       < gh->limit_shrink) &&
-		   (gh->bucket_bit > gh->bucket_bit_min))
+	       (gh->bucket_bit > gh->bucket_bit_min))
 	{
 		new_nbuckets = 1u << --gh->bucket_bit;
 		gh->limit_shrink = GHASH_LIMIT_SHRINK(new_nbuckets);
@@ -525,7 +525,7 @@ static Entry *ghash_remove_ex(
 	Entry *e_prev;
 	Entry *e = ghash_lookup_entry_prev_ex(gh, key, &e_prev, bucket_index);
 
-	BLI_assert(!valfreefp|| !(gh->flag & GHASH_FLAG_IS_GSET));
+	BLI_assert(!valfreefp || !(gh->flag & GHASH_FLAG_IS_GSET));
 
 	if (e) {
 		if (keyfreefp) keyfreefp(e->key);
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index 391f3ef..f0efe49 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -230,7 +230,7 @@ void *BLI_linklist_pop(struct LinkNode **listp)
 	void *link = (*listp)->link;
 	void *next = (*listp)->next;
 
-	MEM_freeN((*listp));
+	MEM_freeN(*listp);
 
 	*listp = next;
 	return link;
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index 93977a7..4546622 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -219,7 +219,7 @@ MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack)
  * ``Y = 0.2126390059(R) + 0.7151686788(G) + 0.0721923154(B)``
  * according to: "Derivation of Basic Television Color Equations", RP 177-1993
  *
- * But this is sums slightly above 1.0, the document recommends to use:
+ * As this sums slightly above 1.0, the document recommends to use:
  * ``0.2126(R) + 0.7152(G) + 0.0722(B)``, as used here.
  *
  * The high precision values are used to calculate the rounded byte weights so they add up to 255:
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 0853c93..fc9ea1a 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -657,7 +657,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 
 		/* hysteresis setted to 10% but not actived */
 		if (!DNA_struct_elem_find(fd->filesdna, "LodLevel", "int", "obhysteresis")) {
-			Object* ob;
+			Object *ob;
 			for (ob = main->object.first; ob; ob = ob->id.next) {
 				LodLevel *level;
 				for (level = ob->lodlevels.first; level; level = level->next) {
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index fbf6dcc..01e16df 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -320,7 +320,7 @@ static bPoseChannel *pose_bone_do_paste(Object *ob, bPoseChannel *chan, const bo
 	if (selOnly)
 		paste_ok = ((pchan) && (pchan->bone->flag & BONE_SELECTED));
 	else
-		paste_ok = ((pchan != NULL));
+		paste_ok = (pchan != NULL);
 	
 	/* continue? */
 	if (paste_ok) {
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 4154f8e..2de391c 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1790,7 +1790,7 @@ float ED_view3d_radius_to_dist(
 		angle = focallength_to_fov(lens, sensor_size);
 
 		/* zoom influences lens, correct this by scaling the angle as a distance (by the zoom-level) */
-		angle = ((atanf(tanf(angle / 2.0f) * zoom) * 2.0f));
+		angle = atanf(tanf(angle / 2.0f) * zoom) * 2.0f;
 
 		dist = ED_view3d_radius_to_dist_persp(angle, radius);
 	}
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index b4ffc97..c6b95ca 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -365,7 +365,7 @@ static unsigned char *GPU_texture_convert_pixels(int length, const float *fpixel
 	p = pixels = MEM_callocN(sizeof(unsigned char)*len, "GPUTexturePixels");
 
 	for (a=0; a<len; a++, p++, fp++)
-		*p = FTOCHAR((*fp));
+		*p = FTOCHAR(*fp);
 
 	return pixels;
 }
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index a493888..c13d2f9 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -2093,8 +2093,8 @@ static void rna_def_object_lodlevel(BlenderRNA *brna)
 	RNA_def_property_int_sdna(prop, NULL, "obhysteresis");
 	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_range(prop, 0, 100, 10, 1);
-	RNA_def_property_ui_text(prop, "Hysteresis %", "Minimum distance change required to transition to the previous"
-								   " level of detail");
+	RNA_def_property_ui_text(prop, "Hysteresis %",
+	                         "Minimum distance change required to transition to the previous level of detail");
 	RNA_def_property_update(prop, NC_OBJECT | ND_LOD, NULL);
 
 	prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 93bbb6d..212f743 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3897,8 +3897,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
 	RNA_def_property_int_sdna(prop, NULL, "scehysteresis");
 	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_range(prop, 0, 100, 10, 1);
-	RNA_def_property_ui_text(prop, "Hysteresis %", "Minimum distance change required to transition to the previous"
-								   " level of detail");
+	RNA_def_property_ui_text(prop, "Hysteresis %",
+	                         "Minimum distance change required to transition to the previous level of detail");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 }




More information about the Bf-blender-cvs mailing list