Cleanup: warnings & style
authorCampbell Barton <ideasman42@gmail.com>
Thu, 28 Jan 2016 06:23:12 +0000 (17:23 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 28 Jan 2016 06:23:12 +0000 (17:23 +1100)
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/mesh_evaluate.c
source/blender/blenkernel/intern/pbvh.c
source/blender/blenkernel/intern/tracking_util.c
source/blender/blenlib/PIL_time_utildefines.h
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_clip/tracking_select.c
source/blender/gpu/GPU_texture.h
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_material.c

index dfa6c6fb1033c5b300c05465d8cdbcf3a58e19f5..abba61310a48967b86ad8717a5cddc597cc90d5f 100644 (file)
@@ -399,7 +399,7 @@ static BVHTree *bvhtree_from_mesh_verts_create_tree(
                        for (i = 0; i < numVerts; i++) {
                                if (BLI_BITMAP_TEST_BOOL(mask, i)) {
                                        if (em != NULL) {
-                                               if (index_array){
+                                               if (index_array) {
                                                        index = index_array[i];
                                                        if (index == ORIGINDEX_NONE) {
                                                                continue;
@@ -432,7 +432,7 @@ static BVHTree *bvhtree_from_mesh_verts_create_tree(
                                        continue;
                                }
                                if (em != NULL) {
-                                       if (index_array){
+                                       if (index_array) {
                                                index = index_array[i];
                                                if (index == ORIGINDEX_NONE) {
                                                        continue;
index ca3eda7ad7a40c923bbf193df073d2bbedf5eaff..e3b9b21f341214f84532df5c478f9d39124084f0 100644 (file)
@@ -188,7 +188,7 @@ static void mesh_calc_normals_poly_accum_task_cb(void *userdata, const int pidx)
        MeshCalcNormalsData *data = userdata;
        const MPoly *mp = &data->mpolys[pidx];
        const MLoop *ml = &data->mloop[mp->loopstart];
-    const MVert *mverts = data->mverts;
+       const MVert *mverts = data->mverts;
 
        float pnor_temp[3];
        float *pnor = data->pnors ? data->pnors[pidx] : pnor_temp;
index a13daf247754371c3448566fa9920d060e9978bf..00c22e172304961e0bdbf948236bf6b909bfbdfc 100644 (file)
@@ -1015,7 +1015,8 @@ static void pbvh_update_normals_store_task_cb(void *userdata, const int n)
                        MVert *mvert = &bvh->verts[v];
 
                        /* mvert is shared between nodes, hence between threads. */
-                       if (atomic_fetch_and_and_uint8((uint8_t *)&mvert->flag, (uint8_t)~ME_VERT_PBVH_UPDATE) & ME_VERT_PBVH_UPDATE)
+                       if (atomic_fetch_and_and_uint8(
+                               (uint8_t *)&mvert->flag, (uint8_t)~ME_VERT_PBVH_UPDATE) & ME_VERT_PBVH_UPDATE)
                        {
                                normalize_v3(vnors[v]);
                                normal_float_to_short_v3(mvert->no, vnors[v]);
@@ -1056,7 +1057,7 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
 
        PBVHUpdateData data = {
            .bvh = bvh, .nodes = nodes,
-               .fnors = fnors, .vnors = vnors,
+           .fnors = fnors, .vnors = vnors,
        };
 
        BLI_task_parallel_range(0, totnode, &data, pbvh_update_normals_accum_task_cb, totnode > PBVH_THREADED_LIMIT);
@@ -1090,7 +1091,7 @@ void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag)
        /* update BB, redraw flag */
        PBVHUpdateData data = {
            .bvh = bvh, .nodes = nodes,
-               .flag = flag,
+           .flag = flag,
        };
 
        BLI_task_parallel_range(0, totnode, &data, pbvh_update_BB_redraw_task_cb, totnode > PBVH_THREADED_LIMIT);
index 078aaf180143710ca0de3ef0999bd6028e3677d2..3c2444b0ef1fcf2ef57eca92a7e1410abcdafee6 100644 (file)
@@ -486,7 +486,7 @@ MovieTrackingMarker *tracking_get_keyframed_marker(MovieTrackingTrack *track,
                                /* Could happen when trying to get reference marker for the fist
                                 * one on the segment which isn't surrounded by disabled markers.
                                 *
-                                * There's no really good choise here, just use the reference
+                                * There's no really good choice here, just use the reference
                                 * marker which looks correct..
                                 */
                                if (marker_keyed_fallback == NULL) {
index 3984482f1ec2e0e513e9b40b7c992e158ddc995a..9157e04a7bf6f92fe918b342029517aa9b697ad0 100644 (file)
@@ -62,7 +62,7 @@
        } (void)0
 
 /**
- * _AVERAGED variants do same thing as their basic counterpart, but additionnally add elapsed time to an averaged
+ * _AVERAGED variants do same thing as their basic counterpart, but additionally add elapsed time to an averaged
  * static value, useful to get sensible timing of code running fast and often.
  */
 #define TIMEIT_START_AVERAGED(var)                                            \
index 7cc70418fe7469de871d3991d8fe6b5addeddafa..5675b2e97f7b22d673b21615f52f8ba97ea9ced2 100644 (file)
@@ -4819,7 +4819,7 @@ static void sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
        Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
        const Brush *brush = BKE_paint_brush(&sd->paint);
 
-       /* XXX Cancelling strokes that way does not work with dynamic topology, user will have to do real undo for now.
+       /* XXX Canceling strokes that way does not work with dynamic topology, user will have to do real undo for now.
         *     See T46456. */
        if (ss->cache && !sculpt_stroke_is_dynamic_topology(ss, brush)) {
                paint_mesh_restore_co(sd, ob);
index b9b53a55fcee9024ac2f529c2bbc1bb786c6394f..e970b1b97433123c3cc6b9e18f7285cd66a640d4 100644 (file)
@@ -53,7 +53,8 @@
 
 #include "UI_view2d.h"
 
-#include "clip_intern.h"    // own include
+#include "tracking_ops_intern.h"  /* own include */
+#include "clip_intern.h"  /* own include */
 
 static float dist_to_crns(float co[2], float pos[2], float crns[4][2]);
 
index efa98f7ca2aafad596d07127eb237ea999a9c91a..756fe79151b42550fc66740ce4841a2b09e63f73 100644 (file)
@@ -72,7 +72,7 @@ GPUTexture *GPU_texture_create_2D_multisample(
         int w, int h, const float *pixels, GPUHDRType hdr, int samples, char err_out[256]);
 GPUTexture *GPU_texture_create_depth_multisample(int w, int h, int samples, char err_out[256]);
 GPUTexture *GPU_texture_from_blender(
-               struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap);
+        struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap);
 GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap);
 void GPU_invalid_tex_init(void);
 void GPU_invalid_tex_bind(int mode);
index be5235b77bbe5a01f42a8a49ab811a44b8d31b55..71be262be370586d21d1e5761d3c09dbdddbeda1 100644 (file)
@@ -226,8 +226,8 @@ static bool is_power_of_2_resolution(int w, int h)
 
 static bool is_over_resolution_limit(GLenum textarget, int w, int h)
 {
-       int size = (textarget == GL_TEXTURE_2D)?
-       GPU_max_texture_size() : GPU_max_cube_map_size();
+       int size = (textarget == GL_TEXTURE_2D) ?
+               GPU_max_texture_size() : GPU_max_cube_map_size();
        int reslimit = (U.glreslimit != 0) ?
                min_ii(U.glreslimit, size) : size;
 
@@ -237,8 +237,8 @@ static bool is_over_resolution_limit(GLenum textarget, int w, int h)
 static int smaller_power_of_2_limit(int num)
 {
        int reslimit = (U.glreslimit != 0) ?
-               min_ii(U.glreslimit, GPU_max_texture_size()) :
-               GPU_max_texture_size();
+               min_ii(U.glreslimit, GPU_max_texture_size()) :
+               GPU_max_texture_size();
        /* take texture clamping into account */
        if (num > reslimit)
                return reslimit;
@@ -744,7 +744,7 @@ static void **gpu_gen_cube_map(unsigned int *rect, float *frect, int rectw, int
                return sides;
 
        /* PosX, NegX, PosY, NegY, PosZ, NegZ */
-       sides = MEM_mallocN(sizeof(void*) * 6, "");
+       sides = MEM_mallocN(sizeof(void *) * 6, "");
        for (int i = 0; i < 6; i++)
                sides[i] = MEM_mallocN(block_size * w * h, "");
 
@@ -813,8 +813,8 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *rect, float *frect, int
         * GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures 
         * Then don't bother scaling for hardware that supports NPOT textures! */
        if (textarget == GL_TEXTURE_2D &&
-                       (!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(rectw, recth) ||
-                       is_over_resolution_limit(textarget, rectw, recth)))
+           ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(rectw, recth)) ||
+            is_over_resolution_limit(textarget, rectw, recth)))
        {
                rectw = smaller_power_of_2_limit(rectw);
                recth = smaller_power_of_2_limit(recth);
@@ -918,8 +918,9 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *rect, float *frect, int
 
                                        for (int i = 1; i < ibuf->miptot; i++) {
                                                ImBuf *mip = ibuf->mipmap[i - 1];
-                                               void **mip_cube_map = gpu_gen_cube_map(mip->rect, mip->rect_float,
-                                                                                                       mip->x, mip->y, use_high_bit_depth);
+                                               void **mip_cube_map = gpu_gen_cube_map(
+                                                       mip->rect, mip->rect_float,
+                                                       mip->x, mip->y, use_high_bit_depth);
                                                int mipw = mip->x / 3, miph = mip->y / 2;
 
                                                if (mip_cube_map) {
@@ -1157,7 +1158,7 @@ void GPU_paint_set_mipmap(bool mipmap)
 static bool GPU_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x, int y, int w, int h)
 {
        if ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(ibuf->x, ibuf->y)) ||
-               is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y))
+           is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y))
        {
                int x_limit = smaller_power_of_2_limit(ibuf->x);
                int y_limit = smaller_power_of_2_limit(ibuf->y);
index 09d326e2ee8d922773d98c1e6098d05bccf02711..4d9fa54939c2ba85139c718f87c5f6bed7888955 100644 (file)
@@ -1924,16 +1924,17 @@ static void do_world_tex(GPUShadeInput *shi, struct World *wo, GPUNodeLink **hor
                                                if (mtex->mapto & WOMAP_ZENUP) {
                                                        if (mtex->mapto & WOMAP_ZENDOWN) {
                                                                GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&mtex->zenupfac),
-                                                                       GPU_uniform(&mtex->zendownfac), &zenfac);
+                                                                        GPU_uniform(&mtex->zendownfac), &zenfac);
                                                        }
                                                        else {
                                                                GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&mtex->zenupfac),
-                                                                       GPU_uniform(&zero), &zenfac);
+                                                                        GPU_uniform(&zero), &zenfac);
                                                        }
                                                }
-                                               else if (mtex->mapto & WOMAP_ZENDOWN)
+                                               else if (mtex->mapto & WOMAP_ZENDOWN) {
                                                        GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&zero),
-                                                               GPU_uniform(&mtex->zendownfac), &zenfac);
+                                                                GPU_uniform(&mtex->zendownfac), &zenfac);
+                                               }
                                        }
                                        else {
                                                if (mtex->mapto & WOMAP_ZENUP)