Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Mon, 25 Mar 2019 00:42:28 +0000 (11:42 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 25 Mar 2019 00:42:28 +0000 (11:42 +1100)
18 files changed:
source/blender/blenkernel/intern/CCGSubSurf.h
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/softbody.c
source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
source/blender/draw/engines/workbench/workbench_deferred.c
source/blender/draw/modes/paint_texture_mode.c
source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
source/blender/render/extern/include/RE_engine.h
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c

index b6fc9d5..8ce5099 100644 (file)
  * \ingroup bke
  */
 
-typedef voidCCGMeshHDL;
-typedef voidCCGVertHDL;
-typedef voidCCGEdgeHDL;
-typedef voidCCGFaceHDL;
+typedef void *CCGMeshHDL;
+typedef void *CCGVertHDL;
+typedef void *CCGEdgeHDL;
+typedef void *CCGFaceHDL;
 
 typedef struct CCGEdge CCGEdge;
 typedef struct CCGFace CCGFace;
@@ -40,7 +40,7 @@ typedef struct CCGMeshIFC {
 
 /***/
 
-typedef voidCCGAllocatorHDL;
+typedef void *CCGAllocatorHDL;
 
 typedef struct CCGAllocatorIFC {
        void*           (*alloc)                        (CCGAllocatorHDL a, int numBytes);
index 28a2e6e..7ec50ea 100644 (file)
@@ -1557,7 +1557,7 @@ typedef struct SPHRangeData {
        SPHNeighbor neighbors[SPH_NEIGHBORS];
        int tot_neighbors;
 
-       floatdata;
+       float *data;
 
        ParticleSystem *npsys;
        ParticleData *pa;
@@ -1623,8 +1623,8 @@ static void sph_density_accum_cb(void *userdata, int index, const float co[3], f
        if (pfr->use_size)
                q *= npa->size;
 
-       pfr->data[0] += q*q;
-       pfr->data[1] += q*q*q;
+       pfr->data[0] += q * q;
+       pfr->data[1] += q * q * q;
 }
 
 /*
index 60e40c0..0d8b238 100644 (file)
@@ -1565,7 +1565,7 @@ static void sb_sfesf_threads_run(struct Depsgraph *depsgraph, Scene *scene, stru
 
 /* --- the spring external section*/
 
-static int choose_winner(float*w, float* pos, float*a, float*b, float*c, float*ca, float*cb, float*cc)
+static int choose_winner(float *w, float *pos, float *a, float *b, float *c, float *ca, float *cb, float *cc)
 {
        float mindist, cp;
        int winner =1;
@@ -1885,13 +1885,13 @@ static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, floa
        switch (bs->springtype) {
                case SB_EDGE:
                case SB_HANDLE:
-                       forcefactor *=  kw;
+                       forcefactor *= kw;
                        break;
                case SB_BEND:
-                       forcefactor *=sb->secondspring*kw;
+                       forcefactor *= sb->secondspring * kw;
                        break;
                case SB_STIFFQUAD:
-                       forcefactor *=sb->shearstiff*sb->shearstiff* kw;
+                       forcefactor *= sb->shearstiff * sb->shearstiff * kw;
                        break;
                default:
                        break;
@@ -2043,11 +2043,11 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
                                BKE_effectors_apply(effectors, NULL, sb->effector_weights, &epoint, force, speed);
 
                                /* apply forcefield*/
-                               mul_v3_fl(force, fieldfactor* eval_sb_fric_force_scale);
+                               mul_v3_fl(force, fieldfactor * eval_sb_fric_force_scale);
                                add_v3_v3(bp->force, force);
 
                                /* BP friction in moving media */
-                               kd= sb->mediafrict* eval_sb_fric_force_scale;
+                               kd= sb->mediafrict * eval_sb_fric_force_scale;
                                bp->force[0] -= kd * (bp->vec[0] + windfactor*speed[0]/eval_sb_fric_force_scale);
                                bp->force[1] -= kd * (bp->vec[1] + windfactor*speed[1]/eval_sb_fric_force_scale);
                                bp->force[2] -= kd * (bp->vec[2] + windfactor*speed[2]/eval_sb_fric_force_scale);
@@ -2056,7 +2056,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
                        }
                        else {
                                /* BP friction in media (not) moving*/
-                               float kd = sb->mediafrict* sb_fric_force_scale(ob);
+                               float kd = sb->mediafrict * sb_fric_force_scale(ob);
                                /* assume it to be proportional to actual velocity */
                                bp->force[0]-= bp->vec[0]*kd;
                                bp->force[1]-= bp->vec[1]*kd;
index a7ea114..116d9ea 100644 (file)
@@ -614,8 +614,8 @@ void update_edit_mode_pointers(const Depsgraph *depsgraph,
 }
 
 template <typename T>
-void update_list_orig_pointers(const ListBaselistbase_orig,
-                               ListBaselistbase,
+void update_list_orig_pointers(const ListBase *listbase_orig,
+                               ListBase *listbase,
                                T *T::*orig_field)
 {
        T *element_orig = reinterpret_cast<T*>(listbase_orig->first);
@@ -934,7 +934,7 @@ void ObjectRuntimeBackup::init_from_object(Object *object)
 }
 
 inline ModifierDataBackupID create_modifier_data_id(
-        const ModifierDatamodifier_data)
+        const ModifierData *modifier_data)
 {
        return ModifierDataBackupID(modifier_data->orig_modifier_data,
                                    static_cast<ModifierType>(modifier_data->type));
index 91a4ca9..afd219f 100644 (file)
@@ -26,9 +26,10 @@ uniform vec2 nearFar; /* Near & far view depths values */
 /* divide by sensor size to get the normalized size */
 #define calculate_coc(zdepth) (dof_mul / zdepth - dof_bias)
 
-#define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \
-               ? (nearFar.x  * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) \
-               : z * (nearFar.y - nearFar.x) + nearFar.x) /* Only true for camera view! */
+#define linear_depth(z) \
+       ((ProjectionMatrix[3][3] == 0.0) ? \
+        (nearFar.x  * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) : \
+        z * (nearFar.y - nearFar.x) + nearFar.x) /* Only true for camera view! */
 
 #define weighted_sum(a, b, c, d, e) (a * e.x + b * e.y + c * e.z + d * e.w) / max(1e-6, dot(e, vec4(1.0)));
 
index 5e4e594..1fb7a9c 100644 (file)
@@ -31,9 +31,10 @@ float max_v4(vec4 v) { return max(max(v.x, v.y), max(v.z, v.w)); }
 /* divide by sensor size to get the normalized size */
 #define calculate_coc(zdepth) (dof_aperturesize * (dof_distance / zdepth - 1.0) * dof_invsensorsize)
 
-#define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \
-               ? (nearFar.x  * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) \
-               : (z * 2.0 - 1.0) * nearFar.y)
+#define linear_depth(z) \
+       ((ProjectionMatrix[3][3] == 0.0) ? \
+        (nearFar.x  * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) : \
+        (z * 2.0 - 1.0) * nearFar.y)
 
 
 const float MAX_COC_SIZE = 100.0;
index dfd8152..4afc692 100644 (file)
@@ -264,8 +264,7 @@ static GPUShader *ensure_background_shader(WORKBENCH_PrivateData *wpd)
 
 static void select_deferred_shaders(WORKBENCH_PrivateData *wpd, eGPUShaderConfig sh_cfg)
 {
-       wpd->prepass_solid_sh
-               = ensure_deferred_prepass_shader(wpd, false, false, sh_cfg);
+       wpd->prepass_solid_sh = ensure_deferred_prepass_shader(wpd, false, false, sh_cfg);
        wpd->prepass_solid_hair_sh = ensure_deferred_prepass_shader(wpd, false, true, sh_cfg);
        wpd->prepass_texture_sh = ensure_deferred_prepass_shader(wpd, true, false, sh_cfg);
        wpd->prepass_texture_hair_sh = ensure_deferred_prepass_shader(wpd, true, true, sh_cfg);
index 7696ce4..83dfdd3 100644 (file)
@@ -155,13 +155,15 @@ static void PAINT_TEXTURE_engine_init(void *UNUSED(vedata))
        }
 }
 
-static DRWShadingGroup* create_texture_paint_shading_group(PAINT_TEXTURE_PassList *psl, const struct GPUTexture *texture, const DRWContextState *draw_ctx, const bool nearest_interp)
+static DRWShadingGroup *create_texture_paint_shading_group(
+        PAINT_TEXTURE_PassList *psl, const struct GPUTexture *texture, const DRWContextState *draw_ctx, const bool nearest_interp)
 {
        Scene *scene = draw_ctx->scene;
        const ImagePaintSettings *imapaint = &scene->toolsettings->imapaint;
        const bool masking_enabled = imapaint->flag & IMAGEPAINT_PROJECT_LAYER_STENCIL && imapaint->stencil != NULL;
 
-       DRWShadingGroup *grp = DRW_shgroup_create(masking_enabled?e_data.image_masking_sh:e_data.image_sh, psl->image_faces);
+       DRWShadingGroup *grp = DRW_shgroup_create(
+               masking_enabled ? e_data.image_masking_sh : e_data.image_sh, psl->image_faces);
        DRW_shgroup_uniform_texture(grp, "image", texture);
        DRW_shgroup_uniform_float(grp, "alpha", &draw_ctx->v3d->overlay.texture_paint_mode_opacity, 1);
        DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
index 982ef2c..c43ae60 100644 (file)
@@ -78,9 +78,9 @@ void main()
        /* Facing based color blend */
        vec4 vpos = ModelViewMatrix * vec4(pos, 1.0);
        vec3 view_normal = normalize(NormalMatrix * vnor + 1e-4);
-       vec3 view_vec = (ProjectionMatrix[3][3] == 0.0)
-               ? normalize(vpos.xyz)
-               vec3(0.0, 0.0, 1.0);
+       vec3 view_vec = (ProjectionMatrix[3][3] == 0.0) ?
+               normalize(vpos.xyz) :
+               vec3(0.0, 0.0, 1.0);
        float facing = dot(view_vec, view_normal);
        facing = 1.0 - abs(facing) * 0.3;
 
index 1587bc3..e7fc162 100644 (file)
@@ -242,7 +242,7 @@ unsigned int BlenderStrokeRenderer::get_stroke_mesh_id(void) const
        return mesh_id;
 }
 
-MaterialBlenderStrokeRenderer::GetStrokeShader(Main *bmain, bNodeTree *iNodeTree, bool do_id_user)
+Material *BlenderStrokeRenderer::GetStrokeShader(Main *bmain, bNodeTree *iNodeTree, bool do_id_user)
 {
        Material *ma = BKE_material_add(bmain, "stroke_shader");
        bNodeTree *ntree;
index c41c5f1..686e727 100644 (file)
@@ -67,7 +67,7 @@ public:
 
        Render *RenderScene(Render *re, bool render);
 
-       static MaterialGetStrokeShader(Main *bmain, bNodeTree *iNodeTree, bool do_id_user);
+       static Material *GetStrokeShader(Main *bmain, bNodeTree *iNodeTree, bool do_id_user);
 
 protected:
        Main *freestyle_bmain;
index d5a2cad..b875be7 100644 (file)
@@ -176,7 +176,7 @@ public:
                return _Normals;
        }
 
-       virtual const FrsMaterial*const* frs_materials() const
+       virtual const FrsMaterial * const *frs_materials() const
        {
                return _FrsMaterials;
        }
index d9b0610..16a7525 100644 (file)
@@ -1132,7 +1132,7 @@ void DirectDrawSurface::mipmap(Image *img, uint face, uint mipmap)
 
 // It was easier to copy this function from upstream than to resync.
 // This should be removed if a resync ever occurs.
-voidDirectDrawSurface::readData(uint &rsize)
+void *DirectDrawSurface::readData(uint &rsize)
 {
        uint header_size = 128; // sizeof(DDSHeader);
        if (header.hasDX10Header())
index cdd696e..780894f 100644 (file)
@@ -183,7 +183,7 @@ bool RE_engine_is_opengl(RenderEngineType *render_type);
 
 RenderEngineType *RE_engines_find(const char *idname);
 
-rctiRE_engine_get_current_tiles(struct Render *re, int *r_total_tiles, bool *r_needs_free);
+rcti *RE_engine_get_current_tiles(struct Render *re, int *r_total_tiles, bool *r_needs_free);
 struct RenderData *RE_engine_get_render_data(struct Render *re);
 void RE_bake_engine_set_engine_parameters(
         struct Render *re, struct Main *bmain, struct Scene *scene);
index 153d416..b29d504 100644 (file)
@@ -432,7 +432,7 @@ bool RE_engine_get_spherical_stereo(RenderEngine *engine, Object *camera)
        return BKE_camera_multiview_spherical_stereo(re ? &re->r : NULL, camera) ? 1 : 0;
 }
 
-rctiRE_engine_get_current_tiles(Render *re, int *r_total_tiles, bool *r_needs_free)
+rcti *RE_engine_get_current_tiles(Render *re, int *r_total_tiles, bool *r_needs_free)
 {
        static rcti tiles_static[BLENDER_MAX_THREADS];
        const int allocation_step = BLENDER_MAX_THREADS;
index afddbcf..e246592 100644 (file)
@@ -689,7 +689,7 @@ static int ibuf_get_color_clip(float col[4], ImBuf *ibuf, int x, int y, int extf
        }
 
        if (ibuf->rect_float) {
-               const float* fp = ibuf->rect_float + (x + y*ibuf->x)*ibuf->channels;
+               const float *fp = ibuf->rect_float + (x + y * ibuf->x) * ibuf->channels;
                if (ibuf->channels == 1)
                        col[0] = col[1] = col[2] = col[3] = *fp;
                else {
index 22e798e..f5346a6 100644 (file)
@@ -354,7 +354,7 @@ Scene *RE_GetScene(Render *re)
        return NULL;
 }
 
-void RE_SetScene(Render *re, Scenesce)
+void RE_SetScene(Render *re, Scene *sce)
 {
        if (re) {
                re->scene = sce;
index 6e0eaa6..103a678 100644 (file)
@@ -169,7 +169,7 @@ void render_result_views_shallowdelete(RenderResult *rr)
 }
 
 
-static charset_pass_name(char *outname, const char *name, int channel, const char *chan_id)
+static char *set_pass_name(char *outname, const char *name, int channel, const char *chan_id)
 {
        BLI_strncpy(outname, name, EXR_PASS_MAXNAME);
        if (channel >= 0) {