diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-13 21:10:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-13 21:11:20 +0300 |
commit | b09563ca8c42f46233bd104e30812e4fc7322ba3 (patch) | |
tree | 49d304ba915aac88b69ab367f98eb71af36f2662 /source/blender/editors | |
parent | ef80914c99fb94a4bc7e02a1f808eb0162577fec (diff) |
Cleanup: fixes for building with recent clang
Diffstat (limited to 'source/blender/editors')
5 files changed, 20 insertions, 15 deletions
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index 2acba04368c..b06af01bab6 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -56,14 +56,20 @@ void cpack(unsigned int x); # define glMultMatrixf(x) \ glMultMatrixf(_Generic((x), \ float *: (float *)(x), \ + float [16]: (float *)(x), \ float (*)[4]: (float *)(x), \ + float [4][4]: (float *)(x), \ const float *: (float *)(x), \ - const float (*)[4]: (float *)(x)) \ + const float [16]: (float *)(x), \ + const float (*)[4]: (float *)(x), \ + const float [4][4]: (float *)(x)) \ ) # define glLoadMatrixf(x) \ glLoadMatrixf(_Generic((x), \ float *: (float *)(x), \ - float (*)[4]: (float *)(x)) \ + float [16]: (float *)(x), \ + float (*)[4]: (float *)(x), \ + float [4][4]: (float *)(x)) \ ) #else # define glMultMatrixf(x) glMultMatrixf((float *)(x)) diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 9d0582701d2..3e675012d05 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -1334,7 +1334,7 @@ static float project_paint_uvpixel_mask( /* now we can use the normal as a mask */ if (ps->is_ortho) { - angle = angle_normalized_v3v3((float *)ps->viewDir, no); + angle = angle_normalized_v3v3(ps->viewDir, no); } else { /* Annoying but for the perspective view we need to get the pixels location in 3D space :/ */ diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 5464449a94e..21a9246d7e6 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -96,11 +96,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf static int vergname(const void *v1, const void *v2) { - char **x1, **x2; - - x1 = (char **)v1; - x2 = (char **)v2; - + const char * const *x1 = v1, * const *x2 = v2; return BLI_natstrcmp(*x1, *x2); } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 8d6aae46567..5dc34d2a31a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4751,7 +4751,7 @@ static void createTransSeqData(bContext *C, TransInfo *t) TransData2D *td2d = NULL; TransDataSeq *tdsq = NULL; TransSeq *ts = NULL; - float xmouse, ymouse; + int xmouse; int count = 0; @@ -4762,7 +4762,7 @@ static void createTransSeqData(bContext *C, TransInfo *t) t->customFree = freeSeqData; - UI_view2d_region_to_view(v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); + xmouse = (int)UI_view2d_region_to_view_x(v2d, t->imval[0]); /* which side of the current frame should be allowed */ if (t->mode == TFM_TIME_EXTEND) { diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index c51a192b109..569fe1c326d 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -3402,8 +3402,8 @@ static void p_chart_stretch_minimize(PChart *chart, RNG *rng) static int p_compare_geometric_uv(const void *a, const void *b) { - const PVert *v1 = *(const PVert **)a; - const PVert *v2 = *(const PVert **)b; + const PVert *v1 = *(const PVert * const *)a; + const PVert *v2 = *(const PVert * const *)b; if (v1->uv[0] < v2->uv[0]) return -1; @@ -3788,11 +3788,14 @@ static PBool p_node_intersect(SmoothNode *node, float co[2]) /* smoothing */ -static int p_compare_float(const void *a, const void *b) +static int p_compare_float(const void *a_, const void *b_) { - if (*((float *)a) < *((float *)b)) + const float a = *(const float *)a_; + const float b = *(const float *)b_; + + if (a < b) return -1; - else if (*((float *)a) == *((float *)b)) + else if (a == b) return 0; else return 1; |