style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Oct 2013 04:08:20 +0000 (04:08 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Oct 2013 04:08:20 +0000 (04:08 +0000)
release/scripts/modules/bpy/utils.py
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/makesrna/intern/rna_key.c
source/blender/render/intern/source/bake.c
source/blender/render/intern/source/render_texture.c

index ab35d7747194449caecbb367afabd4f894c3d98f..608cd920865f593ce4a4ba4248be7d893e729413 100644 (file)
@@ -677,7 +677,7 @@ def make_rna_paths(struct_name, prop_name, enum_name):
         if prop_name:
             src = src_rna = ".".join((struct_name, prop_name))
             if enum_name:
-                src = src_enum = "{}:'{}'".format(src_rna, enum_name)
+                src = src_enum = "%s:'%s'" % (src_rna, enum_name)
         else:
             src = src_rna = struct_name
     return src, src_rna, src_enum
index dbe1197436b3ade0c4126689fb6433acc37ffd73..06581fb3c11e7d38c0784ba3e40707bef08b6e52 100644 (file)
@@ -105,7 +105,7 @@ static unsigned int *screenshot(bContext *C, int *dumpsx, int *dumpsy)
                
                dumprect = MEM_mallocN(sizeof(int) * (*dumpsx) * (*dumpsy), "dumprect");
                glReadBuffer(GL_FRONT);
-               screenshot_read_pixels(x, y, *dumpsx, *dumpsy, (unsigned char*)dumprect);
+               screenshot_read_pixels(x, y, *dumpsx, *dumpsy, (unsigned char *)dumprect);
                glReadBuffer(GL_BACK);
        }
 
index f3f12464528820a1d8bc0f59c285b6871da16d53..9e8a8fd3ecc5f5f1c107a55c5f1dba41474d09cf 100644 (file)
@@ -949,7 +949,7 @@ static int sample_color_exec(bContext *C, wmOperator *op)
        RNA_int_get_array(op->ptr, "location", location);
        paint_sample_color(C, ar, location[0], location[1]);
 
-       if(show_cursor) {
+       if (show_cursor) {
                paint->flags |= PAINT_SHOW_BRUSH;
        }
 
@@ -989,7 +989,7 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event)
        Brush *brush = BKE_paint_brush(paint);
 
        if ((event->type == data->event_type) && (event->val == KM_RELEASE)) {
-               if(data->show_cursor) {
+               if (data->show_cursor) {
                        paint->flags |= PAINT_SHOW_BRUSH;
                }
 
index dc62005f760344818e90c7668682176e0491f843..d169fc58260ec7d06194e339731159b872940426 100644 (file)
@@ -345,7 +345,7 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
        else {
                /* draw with lights in the scene otherwise */
                solidtex = false;
-               if(v3d->flag2 & V3D_SHADELESS_TEX)
+               if (v3d->flag2 & V3D_SHADELESS_TEX)
                        Gtexdraw.is_lit = 0;
                else
                        Gtexdraw.is_lit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp);
index d7919125fee4f01154272d2cf776a23e998015f8..8e0d0e557097fb02c287c3a754b293b29b821ace 100644 (file)
@@ -65,7 +65,7 @@ static char *glsl_material_library = NULL;
 
 /* structs and defines */
 
-static const charGPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4",
+static const char *GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4",
        NULL, NULL, NULL, NULL, "mat3", NULL, NULL, NULL, NULL, NULL, NULL, "mat4"};
 
 #define LINK_IMAGE_BLENDER     1
index a20cb73b3aa851aa9e2c216eff46192155e89141..6d6f516ecac0356e895fb62abbba141344562996 100644 (file)
@@ -405,7 +405,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point)
                        }
                        
                        /* determine where end of array is
-                        *      - elemsize is in bytes, so use char* cast to get array in terms of bytes
+                        *      - elemsize is in bytes, so use (char *) cast to get array in terms of bytes
                         */
                        end = (float *)((char *)start + (key->elemsize * kb->totelem));
                        
