From da710b3e14e75db10f336009a9d32c187c632042 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 24 May 2012 16:35:45 +0000 Subject: style cleanup: brace placement/newlines --- source/blender/blenkernel/intern/particle_system.c | 3 +- source/blender/blenkernel/intern/pointcache.c | 10 ++-- source/blender/blenkernel/intern/softbody.c | 61 ++++++++++++---------- source/blender/blenloader/intern/versioning_250.c | 2 +- source/blender/editors/physics/particle_edit.c | 3 +- source/blender/editors/space_clip/tracking_ops.c | 4 +- source/blender/editors/space_node/node_templates.c | 3 +- source/blender/editors/transform/transform_snap.c | 5 +- source/blender/gpu/intern/gpu_codegen.c | 3 +- source/blender/gpu/intern/gpu_draw.c | 5 +- source/blender/gpu/intern/gpu_extensions.c | 5 +- source/blender/imbuf/intern/cineon/logImageLib.c | 9 ++-- source/blender/modifiers/intern/MOD_skin.c | 3 +- .../blender/render/intern/source/convertblender.c | 3 +- source/blender/render/intern/source/rendercore.c | 2 +- 15 files changed, 69 insertions(+), 52 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 9497a81d386..fa47600deb2 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4444,7 +4444,8 @@ static void psys_prepare_physics(ParticleSimulationData *sim) static int hair_needs_recalc(ParticleSystem *psys) { if (!(psys->flag & PSYS_EDITED) && (!psys->edit || !psys->edit->edited) && - ((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET || (psys->part->flag & PART_HAIR_REGROW && !psys->edit))) { + ((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET || (psys->part->flag & PART_HAIR_REGROW && !psys->edit))) + { return 1; } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index f676cfb2fb8..90d17e53349 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2190,8 +2190,9 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra) BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num)); frame = atoi(num); - if ((mode==PTCACHE_CLEAR_BEFORE && frame < cfra) || - (mode==PTCACHE_CLEAR_AFTER && frame > cfra) ) { + if ((mode == PTCACHE_CLEAR_BEFORE && frame < cfra) || + (mode == PTCACHE_CLEAR_AFTER && frame > cfra)) + { BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name); BLI_delete(path_full, 0, 0); @@ -2226,8 +2227,9 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra) } else { while (pm) { - if ((mode==PTCACHE_CLEAR_BEFORE && pm->frame < cfra) || - (mode==PTCACHE_CLEAR_AFTER && pm->frame > cfra) ) { + if ((mode == PTCACHE_CLEAR_BEFORE && pm->frame < cfra) || + (mode == PTCACHE_CLEAR_AFTER && pm->frame > cfra)) + { link = pm; if (pid->cache->cached_frames && pm->frame >=sta && pm->frame <= end) pid->cache->cached_frames[pm->frame-sta] = 0; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 85027efa246..5abc4bc3830 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1054,11 +1054,12 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), unsigned int U a = ccdm->totface; #endif if ((aabbmax[0] < ccdm->bbmin[0]) || - (aabbmax[1] < ccdm->bbmin[1]) || - (aabbmax[2] < ccdm->bbmin[2]) || - (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || - (aabbmin[2] > ccdm->bbmax[2]) ) { + (aabbmax[1] < ccdm->bbmin[1]) || + (aabbmax[2] < ccdm->bbmin[2]) || + (aabbmin[0] > ccdm->bbmax[0]) || + (aabbmin[1] > ccdm->bbmax[1]) || + (aabbmin[2] > ccdm->bbmax[2]) ) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1125,11 +1126,12 @@ static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float mprevvert= ccdm->mprevvert; outerfacethickness = ob->pd->pdef_sboft; if ((aabbmax[0] < ccdm->bbmin[0]) || - (aabbmax[1] < ccdm->bbmin[1]) || - (aabbmax[2] < ccdm->bbmin[2]) || - (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || - (aabbmin[2] > ccdm->bbmax[2]) ) { + (aabbmax[1] < ccdm->bbmin[1]) || + (aabbmax[2] < ccdm->bbmin[2]) || + (aabbmin[0] > ccdm->bbmax[0]) || + (aabbmin[1] > ccdm->bbmax[1]) || + (aabbmin[2] > ccdm->bbmax[2]) ) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1220,11 +1222,12 @@ static int sb_detect_face_collisionCached(float face_v1[3], float face_v2[3], fl a = ccdm->totface; if ((aabbmax[0] < ccdm->bbmin[0]) || - (aabbmax[1] < ccdm->bbmin[1]) || - (aabbmax[2] < ccdm->bbmin[2]) || - (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || - (aabbmin[2] > ccdm->bbmax[2]) ) { + (aabbmax[1] < ccdm->bbmin[1]) || + (aabbmax[2] < ccdm->bbmin[2]) || + (aabbmin[0] > ccdm->bbmax[0]) || + (aabbmin[1] > ccdm->bbmax[1]) || + (aabbmin[2] > ccdm->bbmax[2]) ) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1447,11 +1450,12 @@ static int sb_detect_edge_collisionCached(float edge_v1[3], float edge_v2[3], fl a = ccdm->totface; if ((aabbmax[0] < ccdm->bbmin[0]) || - (aabbmax[1] < ccdm->bbmin[1]) || - (aabbmax[2] < ccdm->bbmin[2]) || - (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || - (aabbmin[2] > ccdm->bbmax[2]) ) { + (aabbmax[1] < ccdm->bbmin[1]) || + (aabbmax[2] < ccdm->bbmin[2]) || + (aabbmin[0] > ccdm->bbmax[0]) || + (aabbmin[1] > ccdm->bbmax[1]) || + (aabbmin[2] > ccdm->bbmax[2]) ) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1785,14 +1789,15 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], maxz = ccdm->bbmax[2]; if ((opco[0] < minx) || - (opco[1] < miny) || - (opco[2] < minz) || - (opco[0] > maxx) || - (opco[1] > maxy) || - (opco[2] > maxz) ) { - /* outside the padded boundbox --> collision object is too far away */ - BLI_ghashIterator_step(ihash); - continue; + (opco[1] < miny) || + (opco[2] < minz) || + (opco[0] > maxx) || + (opco[1] > maxy) || + (opco[2] > maxz) ) + { + /* outside the padded boundbox --> collision object is too far away */ + BLI_ghashIterator_step(ihash); + continue; } } else { diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index c028c374cce..4a69c37ae1b 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -623,7 +623,7 @@ static void do_version_constraints_radians_degrees_250(ListBase *lb) { bConstraint *con; - for (con = lb->first; con; con = con->next) { + for (con = lb->first; con; con = con->next) { if (con->type == CONSTRAINT_TYPE_RIGIDBODYJOINT) { bRigidBodyJointConstraint *data = con->data; data->axX *= (float)(M_PI / 180.0); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 9f5e700616e..adb5cdede2a 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3494,7 +3494,8 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) pset->flag &= ~PE_LOCK_FIRST; if (((pset->brushtype == PE_BRUSH_ADD) ? - (sqrt(dx * dx + dy * dy) > pset->brush[PE_BRUSH_ADD].step) : (dx != 0 || dy != 0)) || bedit->first) { + (sqrt(dx * dx + dy * dy) > pset->brush[PE_BRUSH_ADD].step) : (dx != 0 || dy != 0)) || bedit->first) + { PEData data= bedit->data; view3d_operator_needs_opengl(C); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 3d1ff26d586..8fafcd9d675 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -712,8 +712,8 @@ static float dist_to_rect(float co[2], float pos[2], float min[2], float max[2]) { float d1, d2, d3, d4; float p[2] = {co[0] - pos[0], co[1] - pos[1]}; - float v1[2] = {min[0], min[1]}, v2[2] = {max[0], min[1]}, - v3[2] = {max[0], max[1]}, v4[2] = {min[0], max[1]}; + float v1[2] = {min[0], min[1]}, v2[2] = {max[0], min[1]}; + float v3[2] = {max[0], max[1]}, v4[2] = {min[0], max[1]}; d1 = dist_to_line_segment_v2(p, v1, v2); d2 = dist_to_line_segment_v2(p, v2, v3); diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index bd79b9dde00..ee3827428bc 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -175,7 +175,8 @@ static void node_socket_add_replace(Main *bmain, bNodeTree *ntree, bNode *node_t node_from = NULL; if (node_prev && node_prev->type == ntemp->type && - (ntemp->type != NODE_GROUP || node_prev->id == &ntemp->ngroup->id)) { + (ntemp->type != NODE_GROUP || node_prev->id == &ntemp->ngroup->id)) + { /* keep the previous node if it's the same type */ node_from = node_prev; } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 137d0838587..a04ce1ca213 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -380,8 +380,9 @@ static void initSnappingMode(TransInfo *t) t->tsnap.mode = ts->snap_mode; - if ((t->spacetype == SPACE_VIEW3D || t->spacetype == SPACE_IMAGE) && // Only 3D view or UV - (t->flag & T_CAMERA) == 0) { // Not with camera selected in camera view + if ((t->spacetype == SPACE_VIEW3D || t->spacetype == SPACE_IMAGE) && /* Only 3D view or UV */ + (t->flag & T_CAMERA) == 0) /* Not with camera selected in camera view */ + { setSnappingCallback(t); /* Edit mode */ diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 6a2c3eee7a5..a88a075383d 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -387,7 +387,8 @@ static void codegen_set_unique_ids(ListBase *nodes) /* set texid used for settings texture slot with multitexture */ if (codegen_input_has_texture(input) && - ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL))) { + ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL))) + { if (input->link) { /* input is texture from buffer, assign only one texid per * buffer to avoid sampling the same texture twice */ diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 6538da2eb61..604e8f8d50e 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -766,8 +766,9 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap) ibuf = BKE_image_get_ibuf(ima, NULL); if (ima->repbind || (gpu_get_mipmap() && mipmap) || !ima->bindcode || !ibuf || - (!is_power_of_2_i(ibuf->x) || !is_power_of_2_i(ibuf->y)) || - (w == 0) || (h == 0)) { + (!is_power_of_2_i(ibuf->x) || !is_power_of_2_i(ibuf->y)) || + (w == 0) || (h == 0)) + { /* these cases require full reload still */ GPU_free_image(ima); } diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index f4d5812ffb7..4974d57d64c 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -1074,8 +1074,9 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU shader->object = glCreateProgramObjectARB(); if (!shader->object || - (vertexcode && !shader->vertex) || - (fragcode && !shader->fragment)) { + (vertexcode && !shader->vertex) || + (fragcode && !shader->fragment)) + { fprintf(stderr, "GPUShader, object creation failed.\n"); GPU_shader_free(shader); return NULL; diff --git a/source/blender/imbuf/intern/cineon/logImageLib.c b/source/blender/imbuf/intern/cineon/logImageLib.c index f479220d82c..ccc6045e6e5 100644 --- a/source/blender/imbuf/intern/cineon/logImageLib.c +++ b/source/blender/imbuf/intern/cineon/logImageLib.c @@ -121,10 +121,11 @@ int logImageSetByteConversion(LogImageFile* logImage, const LogImageByteConversionParameters* params) { if ((params->gamma >= MIN_GAMMA) && - (params->gamma <= MAX_GAMMA) && - (params->blackPoint >= 0) && - (params->blackPoint < params->whitePoint) && - (params->whitePoint <= 1023)) { + (params->gamma <= MAX_GAMMA) && + (params->blackPoint >= 0) && + (params->blackPoint < params->whitePoint) && + (params->whitePoint <= 1023)) + { logImage->params.gamma = params->gamma; logImage->params.blackPoint = params->blackPoint; logImage->params.whitePoint = params->whitePoint; diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 9d2ce657bde..a13bc3563c5 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -716,7 +716,8 @@ static int calc_edge_subdivisions(const MVert *mvert, const MVertSkin *nodes, /* If either end is a branch node marked 'loose', don't subdivide * the edge (or subdivide just twice if both are branches) */ if ((v1_branch && (evs[0]->flag & MVERT_SKIN_LOOSE)) || - (v2_branch && (evs[1]->flag & MVERT_SKIN_LOOSE))) { + (v2_branch && (evs[1]->flag & MVERT_SKIN_LOOSE))) + { if (v1_branch && v2_branch) return 2; else diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 150bfae4731..bda8baa5e30 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3790,7 +3790,8 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) lar->area_sizey= lar->area_size; if ((la->sun_effect_type & LA_SUN_EFFECT_SKY) || - (la->sun_effect_type & LA_SUN_EFFECT_AP)) { + (la->sun_effect_type & LA_SUN_EFFECT_AP)) + { lar->sunsky = (struct SunSky*)MEM_callocN(sizeof(struct SunSky), "sunskyren"); lar->sunsky->effect_type = la->sun_effect_type; diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 2fd8e49d34e..7addc1e6679 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2169,7 +2169,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua else { unsigned char *col= (unsigned char *)(bs->rect + bs->rectx*y + x); - if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE) && (R.r.color_mgt_flag & R_COLOR_MANAGEMENT)) { + if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE) && (R.r.color_mgt_flag & R_COLOR_MANAGEMENT)) { linearrgb_to_srgb_uchar3(col, shr.combined); } else { -- cgit v1.2.3