[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55999] trunk/blender/source/blender: code cleanup: warnings + style

Campbell Barton ideasman42 at gmail.com
Sat Apr 13 02:43:49 CEST 2013


Revision: 55999
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55999
Author:   campbellbarton
Date:     2013-04-13 00:43:49 +0000 (Sat, 13 Apr 2013)
Log Message:
-----------
code cleanup: warnings + style

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_paint.h
    trunk/blender/source/blender/blenkernel/intern/paint.c
    trunk/blender/source/blender/editors/screen/glutil.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_utils.c
    trunk/blender/source/blender/gpu/intern/gpu_extensions.c
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/makesrna/intern/rna_texture.c

Modified: trunk/blender/source/blender/blenkernel/BKE_paint.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_paint.h	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/blenkernel/BKE_paint.h	2013-04-13 00:43:49 UTC (rev 55999)
@@ -72,7 +72,7 @@
 #define PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY 2
 #define PAINT_INVALID_OVERLAY_CURVE 4
 
-void BKE_paint_invalidate_overlay_tex (struct Scene *scene,const struct Tex *tex);
+void BKE_paint_invalidate_overlay_tex (struct Scene *scene, const struct Tex *tex);
 void BKE_paint_invalidate_cursor_overlay (struct Scene *scene, struct CurveMapping *curve);
 void BKE_paint_invalidate_overlay_all(void);
 int BKE_paint_get_overlay_flags (void);

Modified: trunk/blender/source/blender/blenkernel/intern/paint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/paint.c	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/blenkernel/intern/paint.c	2013-04-13 00:43:49 UTC (rev 55999)
@@ -29,8 +29,9 @@
  *  \ingroup bke
  */
 
+#include <stdlib.h>
+#include <string.h>
 
-
 #include "DNA_object_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
@@ -51,9 +52,6 @@
 
 #include "bmesh.h"
 
-#include <stdlib.h>
-#include <string.h>
-
 const char PAINT_CURSOR_SCULPT[3] = {255, 100, 100};
 const char PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255};
 const char PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255};
@@ -81,18 +79,20 @@
 		overlay_flags |= PAINT_INVALID_OVERLAY_CURVE;
 }
 
-void BKE_paint_invalidate_overlay_all()
+void BKE_paint_invalidate_overlay_all(void)
 {
-	overlay_flags |= PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY;
-	overlay_flags |= PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY;
-	overlay_flags |= PAINT_INVALID_OVERLAY_CURVE;
+	overlay_flags |= (PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY |
+	                  PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY |
+	                  PAINT_INVALID_OVERLAY_CURVE);
 }
 
-int BKE_paint_get_overlay_flags () {
+int BKE_paint_get_overlay_flags(void)
+{
 	return overlay_flags;
 }
 
-void BKE_paint_reset_overlay_invalid (void) {
+void BKE_paint_reset_overlay_invalid(void)
+{
 	overlay_flags &= ~(PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY |
 	                   PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY |
 	                   PAINT_INVALID_OVERLAY_CURVE);

Modified: trunk/blender/source/blender/editors/screen/glutil.c
===================================================================
--- trunk/blender/source/blender/editors/screen/glutil.c	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/editors/screen/glutil.c	2013-04-13 00:43:49 UTC (rev 55999)
@@ -1043,10 +1043,10 @@
 		return;
 
 	/* Dithering is not supported on GLSL yet */
-	force_fallback = ibuf->dither != 0.0f;
+	// force_fallback = ibuf->dither != 0.0f;
 
 	/* Single channel images could not be transformed using GLSL yet */
-	force_fallback = ibuf->channels == 1;
+	// force_fallback = ibuf->channels == 1;
 
 	/* If user decided not to use GLSL, fallback to glaDrawPixelsAuto */
 	force_fallback = !ELEM(U.image_draw_method,

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c	2013-04-13 00:43:49 UTC (rev 55999)
@@ -88,7 +88,7 @@
 	        //(mtex->brush_map_mode != MTEX_MAP_MODE_VIEW ||
 	        //(BKE_brush_size_get(vc->scene, brush) <= snap->BKE_brush_size_get)) &&
 
-			(mtex->brush_map_mode != MTEX_MAP_MODE_TILED ||
+	        (mtex->brush_map_mode != MTEX_MAP_MODE_TILED ||
 	        (vc->ar->winx == snap->winx &&
 	        vc->ar->winy == snap->winy))
 	        );
@@ -230,8 +230,8 @@
 							paint_get_tex_pixel_col(&br->mtex, x, y, rgba, pool);
 
 						if (br->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) {
-							float curve_str = BKE_brush_curve_strength(br, len, 1);
-							CLAMP(curve_str, 0.0, 1.0);
+							float curve_str = BKE_brush_curve_strength(br, len, 1.0f);
+							CLAMP(curve_str, 0.0f, 1.0f);
 							mul_v4_fl(rgba, curve_str);  /* Falloff curve */
 						}
 						buffer[index * 4]     = rgba[0] * 255;
@@ -245,10 +245,10 @@
 						avg += br->texture_sample_bias;
 
 						if (br->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW)
-							avg *= BKE_brush_curve_strength(br, len, 1);  /* Falloff curve */
+							avg *= BKE_brush_curve_strength(br, len, 1.0f);  /* Falloff curve */
 
 						/* clamp to avoid precision overflow */
-						CLAMP(avg, 0.0, 1.0);
+						CLAMP(avg, 0.0f, 1.0f);
 						buffer[index] = 255 - (GLubyte)(255 * avg);
 					}
 				}

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_utils.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_utils.c	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_utils.c	2013-04-13 00:43:49 UTC (rev 55999)
@@ -206,10 +206,10 @@
 		rgba[2] = intensity;
 		rgba[3] = 1.0f;
 	}
-	CLAMP(rgba[0], 0.0, 1.0);
-	CLAMP(rgba[1], 0.0, 1.0);
-	CLAMP(rgba[2], 0.0, 1.0);
-	CLAMP(rgba[3], 0.0, 1.0);
+	CLAMP(rgba[0], 0.0f, 1.0f);
+	CLAMP(rgba[1], 0.0f, 1.0f);
+	CLAMP(rgba[2], 0.0f, 1.0f);
+	CLAMP(rgba[3], 0.0f, 1.0f);
 }
 
 /* 3D Paint */

