From c1c26c36f62c3bfdb40b01f33004695a09ce2f4d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 22 Dec 2013 14:11:10 +1100 Subject: Style Cleanup: remove preprocessor indentation (updated wiki style guide too) --- source/blender/blenkernel/intern/CCGSubSurf.c | 18 ++--- source/blender/blenkernel/intern/cdderivedmesh.c | 4 +- source/blender/blenkernel/intern/dynamicpaint.c | 78 +++++++++++----------- source/blender/blenkernel/intern/mask_rasterize.c | 4 +- source/blender/blenkernel/intern/multires.c | 8 +-- source/blender/blenkernel/intern/node.c | 4 +- source/blender/blenkernel/intern/particle_system.c | 18 ++--- source/blender/blenkernel/intern/pbvh.c | 16 ++--- source/blender/blenkernel/intern/pbvh_bmesh.c | 12 ++-- source/blender/blenkernel/intern/smoke.c | 8 +-- source/blender/blenkernel/intern/tracking.c | 6 +- 11 files changed, 88 insertions(+), 88 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index ffb92788d4d..560bebd280b 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -1436,7 +1436,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss, int normalDataOffset = ss->normalDataOffset; int vertDataSize = ss->meshIFC.vertDataSize; - #pragma omp parallel for private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) +#pragma omp parallel for private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) for (ptrIdx = 0; ptrIdx < numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace *) effectedF[ptrIdx]; int S, x, y; @@ -1576,7 +1576,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss, } } - #pragma omp parallel for private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) +#pragma omp parallel for private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) for (ptrIdx = 0; ptrIdx < numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace *) effectedF[ptrIdx]; int S, x, y; @@ -1657,7 +1657,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, int vertDataSize = ss->meshIFC.vertDataSize; float *q = ss->q, *r = ss->r; - #pragma omp parallel for private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) +#pragma omp parallel for private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) for (ptrIdx = 0; ptrIdx < numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace *) effectedF[ptrIdx]; int S, x, y; @@ -2004,17 +2004,17 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, } } - #pragma omp parallel private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) +#pragma omp parallel private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) { float *q, *r; - #pragma omp critical +#pragma omp critical { q = MEM_mallocN(ss->meshIFC.vertDataSize, "CCGSubsurf q"); r = MEM_mallocN(ss->meshIFC.vertDataSize, "CCGSubsurf r"); } - #pragma omp for schedule(static) +#pragma omp for schedule(static) for (ptrIdx = 0; ptrIdx < numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace *) effectedF[ptrIdx]; int S, x, y; @@ -2105,7 +2105,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, } } - #pragma omp critical +#pragma omp critical { MEM_freeN(q); MEM_freeN(r); @@ -2117,14 +2117,14 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, gridSize = ccg_gridsize(nextLvl); cornerIdx = gridSize - 1; - #pragma omp parallel for private(i) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) +#pragma omp parallel for private(i) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) for (i = 0; i < numEffectedE; i++) { CCGEdge *e = effectedE[i]; VertDataCopy(EDGE_getCo(e, nextLvl, 0), VERT_getCo(e->v0, nextLvl), ss); VertDataCopy(EDGE_getCo(e, nextLvl, edgeSize - 1), VERT_getCo(e->v1, nextLvl), ss); } - #pragma omp parallel for private(i) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) +#pragma omp parallel for private(i) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT) for (i = 0; i < numEffectedF; i++) { CCGFace *f = effectedF[i]; int S, x; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index e95847b9de4..d9447e51aa3 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -2273,10 +2273,10 @@ void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals * no need to duplicate verts. * WATCH THIS, bmesh only change!, * need to take care of the side effects here - campbell */ - #if 0 +#if 0 /* we don't want to overwrite any referenced layers */ cddm->mvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData); - #endif +#endif if (dm->numTessFaceData == 0) { diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index fe9a96d60cf..e2b752ea352 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -742,14 +742,14 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) float min_dim; /* calculate canvas dimensions */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { - #ifdef _OPENMP +#ifdef _OPENMP int id = omp_get_thread_num(); boundInsert(&grid_bounds[id], (bData->realCoord[bData->s_pos[i]].v)); - #else +#else boundInsert(&grid_bounds[0], (bData->realCoord[bData->s_pos[i]].v)); - #endif +#endif } /* get final dimensions */ @@ -802,7 +802,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) if (!error) { /* calculate number of points withing each cell */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { int co[3], j; for (j = 0; j < 3; j++) { @@ -811,11 +811,11 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) } temp_t_index[i] = co[0] + co[1] * grid->dim[0] + co[2] * grid->dim[0] * grid->dim[1]; - #ifdef _OPENMP +#ifdef _OPENMP grid->s_num[temp_t_index[i] + omp_get_thread_num() * grid_cells]++; - #else +#else grid->s_num[temp_t_index[i]]++; - #endif +#endif } /* for first cell only calc s_num */ @@ -843,7 +843,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) /* calculate cell bounds */ { int x; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (x = 0; x < grid->dim[0]; x++) { int y; for (y = 0; y < grid->dim[1]; y++) { @@ -1471,7 +1471,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf /* Single color */ else if (surface->init_color_type == MOD_DPAINT_INITIAL_COLOR) { /* apply color to every surface point */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { copy_v3_v3(pPoint[i].color, surface->init_color); pPoint[i].alpha = surface->init_color[3]; @@ -1497,7 +1497,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) { struct ImagePool *pool = BKE_image_pool_new(); - #pragma omp parallel for schedule(static) shared(pool) +#pragma omp parallel for schedule(static) shared(pool) for (i = 0; i < numOfFaces; i++) { int numOfVert = (mface[i].v4) ? 4 : 3; float uv[3] = {0.0f}; @@ -1524,7 +1524,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf ImgSeqFormatData *f_data = (ImgSeqFormatData *)sData->format_data; int samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { float uv[9] = {0.0f}; float uv_final[3] = {0.0f}; @@ -1562,7 +1562,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf MCol *col = CustomData_get_layer_named(&dm->loopData, CD_MLOOPCOL, surface->init_layername); if (!col) return; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < numOfLoops; i++) { pPoint[mloop[i].v].color[0] = 1.0f / 255.f * (float)col[i].b; pPoint[mloop[i].v].color[1] = 1.0f / 255.f * (float)col[i].g; @@ -1576,7 +1576,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf MCol *col = CustomData_get_layer_named(&dm->faceData, CD_MCOL, surface->init_layername); if (!col) return; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { int face_ind = f_data->uv_p[i].face_index; float colors[3][4] = {{0.0f, 0.0f, 0.0f, 0.0f}}; @@ -1680,7 +1680,7 @@ static void dynamicPaint_applySurfaceDisplace(DynamicPaintSurface *surface, Deri int i; float *value = (float *)sData->type_data; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { float normal[3], val = value[i] * surface->disp_factor; normal_short_to_float_v3(normal, mvert[i].no); @@ -1729,7 +1729,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, /* paint is stored on dry and wet layers, so mix final color first */ float *fcolor = MEM_callocN(sizeof(float) * sData->total_points * 4, "Temp paint color"); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { /* blend dry and wet layer */ blendColors(pPoint[i].color, pPoint[i].alpha, pPoint[i].e_color, pPoint[i].e_alpha, &fcolor[i * 4]); @@ -1757,7 +1757,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, NULL, totloop); if (col) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < totpoly; i++) { int j = 0; Material *material = give_current_material(ob, mp[i].mat_nr + 1); @@ -1808,7 +1808,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, col = CustomData_add_layer_named(&result->loopData, CD_MLOOPCOL, CD_CALLOC, NULL, totloop, surface->output_name); /* apply color */ if (col) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < totloop; i++) { int index = mloop[i].v * 4; rgb_float_to_uchar((unsigned char *)&col[i].r, &fcolor[index]); @@ -1825,7 +1825,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, col = CustomData_add_layer_named(&result->loopData, CD_MLOOPCOL, CD_CALLOC, NULL, totloop, surface->output_name2); /* apply color */ if (col) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < totloop; i++) { int index = mloop[i].v; col[i].r = @@ -1882,7 +1882,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, int i; PaintWavePoint *wPoint = (PaintWavePoint *)sData->type_data; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { float normal[3]; normal_short_to_float_v3(normal, mvert[i].no); @@ -2331,7 +2331,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface) * if pixel is uv-mapped on a canvas face. */ if (!error) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (ty = 0; ty < h; ty++) { int tx; for (tx = 0; tx < w; tx++) { @@ -2475,7 +2475,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface) * If so use that polygon as pixel surface. * (To avoid seams on uv island edges) */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (ty = 0; ty < h; ty++) { int tx; for (tx = 0; tx < w; tx++) { @@ -2666,7 +2666,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface) /* ----------------------------------------------------------------- * For debug, output pixel statuses to the color map * -----------------------------------------------------------------*/ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { ImgSeqFormatData *f_data = (ImgSeqFormatData *)sData->format_data; @@ -2707,9 +2707,9 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam return; } /* if selected format is openexr, but current build doesnt support one */ - #ifndef WITH_OPENEXR +#ifndef WITH_OPENEXR if (format == R_IMF_IMTYPE_OPENEXR) format = R_IMF_IMTYPE_PNG; - #endif +#endif BLI_strncpy(output_file, filename, sizeof(output_file)); BKE_add_image_extension_from_type(output_file, format); @@ -2724,7 +2724,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam return; } - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int pos = f_data->uv_p[index].pixel_index * 4; /* image buffer position */ @@ -3220,7 +3220,7 @@ static void dynamicPaint_brushMeshCalculateVelocity(Scene *scene, Object *ob, Dy mvert_p = mvert_c; /* calculate speed */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < numOfVerts_c; i++) { float p1[3], p2[3]; @@ -3350,7 +3350,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface, continue; /* loop through cell points and process brush */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (id = 0; id < grid->s_num[c_index]; id++) { int index = grid->t_index[grid->s_pos[c_index] + id]; int ss, samples = bData->s_num[index]; @@ -3755,7 +3755,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, } /* loop through cell points */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (id = 0; id < grid->s_num[c_index]; id++) { int index = grid->t_index[grid->s_pos[c_index] + id]; float disp_intersect = 0.0f; @@ -3929,7 +3929,7 @@ static int dynamicPaint_paintSinglePoint(DynamicPaintSurface *surface, float *po /* * Loop through every surface point */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { float distance = len_v3v3(pointCoord, bData->realCoord[bData->s_pos[index]].v); float colorband[4] = {0.0f}; @@ -4043,7 +4043,7 @@ static void dynamicPaint_prepareAdjacencyData(DynamicPaintSurface *surface, int bNeighs = bData->bNeighs = MEM_mallocN(sData->adj_data->total_targets * sizeof(struct BakeAdjPoint), "PaintEffectBake"); if (!bNeighs) return; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int i; int numOfNeighs = adj_data->n_num[index]; @@ -4231,7 +4231,7 @@ static int dynamicPaint_prepareEffectStep(DynamicPaintSurface *surface, Scene *s *force = MEM_mallocN(sData->total_points * 4 * sizeof(float), "PaintEffectForces"); if (*force) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { float forc[3] = {0}; @@ -4320,7 +4320,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force /* Copy current surface to the previous points array to read unmodified values */ memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(struct PaintPoint)); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int i; int numOfNeighs = sData->adj_data->n_num[index]; @@ -4362,7 +4362,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force /* Copy current surface to the previous points array to read unmodified values */ memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(struct PaintPoint)); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int i; int numOfNeighs = sData->adj_data->n_num[index]; @@ -4507,7 +4507,7 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal /* copy previous frame data */ memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(PaintWavePoint)); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { PaintWavePoint *wPoint = &((PaintWavePoint *)sData->type_data)[index]; int numOfNeighs = sData->adj_data->n_num[index]; @@ -4571,7 +4571,7 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal } /* reset state */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { PaintWavePoint *wPoint = &((PaintWavePoint *)sData->type_data)[index]; /* if there wasnt any brush intersection, clear isect height */ @@ -4590,7 +4590,7 @@ static void dynamicPaint_surfacePreStep(DynamicPaintSurface *surface, float time PaintSurfaceData *sData = surface->data; int index; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { /* Do drying dissolve effects */ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) { @@ -4688,7 +4688,7 @@ static int dynamicPaint_surfaceHasMoved(DynamicPaintSurface *surface, Object *ob } /* vertices */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < numOfVerts; i++) { int j; for (j = 0; j < 3; j++) @@ -4806,7 +4806,7 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc /* * Prepare each surface point for a new step */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { float prev_point[3] = {0.0f, 0.0f, 0.0f}; if (do_velocity_data && !new_bdata) { diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index 38301d51cbd..ce42d6abc33 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -746,10 +746,10 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas sf_vert = BLI_scanfill_vert_add(&sf_ctx, co_feather); /* no need for these attrs */ - #if 0 +#if 0 sf_vert->tmp.u = sf_vert_tot; sf_vert->keyindex = sf_vert_tot + tot_diff_point; /* absolute index of feather vert */ - #endif +#endif sf_vert->keyindex = SF_KEYINDEX_TEMP_ID; sf_vert_tot++; } diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 81708133bf3..722ea536ed2 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -1049,7 +1049,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm k = 0; /*current loop/mdisp index within the mloop array*/ - #pragma omp parallel for private(i) if (totloop * gridSize * gridSize >= CCG_OMP_LIMIT) +#pragma omp parallel for private(i) if (totloop * gridSize * gridSize >= CCG_OMP_LIMIT) for (i = 0; i < totpoly; ++i) { const int numVerts = mpoly[i].totloop; @@ -1064,7 +1064,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm /* when adding new faces in edit mode, need to allocate disps */ if (!mdisp->disps) - #pragma omp critical +#pragma omp critical { multires_reallocate_mdisps(totloop, mdisps, totlvl); } @@ -1074,7 +1074,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm /* if needed, reallocate multires paint mask */ if (gpm && gpm->level < key.level) { gpm->level = key.level; - #pragma omp critical +#pragma omp critical { if (gpm->data) MEM_freeN(gpm->data); @@ -2209,7 +2209,7 @@ static void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3]) dGridSize = multires_side_tot[high_mmd.totlvl]; dSkip = (dGridSize - 1) / (gridSize - 1); - #pragma omp parallel for private(i) if (me->totface * gridSize * gridSize * 4 >= CCG_OMP_LIMIT) +#pragma omp parallel for private(i) if (me->totface * gridSize * gridSize * 4 >= CCG_OMP_LIMIT) for (i = 0; i < me->totpoly; ++i) { const int numVerts = mpoly[i].totloop; MDisps *mdisp = &mdisps[mpoly[i].loopstart]; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 85354e4e0d7..d0ce56332a7 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3136,7 +3136,7 @@ void node_type_base(bNodeType *ntype, int type, const char *name, short nclass, * created in makesrna, which can not be associated to a bNodeType immediately, * since bNodeTypes are registered afterward ... */ - #define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \ +#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \ case ID: \ BLI_strncpy(ntype->idname, #Category #StructName, sizeof(ntype->idname)); \ ntype->ext.srna = RNA_struct_find(#Category #StructName); \ @@ -3145,7 +3145,7 @@ void node_type_base(bNodeType *ntype, int type, const char *name, short nclass, break; switch (type) { - #include "NOD_static_types.h" +#include "NOD_static_types.h" } /* make sure we have a valid type (everything registered) */ diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 41217110cd8..0f5707f9a60 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2704,7 +2704,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa temp_spring.delete_flag = 0; /* sph_spring_add is not thread-safe. - z0r */ - #pragma omp critical +#pragma omp critical sph_spring_add(psys[0], &temp_spring); } } @@ -4378,7 +4378,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) if (part->fluid->solver == SPH_SOLVER_DDR) { /* Apply SPH forces using double-density relaxation algorithm * (Clavat et. al.) */ - #pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) +#pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) LOOP_DYNAMIC_PARTICLES { /* do global forces & effectors */ basic_integrate(sim, p, pa->state.time, cfra); @@ -4393,7 +4393,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) * particles, thus rotation has not a direct sense for them */ basic_rotate(part, pa, pa->state.time, timestep); - #pragma omp critical +#pragma omp critical if (part->time_flag & PART_TIME_AUTOSF) update_courant_num(sim, pa, dtime, &sphdata); } @@ -4407,19 +4407,19 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) * and Monaghan). Note that, unlike double-density relaxation, * this algorithm is separated into distinct loops. */ - #pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) +#pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) LOOP_DYNAMIC_PARTICLES { basic_integrate(sim, p, pa->state.time, cfra); } /* calculate summation density */ - #pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) +#pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) LOOP_DYNAMIC_PARTICLES { sphclassical_calc_dens(pa, pa->state.time, &sphdata); } /* do global forces & effectors */ - #pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) +#pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5) LOOP_DYNAMIC_PARTICLES { /* actual fluids calculations */ sph_integrate(sim, pa, pa->state.time, &sphdata); @@ -4431,7 +4431,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) * particles, thus rotation has not a direct sense for them */ basic_rotate(part, pa, pa->state.time, timestep); - #pragma omp critical +#pragma omp critical if (part->time_flag & PART_TIME_AUTOSF) update_courant_num(sim, pa, dtime, &sphdata); } @@ -4526,7 +4526,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) } /* fluid sim particle import handling, actual loading of particles from file */ - #ifdef WITH_MOD_FLUID +#ifdef WITH_MOD_FLUID { FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(sim->ob, eModifierType_Fluidsim); @@ -4620,7 +4620,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) } // fluid sim particles done } - #endif // WITH_MOD_FLUID +#endif // WITH_MOD_FLUID } static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra)) diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 061a54da96f..27e52614a40 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -936,7 +936,7 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes, * can only update vertices marked with ME_VERT_PBVH_UPDATE. */ - #pragma omp parallel for private(n) schedule(static) +#pragma omp parallel for private(n) schedule(static) for (n = 0; n < totnode; n++) { PBVHNode *node = nodes[n]; @@ -965,11 +965,11 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes, if (bvh->verts[v].flag & ME_VERT_PBVH_UPDATE) { /* this seems like it could be very slow but profile * does not show this, so just leave it for now? */ - #pragma omp atomic +#pragma omp atomic vnor[v][0] += fn[0]; - #pragma omp atomic +#pragma omp atomic vnor[v][1] += fn[1]; - #pragma omp atomic +#pragma omp atomic vnor[v][2] += fn[2]; } } @@ -980,7 +980,7 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes, } } - #pragma omp parallel for private(n) schedule(static) +#pragma omp parallel for private(n) schedule(static) for (n = 0; n < totnode; n++) { PBVHNode *node = nodes[n]; @@ -1017,7 +1017,7 @@ void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag) int n; /* update BB, redraw flag */ - #pragma omp parallel for private(n) schedule(static) +#pragma omp parallel for private(n) schedule(static) for (n = 0; n < totnode; n++) { PBVHNode *node = nodes[n]; @@ -1816,7 +1816,7 @@ PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *bvh, PBVHNode *node) { int index, totverts; - #pragma omp critical +#pragma omp critical { index = node->proxy_count; @@ -1837,7 +1837,7 @@ PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *bvh, PBVHNode *node) void BKE_pbvh_node_free_proxies(PBVHNode *node) { - #pragma omp critical +#pragma omp critical { int p; diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 0a7c6d901af..296f931e2fb 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -1496,7 +1496,7 @@ void pbvh_bmesh_verify(PBVH *bvh) } BLI_assert(found); - #if 1 +#if 1 /* total freak stuff, check if node exists somewhere else */ /* Slow */ for (i = 0; i < bvh->totnode; i++) { @@ -1505,10 +1505,10 @@ void pbvh_bmesh_verify(PBVH *bvh) BLI_assert(!BLI_gset_haskey(n->bm_unique_verts, v)); } - #endif +#endif } - #if 0 +#if 0 /* check that every vert belongs somewhere */ /* Slow */ BM_ITER_MESH (vi, &iter, bvh->bm, BM_VERTS_OF_MESH) { @@ -1524,7 +1524,7 @@ void pbvh_bmesh_verify(PBVH *bvh) /* if totvert differs from number of verts inside the hash. hash-totvert is checked above */ BLI_assert(vert_count == bvh->bm->totvert); - #endif +#endif /* Check that node elements are recorded in the top level */ for (i = 0; i < bvh->totnode; i++) { @@ -1532,11 +1532,11 @@ void pbvh_bmesh_verify(PBVH *bvh) if (n->flag & PBVH_Leaf) { /* Check for duplicate entries */ /* Slow */ - #if 0 +#if 0 bli_ghash_duplicate_key_check(n->bm_faces); bli_gset_duplicate_key_check(n->bm_unique_verts); bli_gset_duplicate_key_check(n->bm_other_verts); - #endif +#endif GHASH_ITER (gh_iter, n->bm_faces) { BMFace *f = BLI_ghashIterator_getKey(&gh_iter); diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index b39f31bd1ec..bd9d20333e5 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -785,7 +785,7 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds } if (bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 4, 6)) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (z = sds->res_min[2]; z < sds->res_max[2]; z++) { int x, y; for (x = sds->res_min[0]; x < sds->res_max[0]; x++) @@ -1352,7 +1352,7 @@ static void emit_from_particles(Object *flow_ob, SmokeDomainSettings *sds, Smoke /* begin thread safe malloc */ BLI_begin_threaded_malloc(); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (z = min[2]; z < max[2]; z++) { int x, y; for (x = min[0]; x < max[0]; x++) @@ -1632,7 +1632,7 @@ static void emit_from_derivedmesh(Object *flow_ob, SmokeDomainSettings *sds, Smo } if (bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 4, 6)) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (z = min[2]; z < max[2]; z++) { int x, y; for (x = min[0]; x < max[0]; x++) @@ -2377,7 +2377,7 @@ static void update_effectors(Scene *scene, Object *ob, SmokeDomainSettings *sds, int x; // precalculate wind forces - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (x = 0; x < sds->res[0]; x++) { int y, z; diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 355922d157a..e07d84a99ce 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -3064,7 +3064,7 @@ bool BKE_tracking_context_step(MovieTrackingContext *context) frame_width = destination_ibuf->x; frame_height = destination_ibuf->y; - #pragma omp parallel for private(a) shared(destination_ibuf, ok) if (map_size > 1) +#pragma omp parallel for private(a) shared(destination_ibuf, ok) if (map_size > 1) for (a = 0; a < map_size; a++) { TrackContext *track_context = NULL; MovieTrackingTrack *track; @@ -3103,7 +3103,7 @@ bool BKE_tracking_context_step(MovieTrackingContext *context) dst_pixel_x, dst_pixel_y); } - #pragma omp critical +#pragma omp critical { tracking_insert_new_marker(context, track, marker, curfra, tracked, frame_width, frame_height, dst_pixel_x, dst_pixel_y); @@ -4468,7 +4468,7 @@ ImBuf *BKE_tracking_stabilize_frame(MovieTracking *tracking, int framenr, ImBuf * But need to keep an eye on this if the function will be * used in other cases. */ - #pragma omp parallel for if (tmpibuf->y > 128) +#pragma omp parallel for if (tmpibuf->y > 128) for (j = 0; j < tmpibuf->y; j++) { int i; for (i = 0; i < tmpibuf->x; i++) { -- cgit v1.2.3