diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index ab35d774719..608cd920865 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -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 diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index dbe1197436b..06581fb3c11 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -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); } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index f3f12464528..9e8a8fd3ecc 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -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; } diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index dc62005f760..d169fc58260 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -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); diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index d7919125fee..8e0d0e55709 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -65,7 +65,7 @@ static char *glsl_material_library = NULL; /* structs and defines */ -static const char* GPU_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 diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index a20cb73b3aa..6d6f516ecac 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -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. */ diff --git a/source/blender/render/intern/source/bake.c b/source/blender/render/intern/source/bake.c index 72e47f89bb2..cb6ca0e30ac 100644 --- a/source/blender/render/intern/source/bake.c +++ b/source/blender/render/intern/source/bake.c @@ -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 x, y; 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; xx; 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); diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 49052150fe3..e8127b0e6b9 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -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 */ - float* nvec = texres->nor; + float *nvec = texres->nor; texres->nor = NULL; /* du & dv estimates, constant value defaults */ du = dv = 0.01f;