style cleanup

This commit is contained in:
Campbell Barton 2013-10-16 04:08:20 +00:00
parent 859dfccb58
commit ecf2eeef23
8 changed files with 22 additions and 20 deletions

@ -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

@ -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);
}

@ -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;
}

@ -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);

@ -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

@ -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.
*/

@ -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; 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);

@ -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;