@@ -422,7 +422,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point)
 
 static int rna_ShapeKeyPoint_get_index(Key *key, KeyBlock *kb, float *point)
 {
-       /* if we frame the data array and point pointers as char*, then the difference between
+       /* if we frame the data array and point pointers as (char *), then the difference between
         * them will be in bytes. Thus, dividing through by key->elemsize (number of bytes per point)
         * gives us the offset of point from start of array.
         */
index 72e47f89bb2ea6b34a82aa75704f0b4e2e630e96..cb6ca0e30ac6bd25e4364f7c7b43346e87a43580 100644 (file)
@@ -1141,7 +1141,7 @@ struct Image *RE_bake_shade_get_image(void)
 
 static void add_single_heights_margin(const ImBuf *ibuf, const char *mask, float *heights_buffer)
 {
-       int x ,y;
+       int xy;
 
        for (y = 0; y < ibuf->y; y++) {
                for (x = 0; x < ibuf->x; x++) {
@@ -1200,11 +1200,11 @@ float RE_bake_make_derivative(ImBuf *ibuf, float *heights_buffer, const char *ma
        if (auto_range_fit) {
                /* If automatic range fitting is enabled. */
                for (y = 0; y < ibuf->y; y++) {
-                       const int Yu = y == (ibuf->y - 1) ? (ibuf->y - 1) : (y+1);
+                       const int Yu = y == (ibuf->y - 1) ? (ibuf->y - 1) : (y + 1);
                        const int Yc = y;
                        const int Yd = y == 0 ? 0 : (y - 1);
 
-                       for (x= 0; x < ibuf->x; x++) {
+                       for (x = 0; x < ibuf->x; x++) {
                                const int Xl = x == 0 ? 0 : (x - 1);
                                const int Xc = x;
                                const int Xr = x == (ibuf->x - 1) ? (ibuf->x - 1) : (x + 1);
@@ -1244,11 +1244,11 @@ float RE_bake_make_derivative(ImBuf *ibuf, float *heights_buffer, const char *ma
        /* Output derivatives. */
        auto_range_fit &= (max_num_deriv > 0);
        for (y = 0; y < ibuf->y; y++) {
-               const int Yu= y==(ibuf->y-1) ? (ibuf->y-1) : (y+1);
-               const int Yc= y;
-               const int Yd= y==0 ? 0 : (y-1);
+               const int Yu = y == (ibuf->y - 1) ? (ibuf->y - 1) : (y + 1);
+               const int Yc = y;
+               const int Yd = y == 0 ? 0 : (y - 1);
 
-               for(x= 0; x<ibuf->x; x++) {
+               for (x = 0; x < ibuf->x; x++) {
                        const int Xl = x == 0 ? 0 : (x - 1);
                        const int Xc = x;
                        const int Xr = x == (ibuf->x - 1) ? (ibuf->x - 1) : (x + 1);
@@ -1269,14 +1269,15 @@ float RE_bake_make_derivative(ImBuf *ibuf, float *heights_buffer, const char *ma
 
                        /* Early out. */
                        index = ibuf->x * y + x;
-                       if (mask[index] != FILTER_MASK_USED){
+                       if (mask[index] != FILTER_MASK_USED) {
                                continue;
                        }
 
                        if (auto_range_fit) {
                                deriv_x /= max_num_deriv;
                                deriv_y /= max_num_deriv;
-                       } else {
+                       }
+                       else {
                                deriv_x *= (fmult / denom);
                                deriv_y *= (fmult / denom);
                        }
@@ -1296,8 +1297,9 @@ float RE_bake_make_derivative(ImBuf *ibuf, float *heights_buffer, const char *ma
                                rrgbf[1] = deriv_y;
                                rrgbf[2] = 0.0f;
                                rrgbf[3] = 1.0f;
-                       } else {
-                               char *rrgb = (char*)ibuf->rect + index * 4;
+                       }
+                       else {
+                               char *rrgb = (char *)ibuf->rect + index * 4;
 
                                rrgb[0] = FTOCHAR(deriv_x);
                                rrgb[1] = FTOCHAR(deriv_y);
index 49052150fe3374917dadc80e55813bb9df4b73a5..e8127b0e6b9fe7345081f64839ec52ee52b0717a 100644 (file)
@@ -1724,7 +1724,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
        const float bf = -0.04f*Tnor*mtex->norfac;
        int rgbnor;
        /* disable internal bump eval */
-       floatnvec = texres->nor;
+       float *nvec = texres->nor;
        texres->nor = NULL;
        /* du & dv estimates, constant value defaults */
        du = dv = 0.01f;