Modified: trunk/blender/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_extensions.c	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/gpu/intern/gpu_extensions.c	2013-04-13 00:43:49 UTC (rev 55999)
@@ -108,7 +108,7 @@
 	GG.extdisabled = 1;
 }
 
-int GPU_max_texture_size ()
+int GPU_max_texture_size(void)
 {
 	return GG.maxtexsize;
 }

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2013-04-13 00:43:49 UTC (rev 55999)
@@ -920,18 +920,18 @@
 } UnifiedPaintSettings;
 
 typedef enum {
-	UNIFIED_PAINT_SIZE  = (1<<0),
-	UNIFIED_PAINT_ALPHA = (1<<1),
-	UNIFIED_PAINT_WEIGHT = (1<<5),
+	UNIFIED_PAINT_SIZE  = (1 << 0),
+	UNIFIED_PAINT_ALPHA = (1 << 1),
+	UNIFIED_PAINT_WEIGHT = (1 << 5),
 
 	/* only used if unified size is enabled, mirros the brush flags
 	 * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
-	UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2),
-	UNIFIED_PAINT_BRUSH_SIZE_PRESSURE   = (1<<3),
+	UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
+	UNIFIED_PAINT_BRUSH_SIZE_PRESSURE   = (1 << 3),
 
 	/* only used if unified alpha is enabled, mirrors the brush flag
 	 * BRUSH_ALPHA_PRESSURE */
-	UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE  = (1<<4)
+	UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE  = (1 << 4)
 } UnifiedPaintSettingsFlags;
 
 /* *************************************************************** */
@@ -1508,24 +1508,24 @@
 /* Sculpt.flags */
 /* These can eventually be moved to paint flags? */
 typedef enum SculptFlags {
-	SCULPT_SYMM_X = (1<<0),
-	SCULPT_SYMM_Y = (1<<1),
-	SCULPT_SYMM_Z = (1<<2),
-	SCULPT_LOCK_X = (1<<3),
-	SCULPT_LOCK_Y = (1<<4),
-	SCULPT_LOCK_Z = (1<<5),
-	SCULPT_SYMMETRY_FEATHER = (1<<6),
-	SCULPT_USE_OPENMP = (1<<7),
-	SCULPT_ONLY_DEFORM = (1<<8),
-	SCULPT_SHOW_DIFFUSE = (1<<9),
+	SCULPT_SYMM_X = (1 << 0),
+	SCULPT_SYMM_Y = (1 << 1),
+	SCULPT_SYMM_Z = (1 << 2),
+	SCULPT_LOCK_X = (1 << 3),
+	SCULPT_LOCK_Y = (1 << 4),
+	SCULPT_LOCK_Z = (1 << 5),
+	SCULPT_SYMMETRY_FEATHER = (1 << 6),
+	SCULPT_USE_OPENMP = (1 << 7),
+	SCULPT_ONLY_DEFORM = (1 << 8),
+	SCULPT_SHOW_DIFFUSE = (1 << 9),
 
 	/* If set, the mesh will be drawn with smooth-shading in
 	 * dynamic-topology mode */
-	SCULPT_DYNTOPO_SMOOTH_SHADING = (1<<10),
+	SCULPT_DYNTOPO_SMOOTH_SHADING = (1 << 10),
 
 	/* If set, dynamic-topology brushes will collapse short edges in
 	 * addition to subdividing long ones */
-	SCULPT_DYNTOPO_COLLAPSE = (1<<11)
+	SCULPT_DYNTOPO_COLLAPSE = (1 << 11)
 } SculptFlags;
 
 /* ImagePaintSettings.flag */

Modified: trunk/blender/source/blender/makesrna/intern/rna_texture.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_texture.c	2013-04-12 23:55:11 UTC (rev 55998)
+++ trunk/blender/source/blender/makesrna/intern/rna_texture.c	2013-04-13 00:43:49 UTC (rev 55999)
@@ -258,7 +258,8 @@
 	}
 }
 
-void rna_TextureSlot_brush_update(Main *bmain, Scene *scene, PointerRNA *ptr) {
+void rna_TextureSlot_brush_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
 	ID *id = ptr->id.data;
 
 	DAG_id_tag_update(id, 0);




More information about the Bf-blender-cvs mailing list