diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
commit | d599b643b7a1882ea79851e334d7ed133f362bb3 (patch) | |
tree | 4e4640c1b2e7cc82d9db81dbd98a39777dcbce7c /source/blender | |
parent | f3ece5a108db0bdbefb4663ef4ebd9a7e039e263 (diff) |
style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
Diffstat (limited to 'source/blender')
41 files changed, 136 insertions, 140 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 1d23c374852..4e00e1bce0b 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -1050,29 +1050,25 @@ static void cloth_update_springs( ClothModifierData *clmd ) spring->stiffness = 0.0f; - if(spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) - { + if (spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) { spring->stiffness = (cloth->verts[spring->kl].struct_stiff + cloth->verts[spring->ij].struct_stiff) / 2.0f; } - else if(spring->type == CLOTH_SPRING_TYPE_SHEAR) - { + else if (spring->type == CLOTH_SPRING_TYPE_SHEAR) { spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0f; } - else if(spring->type == CLOTH_SPRING_TYPE_BENDING) - { + else if (spring->type == CLOTH_SPRING_TYPE_BENDING) { spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0f; } - else if(spring->type == CLOTH_SPRING_TYPE_GOAL) - { + else if (spring->type == CLOTH_SPRING_TYPE_GOAL) { /* Warning: Appending NEW goal springs does not work because implicit solver would need reset! */ /* Activate / Deactivate existing springs */ - if ((!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED)) && (cloth->verts[spring->ij].goal > ALMOST_ZERO)) + if ((!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED)) && + (cloth->verts[spring->ij].goal > ALMOST_ZERO)) { spring->flags &= ~CLOTH_SPRING_FLAG_DEACTIVATE; } - else - { + else { spring->flags |= CLOTH_SPRING_FLAG_DEACTIVATE; } } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index e09e2eeb493..e7e645bd425 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1476,7 +1476,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende } } else if (cu->ext1 == 0.0f && cu->ext2 == 0.0f) { - ; + /* pass */ } else if (cu->ext2 == 0.0f) { dl = MEM_callocN(sizeof(DispList), "makebevelcurve2"); diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 787d5c65e9d..d1ef5d7376b 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -711,7 +711,7 @@ static void update_matrixS(ClothVertex *verts, int numverts, fmatrix3x3 *S) int i = 0; /* Clear matrix from old vertex constraints */ - for(i = 0; i < S[0].vcount; i++) + for (i = 0; i < S[0].vcount; i++) S[i].c = S[i].r = 0; /* Set new vertex constraints */ @@ -1662,7 +1662,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec while (search) { // only handle active springs ClothSpring *spring = search->link; - if( !(spring->flags & CLOTH_SPRING_FLAG_DEACTIVATE)) + if (!(spring->flags & CLOTH_SPRING_FLAG_DEACTIVATE)) cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time); search = search->next; diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 9951412063d..2f04df06d66 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -982,14 +982,16 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb) if (ma->nodetree && ma->use_nodes) ntreeShaderGetTexcoMode(ma->nodetree, r_mode, &ma->texco, &ma->mode_l); - /* local group override */ - if((ma->shade_flag & MA_GROUP_LOCAL) && ma->id.lib && ma->group && ma->group->id.lib) { - Group *group; - - for(group= G.main->group.first; group; group= group->id.next) - if(!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0) - ma->group = group; - } + /* local group override */ + if ((ma->shade_flag & MA_GROUP_LOCAL) && ma->id.lib && ma->group && ma->group->id.lib) { + Group *group; + + for (group = G.main->group.first; group; group = group->id.next) { + if (!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0) { + ma->group = group; + } + } + } } static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode, float *amb) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 98dce0894a8..88f3eb15610 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -691,7 +691,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v) sds->dx = ch_dx; VECCOPY(sds->res, ch_res); sds->total_cells = ch_res[0]*ch_res[1]*ch_res[2]; - if(sds->flags & MOD_SMOKE_HIGHRES) { + if (sds->flags & MOD_SMOKE_HIGHRES) { smoke_reallocate_highres_fluid(sds, ch_dx, ch_res, 1); } } diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index c8d6ec73d28..4595b4bd78b 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -640,7 +640,6 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData tsmd->flow->flags = smd->flow->flags; } else if (tsmd->coll) { - ; /* leave it as initialized, collision settings is mostly caches */ } } @@ -699,7 +698,7 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds numverts = dm->getNumVerts(dm); // DG TODO - // if(scs->type > SM_COLL_STATIC) + // if (scs->type > SM_COLL_STATIC) // if line above is used, the code is in trouble if the object moves but is declared as "does not move" { diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index 1c70a612c4f..2e9f5c151c5 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -73,7 +73,7 @@ typedef struct BoxVert { ((b)->v[BR]->x = (b)->v[TR]->x) #define UPDATE_V34Y(b) ((b)->v[TL]->y = (b)->v[TR]->y); \ ((b)->v[BR]->y = (b)->v[BL]->y) - + /* UNUSED */ // #define UPDATE_V34(b) UPDATE_V34X(b); UPDATE_V34Y(b) diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 6d8991c749b..00c44bdc008 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -2062,7 +2062,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) { brush->add_col[0] = 1.00f; brush->add_col[1] = 0.39f; - brush->add_col[2] = 0.39f; + brush->add_col[2] = 0.39f; } if (brush->sub_col[0] == 0 && diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 731170f963c..bd1c0f809bd 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -84,7 +84,7 @@ static int count_edge_faces(BMesh *bm, BMEdge *e); BLI_INLINE BMDiskLink *rs_edge_link_get(BMEdge *e, BMVert *v, EdgeData *e_data) { return v == ((BMEdge *)e)->v1 ? &(((EdgeData *)e_data)->v1_disk_link) : - &(((EdgeData *)e_data)->v2_disk_link) ; + &(((EdgeData *)e_data)->v2_disk_link); } static int rotsys_append_edge(BMEdge *e, BMVert *v, diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 9d2d86fd3cf..26b5edf7ea6 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -265,7 +265,7 @@ void AnimationExporter::dae_animation(Object *ob, FCurve *fcu, char *transformNa MEM_freeN(eul); MEM_freeN(eul_axis); } - else if(!strcmp(transformName, "lens") && (ob->type == OB_CAMERA)) { + else if (!strcmp(transformName, "lens") && (ob->type == OB_CAMERA)) { output_id = create_lens_source_from_fcurve((Camera *) ob->data, COLLADASW::InputSemantic::OUTPUT, fcu, anim_id); } else { diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 02d1e1166c9..374f6385ea7 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -854,14 +854,13 @@ static const double get_aspect_ratio(const COLLADAFW::Camera *camera) { double aspect = camera->getAspectRatio().getValue(); - if(aspect == 0) - { + if (aspect == 0) { const double yfov = camera->getYFov().getValue(); - if(yfov == 0) - aspect=1; // assume yfov and xfov are equal - else - { + if (yfov == 0) { + aspect = 1; // assume yfov and xfov are equal + } + else { const double xfov = camera->getXFov().getValue(); if (xfov==0) aspect = 1; @@ -885,7 +884,7 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node, COLLADAFW::Node *root = root_map.find(uid) == root_map.end() ? node : root_map[uid]; Object *ob; - if(is_joint) + if (is_joint) ob = armature_importer->get_armature_for_joint(root); else ob = object_map.find(uid) == object_map.end() ? NULL : object_map.find(uid)->second; diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp index 03e96bebb61..e4a654dc99a 100644 --- a/source/blender/collada/EffectExporter.cpp +++ b/source/blender/collada/EffectExporter.cpp @@ -381,7 +381,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob) } std::set<Image *>::iterator uv_t_iter; - for(uv_t_iter = uv_textures.begin(); uv_t_iter != uv_textures.end(); uv_t_iter++ ) { + for (uv_t_iter = uv_textures.begin(); uv_t_iter != uv_textures.end(); uv_t_iter++ ) { Image *ima = *uv_t_iter; std::string key(id_name(ima)); key = translate_id(key); diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp index a15dadda8cf..2e0c0f1ea57 100644 --- a/source/blender/collada/ImageExporter.cpp +++ b/source/blender/collada/ImageExporter.cpp @@ -62,7 +62,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies) if (not_yet_exported) { ImBuf *imbuf = BKE_image_get_ibuf(image, NULL); - if(!imbuf) { + if (!imbuf) { fprintf(stderr, "Collada export: image does not exist:\n%s\n", image->name); return; } diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index e5493bc237d..8337a977b3b 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -998,7 +998,7 @@ static bool bc_has_same_material_configuration(Object *ob1, Object *ob2) if (ob1->totcol != ob2->totcol) return false; // not same number of materials if (ob1->totcol == 0) return false; // no material at all - for(int index=0; index < ob1->totcol; index++) { + for (int index=0; index < ob1->totcol; index++) { if (ob1->matbits[index] != ob2->matbits[index]) return false; // shouldn't happen if (ob1->matbits[index] == 0) return false; // shouldn't happen if (ob1->mat[index] != ob2->mat[index]) return false; // different material assignment diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp index 4ae114bd031..7b52c52154d 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cpp +++ b/source/blender/compositor/intern/COM_NodeOperation.cpp @@ -126,7 +126,7 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOper else { rcti tempOutput; bool first = true; - for (int i = 0 ; i < getNumberOfInputSockets() ; i ++) { + for (int i = 0; i < getNumberOfInputSockets(); i ++) { NodeOperation * inputOperation = this->getInputOperation(i); if (inputOperation && inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) { if (first) { diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp index 7ab00b202e1..02627bae5ed 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp @@ -95,7 +95,7 @@ void GaussianYBlurOperation::executePixel(float output[4], int x, int y, void *d int index; int step = getStep(); - const int bufferIndexx = ((minx - bufferstartx) * 4) ; + const int bufferIndexx = ((minx - bufferstartx) * 4); for (int ny = miny; ny < maxy; ny += step) { index = (ny - y) + this->m_rad; int bufferindex = bufferIndexx + ((ny - bufferstarty) * 4 * bufferwidth); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 5d4609fcd7c..0a244db5df8 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -3301,7 +3301,9 @@ static void hide_unselected_armature_bones(Scene *scene) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { bArmature *arm = obedit->data; if (EBONE_VISIBLE(arm, ebone)) { - if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL)) ; + if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL)) { + /* pass */ + } else { ebone->flag |= BONE_HIDDEN_A; } diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 82fef00b1e6..0f1d48ff8af 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1195,7 +1195,7 @@ static int meshdeform_tri_intersect(const float orig[3], const float end[3], con } static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) - { +{ void **data = userdata; MeshDeformBind *mdb = data[1]; MFace *mface = data[0], *mf; @@ -1210,7 +1210,7 @@ static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *r if (mf->v4) copy_v3_v3(face[3], mdb->cagecos[mf->v4]); - add_v3_v3v3(end, isec->start, isec->vec); + add_v3_v3v3(end, isec->start, isec->vec); if (!meshdeform_tri_intersect(ray->origin, end, face[0], face[1], face[2], co, uvw)) if (!mf->v4 || !meshdeform_tri_intersect(ray->origin, end, face[0], face[2], face[3], co, uvw)) @@ -1257,7 +1257,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float if (BLI_bvhtree_ray_cast(mdb->bvhtree, isect_mdef.start, isect_mdef.vec, 0.0, &hit, harmonic_ray_callback, data) != -1) { - len = isect_mdef.labda; + len = isect_mdef.labda; isect_mdef.face = mface = mface1 + hit.index; /* create MDefBoundIsect */ diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index b9f6f0bc186..90ac3ddc6f7 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -405,27 +405,27 @@ typedef enum WT_Method { typedef enum WT_ReplaceMode { WT_REPLACE_ALL_WEIGHTS = 1, - WT_REPLACE_EMPTY_WEIGHTS = 2, + WT_REPLACE_EMPTY_WEIGHTS = 2 } WT_ReplaceMode; static EnumPropertyItem WT_vertex_group_mode_item[] = { - {WT_REPLACE_ACTIVE_VERTEX_GROUP, "WT_REPLACE_ACTIVE_VERTEX_GROUP", 1, "Active", "Transfer active vertex group from selected to active mesh."}, - {WT_REPLACE_ALL_VERTEX_GROUPS, "WT_REPLACE_ALL_VERTEX_GROUPS", 1, "All", "Transfer all vertex groups from selected to active mesh."}, - {0, NULL, 0, NULL, NULL} + {WT_REPLACE_ACTIVE_VERTEX_GROUP, "WT_REPLACE_ACTIVE_VERTEX_GROUP", 1, "Active", "Transfer active vertex group from selected to active mesh."}, + {WT_REPLACE_ALL_VERTEX_GROUPS, "WT_REPLACE_ALL_VERTEX_GROUPS", 1, "All", "Transfer all vertex groups from selected to active mesh."}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem WT_method_item[] = { - {WT_BY_INDEX, "WT_BY_INDEX", 1, "Vertex index", "Copy for identical meshes."}, - {WT_BY_NEAREST_VERTEX, "WT_BY_NEAREST_VERTEX", 1, "Nearest vertex", "Copy weight from closest vertex."}, - {WT_BY_NEAREST_FACE, "WT_BY_NEAREST_FACE", 1, "Nearest face", "Barycentric interpolation from nearest face."}, - {WT_BY_NEAREST_VERTEX_IN_FACE, "WT_BY_NEAREST_VERTEX_IN_FACE", 1, "Nearest vertex in face", "Copy weight from closest vertex in nearest face."}, - {0, NULL, 0, NULL, NULL} + {WT_BY_INDEX, "WT_BY_INDEX", 1, "Vertex index", "Copy for identical meshes."}, + {WT_BY_NEAREST_VERTEX, "WT_BY_NEAREST_VERTEX", 1, "Nearest vertex", "Copy weight from closest vertex."}, + {WT_BY_NEAREST_FACE, "WT_BY_NEAREST_FACE", 1, "Nearest face", "Barycentric interpolation from nearest face."}, + {WT_BY_NEAREST_VERTEX_IN_FACE, "WT_BY_NEAREST_VERTEX_IN_FACE", 1, "Nearest vertex in face", "Copy weight from closest vertex in nearest face."}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem WT_replace_mode_item[] = { - {WT_REPLACE_ALL_WEIGHTS, "WT_REPLACE_ALL_WEIGHTS", 1, "All", "Overwrites all weights."}, - {WT_REPLACE_EMPTY_WEIGHTS, "WT_REPLACE_EMPTY_WEIGHTS", 1, "Empty", "Adds weights to vertices with no weight."}, - {0, NULL, 0, NULL, NULL} + {WT_REPLACE_ALL_WEIGHTS, "WT_REPLACE_ALL_WEIGHTS", 1, "All", "Overwrites all weights."}, + {WT_REPLACE_EMPTY_WEIGHTS, "WT_REPLACE_EMPTY_WEIGHTS", 1, "Empty", "Adds weights to vertices with no weight."}, + {0, NULL, 0, NULL, NULL} }; /*copy weight*/ diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index 5b1c03f65df..c5320fde0ff 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -82,7 +82,7 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) return; /* don't call this recursively for frame updates */ - if(recursive_check) + if (recursive_check) return; recursive_check = TRUE; diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index 0d33c44db8f..5ec7f4d05b6 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -220,7 +220,6 @@ void render_view_open(bContext *C, int mx, int my) else { /* Leave it alone so the image editor will just go back from * full screen to the original tiled setup */ - ; } } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index cdf68d97e4d..e56443fa4b5 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1855,7 +1855,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event) break; case ESCKEY: - ; + break; } return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index e84db87c5eb..df8ef6cc750 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2429,8 +2429,7 @@ static int image_record_composite_exec(bContext *C, wmOperator *op) if (!image_record_composite_init(C, op)) return OPERATOR_CANCELLED; - while (image_record_composite_apply(C, op)) - ; + while (image_record_composite_apply(C, op)) {} image_record_composite_exit(C, op); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 876c2f9985b..4131cbfdd0d 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -550,7 +550,7 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar) int width, height, winx, winy; #if 0 - if (image_preview_active(curarea, &width, &height)) ; + if (image_preview_active(curarea, &width, &height)) {} else #endif ED_space_image_get_size(sima, &width, &height); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 74a2292d74c..d21465155e0 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -498,7 +498,7 @@ int calc_manipulator_stats(const bContext *C) } } else if (ob && (ob->mode & OB_MODE_ALL_PAINT)) { - ; + /* pass */ } else if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) { PTCacheEdit *edit = PE_get_current(scene, ob); diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp index d9d0cb86ee0..1fd41aa8c2d 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp @@ -737,7 +737,7 @@ void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask { // Compute bit count from the masks. uint total = rmask | gmask | bmask | amask; - while(total != 0) { + while (total != 0) { bitcount++; total >>= 1; } diff --git a/source/blender/imbuf/intern/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h index ce36fb00b97..2bb1864e49d 100644 --- a/source/blender/imbuf/intern/dds/PixelFormat.h +++ b/source/blender/imbuf/intern/dds/PixelFormat.h @@ -101,37 +101,37 @@ } } - inline float quantizeCeil(float f, int inbits, int outbits) - { - //uint i = f * (float(1 << inbits) - 1); - //i = convert(i, inbits, outbits); - //float result = float(i) / (float(1 << outbits) - 1); - //nvCheck(result >= f); - float result; - int offset = 0; - do { - uint i = offset + uint(f * (float(1 << inbits) - 1)); - i = convert(i, inbits, outbits); - result = float(i) / (float(1 << outbits) - 1); - offset++; - } while (result < f); - - return result; - } - - /* - inline float quantizeRound(float f, int bits) - { - float scale = float(1 << bits); - return fround(f * scale) / scale; - } - - inline float quantizeFloor(float f, int bits) - { - float scale = float(1 << bits); - return floor(f * scale) / scale; - } - */ + inline float quantizeCeil(float f, int inbits, int outbits) + { + //uint i = f * (float(1 << inbits) - 1); + //i = convert(i, inbits, outbits); + //float result = float(i) / (float(1 << outbits) - 1); + //nvCheck(result >= f); + float result; + int offset = 0; + do { + uint i = offset + uint(f * (float(1 << inbits) - 1)); + i = convert(i, inbits, outbits); + result = float(i) / (float(1 << outbits) - 1); + offset++; + } while (result < f); + + return result; + } + +#if 0 + inline float quantizeRound(float f, int bits) + { + float scale = float(1 << bits); + return fround(f * scale) / scale; + } + + inline float quantizeFloor(float f, int bits) + { + float scale = float(1 << bits); + return floor(f * scale) / scale; + } +#endif } // PixelFormat namespace diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0d7d20d04ae..cd0ea107f50 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -71,12 +71,12 @@ EnumPropertyItem node_quality_items[] = { }; EnumPropertyItem node_chunksize_items[] = { - {NTREE_CHUNCKSIZE_32, "32", 0, "32x32", "Chunksize of 32x32"}, - {NTREE_CHUNCKSIZE_64, "64", 0, "64x64", "Chunksize of 64x64"}, - {NTREE_CHUNCKSIZE_128, "128", 0, "128x128", "Chunksize of 128x128"}, - {NTREE_CHUNCKSIZE_256, "256", 0, "256x256", "Chunksize of 256x256"}, - {NTREE_CHUNCKSIZE_512, "512", 0, "512x512", "Chunksize of 512x512"}, - {NTREE_CHUNCKSIZE_1024, "1024", 0, "1024x1024", "Chunksize of 1024x1024"}, + {NTREE_CHUNCKSIZE_32, "32", 0, "32x32", "Chunksize of 32x32"}, + {NTREE_CHUNCKSIZE_64, "64", 0, "64x64", "Chunksize of 64x64"}, + {NTREE_CHUNCKSIZE_128, "128", 0, "128x128", "Chunksize of 128x128"}, + {NTREE_CHUNCKSIZE_256, "256", 0, "256x256", "Chunksize of 256x256"}, + {NTREE_CHUNCKSIZE_512, "512", 0, "512x512", "Chunksize of 512x512"}, + {NTREE_CHUNCKSIZE_1024, "1024", 0, "1024x1024", "Chunksize of 1024x1024"}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py index e3359fbae59..0231e57fcfd 100755 --- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py +++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py @@ -130,11 +130,11 @@ def get_props_from_txt(input_filename): line = line[1:] # class - [bclass, tail] = [x.strip() for x in line.split('.', 1)] + bclass, tail = [x.strip() for x in line.split('.', 1)] # comment if '*' in bclass: - [comment, bclass] = [x.strip() for x in bclass.split('*', 1)] + comment, bclass = [x.strip() for x in bclass.split('*', 1)] else: comment= '' @@ -144,18 +144,18 @@ def get_props_from_txt(input_filename): continue # from - [bfrom, tail] = [x.strip() for x in tail.split('->', 1)] + bfrom, tail = [x.strip() for x in tail.split('->', 1)] # to - [bto, tail] = [x.strip() for x in tail.split(':', 1)] + bto, tail = [x.strip() for x in tail.split(':', 1)] # type, description try: - [btype, description] = tail.split(None, 1) + btype, description = tail.split(None, 1) # make life easy and strip quotes description = description.replace("'", "").replace('"', "").replace("\\", "").strip() except ValueError: - [btype, description] = [tail,'NO DESCRIPTION'] + btype, description = [tail,'NO DESCRIPTION'] # keyword-check kwcheck = check_prefix(bto, btype) diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index e7ece60121e..de7822443f3 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -50,7 +50,7 @@ #include "BKE_tessmesh.h" /* testing only! - Campbell */ -#define USE_DECIMATE_BMESH +// #define USE_DECIMATE_BMESH #include "PIL_time.h" diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index b9593353288..254578f7399 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -206,11 +206,11 @@ static MFace *get_dface(DerivedMesh *dm, DerivedMesh *split, int cur, int i, MFa } #define SET_VERTS(a, b, c, d) { \ - v[0] = mf->v##a; uv[0] = a - 1; \ - v[1] = mf->v##b; uv[1] = b - 1; \ - v[2] = mf->v##c; uv[2] = c - 1; \ - v[3] = mf->v##d; uv[3] = d - 1; \ - } (void)0 + v[0] = mf->v##a; uv[0] = a - 1; \ + v[1] = mf->v##b; uv[1] = b - 1; \ + v[2] = mf->v##c; uv[2] = c - 1; \ + v[3] = mf->v##d; uv[3] = d - 1; \ + } (void)0 #define GET_ES(v1, v2) edgecut_get(eh, v1, v2) #define INT_UV(uvf, c0, c1) interp_v2_v2v2(uvf, mf->uv[c0], mf->uv[c1], 0.5f) diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c index 4a7643f5771..af4b6e1b8d0 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c @@ -45,7 +45,7 @@ static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[]= { static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { - if(!in[3].link) + if (!in[3].link) in[3].link = GPU_builtin(GPU_VIEW_NORMAL); return GPU_stack_link(mat, "node_bsdf_anisotropic", in, out); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c index 63ce637fd72..021373ac40a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c @@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_bsdf_diffuse_out[]= { static int node_shader_gpu_bsdf_diffuse(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { - if(!in[2].link) + if (!in[2].link) in[2].link = GPU_builtin(GPU_VIEW_NORMAL); return GPU_stack_link(mat, "node_bsdf_diffuse", in, out); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c index 7b8b80ae8e2..827e349aca3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c @@ -44,7 +44,7 @@ static bNodeSocketTemplate sh_node_bsdf_glass_out[]= { static int node_shader_gpu_bsdf_glass(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { - if(!in[3].link) + if (!in[3].link) in[3].link = GPU_builtin(GPU_VIEW_NORMAL); return GPU_stack_link(mat, "node_bsdf_glass", in, out); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c index 9f42e23ebb6..2c1adb4f0a3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c @@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_bsdf_glossy_out[]= { static int node_shader_gpu_bsdf_glossy(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { - if(!in[2].link) + if (!in[2].link) in[2].link = GPU_builtin(GPU_VIEW_NORMAL); return GPU_stack_link(mat, "node_bsdf_glossy", in, out); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c index b3290411aee..7412ce81dd1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c @@ -42,7 +42,7 @@ static bNodeSocketTemplate sh_node_bsdf_translucent_out[]= { static int node_shader_gpu_bsdf_translucent(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { - if(!in[1].link) + if (!in[1].link) in[1].link = GPU_builtin(GPU_VIEW_NORMAL); return GPU_stack_link(mat, "node_bsdf_translucent", in, out); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c index 97bc37a84c9..a32aec54b32 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c @@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_bsdf_velvet_out[]= { static int node_shader_gpu_bsdf_velvet(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { - if(!in[2].link) + if (!in[2].link) in[2].link = GPU_builtin(GPU_VIEW_NORMAL); return GPU_stack_link(mat, "node_bsdf_velvet", in, out); diff --git a/source/blender/nodes/shader/nodes/node_shader_particle_info.c b/source/blender/nodes/shader/nodes/node_shader_particle_info.c index ddfcb9476f4..c7e31d117cc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_particle_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_particle_info.c @@ -28,18 +28,18 @@ #include "../node_shader_util.h" static bNodeSocketTemplate outputs[] = { - { SOCK_FLOAT, 0, "Index" }, - { SOCK_FLOAT, 0, "Age" }, - { SOCK_FLOAT, 0, "Lifetime" }, - { SOCK_VECTOR, 0, "Location" }, - #if 0 /* quaternion sockets not yet supported */ - { SOCK_QUATERNION, 0, "Rotation" }, - #endif - { SOCK_FLOAT, 0, "Size" }, - { SOCK_VECTOR, 0, "Velocity" }, - { SOCK_VECTOR, 0, "Angular Velocity" }, - { -1, 0, "" } -}; + { SOCK_FLOAT, 0, "Index" }, + { SOCK_FLOAT, 0, "Age" }, + { SOCK_FLOAT, 0, "Lifetime" }, + { SOCK_VECTOR, 0, "Location" }, +#if 0 /* quaternion sockets not yet supported */ + { SOCK_QUATERNION, 0, "Rotation" }, +#endif + { SOCK_FLOAT, 0, "Size" }, + { SOCK_VECTOR, 0, "Velocity" }, + { SOCK_VECTOR, 0, "Angular Velocity" }, + { -1, 0, "" } + }; /* node type definition */ void register_node_type_sh_particle_info(bNodeTreeType *ttype) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 1833000f69b..122cc76a3f2 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4617,7 +4617,7 @@ static struct PyMethodDef pyrna_prop_collection_methods[] = { static struct PyMethodDef pyrna_prop_collection_idprop_methods[] = { {"add", (PyCFunction)pyrna_prop_collection_idprop_add, METH_NOARGS, NULL}, {"remove", (PyCFunction)pyrna_prop_collection_idprop_remove, METH_O, NULL}, - {"clear", (PyCFunction)pyrna_prop_collection_idprop_clear, METH_NOARGS, NULL}, + {"clear", (PyCFunction)pyrna_prop_collection_idprop_clear, METH_NOARGS, NULL}, {"move", (PyCFunction)pyrna_prop_collection_idprop_move, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m index b568a1255a8..e420eb1efa7 100644 --- a/source/blender/quicktime/apple/qtkit_import.m +++ b/source/blender/quicktime/apple/qtkit_import.m @@ -102,7 +102,7 @@ int anim_is_quicktime (const char *name) pool = [[NSAutoreleasePool alloc] init]; if([QTMovie canInitWithFile:[NSString stringWithCString:name - encoding:[NSString defaultCStringEncoding]]]) + encoding:[NSString defaultCStringEncoding]]]) { [pool drain]; return true; @@ -162,11 +162,11 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height) /*Get the bitmap of the image*/ enumerator = [[sourceImage representations] objectEnumerator]; while ((representation = [enumerator nextObject])) { - if ([representation isKindOfClass:[NSBitmapImageRep class]]) { - bitmapImage = (NSBitmapImageRep *)representation; + if ([representation isKindOfClass:[NSBitmapImageRep class]]) { + bitmapImage = (NSBitmapImageRep *)representation; break; - } - } + } + } if (bitmapImage == nil) return NULL; if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) @@ -382,7 +382,7 @@ int startquicktime (struct anim *anim) anim->curposition = 0; [pool drain]; - + return 0; } diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index f01f37019a0..558ba8fe062 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -216,7 +216,7 @@ static void envmap_transmatrix(float mat[][4], int part) eul[0] = eul[1] = eul[2] = 0.0; if (part == 0) { /* neg z */ - ; + /* pass */ } else if (part == 1) { /* pos z */ eul[0] = M_PI; |