diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-28 09:23:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-28 09:23:12 +0300 |
commit | 05dbc470ad9c1f953b5e8d2da5e3f1bfba6d4814 (patch) | |
tree | de528cc01ce385cd17d6d0b2fb2624c43a0b78de /source/blender | |
parent | a1d7f67d81bdc7ece8a757ab79d0b64f4e612bfd (diff) |
Cleanup: warnings & style
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/tracking_util.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/PIL_time_utildefines.h | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/tracking_select.c | 3 | ||||
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 21 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 9 |
10 files changed, 29 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index dfa6c6fb103..abba61310a4 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -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; diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index ca3eda7ad7a..e3b9b21f341 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -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; diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index a13daf24775..00c22e17230 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -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); diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c index 078aaf18014..3c2444b0ef1 100644 --- a/source/blender/blenkernel/intern/tracking_util.c +++ b/source/blender/blenkernel/intern/tracking_util.c @@ -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) { diff --git a/source/blender/blenlib/PIL_time_utildefines.h b/source/blender/blenlib/PIL_time_utildefines.h index 3984482f1ec..9157e04a7bf 100644 --- a/source/blender/blenlib/PIL_time_utildefines.h +++ b/source/blender/blenlib/PIL_time_utildefines.h @@ -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) \ diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 7cc70418fe7..5675b2e97f7 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -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); diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index b9b53a55fce..e970b1b9743 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -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]); diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index efa98f7ca2a..756fe79151b 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -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); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index be5235b77bb..71be262be37 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -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); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 09d326e2ee8..4d9fa54939c 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -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) |