Cleanup: warnings (clang)
authorCampbell Barton <ideasman42@gmail.com>
Sun, 30 Dec 2018 04:14:00 +0000 (15:14 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 30 Dec 2018 04:15:05 +0000 (15:15 +1100)
15 files changed:
source/blender/blenlib/intern/BLI_timer.c
source/blender/blenlib/intern/noise.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/draw/engines/eevee/eevee_shaders.c
source/blender/draw/engines/workbench/workbench_volume.c
source/blender/draw/intern/draw_cache.c
source/blender/draw/intern/draw_cache_impl_mesh.c
source/blender/editors/gpencil/annotate_paint.c
source/blender/editors/gpencil/gpencil_intern.h
source/blender/gpu/intern/gpu_framebuffer.c
source/blender/imbuf/intern/colormanagement.c
source/blender/makesrna/intern/rna_gpencil.c
source/blender/makesrna/intern/rna_object.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_particleinstance.c

index 7bb919d47e009937bb13e4ce0d9c7eb875f5a8e4..fdd89771077a8e7d7d21c295c9872d074c42e270 100644 (file)
@@ -50,7 +50,7 @@ typedef struct TimerContainer {
        bool file_load_cb_registered;
 } TimerContainer;
 
-static TimerContainer GlobalTimer = { 0 };
+static TimerContainer GlobalTimer = {{0}};
 
 static void ensure_callback_is_registered(void);
 
index 8ee99544ca58484fbef53b5adb00c4a56d90a00c..ee2bab11ade87a23cd26479f80d0f438737e6f0e 100644 (file)
@@ -188,7 +188,7 @@ const unsigned char hash[512] = {
 };
 
 
-const float hashvectf[768] = {
+static const float hashvectf[768] = {
        0.33783, 0.715698, -0.611206, -0.944031, -0.326599, -0.045624, -0.101074, -0.416443, -0.903503, 0.799286, 0.49411,
        -0.341949, -0.854645, 0.518036, 0.033936, 0.42514, -0.437866, -0.792114, -0.358948, 0.597046, 0.717377, -0.985413,
        0.144714, 0.089294, -0.601776, -0.33728, -0.723907, -0.449921, 0.594513, 0.666382, 0.208313, -0.10791, 0.972076,
index f0c2a343d4a5498741734e92c7a6da579e574647..e48616ea2312728d173e9fa5cbff6f27b5a8e4f8 100644 (file)
@@ -1741,9 +1741,8 @@ static void bevel_harden_normals_mode(BevelParams *bp, BevVert *bv, BMOperator *
                /* Set normals.out for vertices as computed earlier */
                if (BMO_slot_map_contains(nslot, bcur->nv.v) != true) {
 
-                       float(*vert_normal) = MEM_callocN(sizeof(*vert_normal) * 3, __func__);
-                       add_v3_v3(vert_normal, n_final);
-                       normalize_v3(vert_normal);
+                       float *vert_normal = MEM_mallocN(sizeof(*vert_normal) * 3, __func__);
+                       normalize_v3_v3(vert_normal, n_final);
 
                        BMO_slot_map_insert(op, nslot, bcur->nv.v, vert_normal);
                }
index 6fbd0ae5173f5a323b9639f1754c2c1a4c1862b0..29b30e7763e0b13f8c0157687858874558b6f6b1 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "eevee_private.h"
 
-const char *filter_defines = "#define HAMMERSLEY_SIZE " STRINGIFY(HAMMERSLEY_SIZE) "\n"
+static const char *filter_defines = "#define HAMMERSLEY_SIZE " STRINGIFY(HAMMERSLEY_SIZE) "\n"
 #if defined(IRRADIANCE_SH_L2)
                                     "#define IRRADIANCE_SH_L2\n"
 #elif defined(IRRADIANCE_CUBEMAP)
index a4cd81e7fd20912fffd1532683737e026153b405..408212f6814a555109288bd86d0da29168944887 100644 (file)
@@ -52,7 +52,7 @@ static struct {
        struct GPUShader *volume_slice_coba_sh;
        struct GPUTexture *dummy_tex;
        struct GPUTexture *dummy_coba_tex;
-} e_data = {NULL};
+} e_data = {{NULL}};
 
 extern char datatoc_workbench_volume_vert_glsl[];
 extern char datatoc_workbench_volume_frag_glsl[];
index ff4fb0c85f65e5594b8007f6499dd972369f7161..f0a147f17b1ce030c0c18045dc0185ea1f95b7f7 100644 (file)
@@ -2714,7 +2714,7 @@ GPUBatch *DRW_cache_bone_arrows_get(void)
        return SHC.drw_bone_arrows;
 }
 
-const float staticSine[16] = {
+static const float staticSine[16] = {
        0.0f, 0.104528463268f, 0.207911690818f, 0.309016994375f,
        0.406736643076f, 0.5f, 0.587785252292f, 0.669130606359f,
        0.743144825477f, 0.809016994375f, 0.866025403784f,
index 30a940e27f6e4394ab507fc9565ca370d77fed3c..9d9f7c47b14a4697847ce05647d7d77f74a305a7 100644 (file)
@@ -268,7 +268,7 @@ typedef struct MeshRenderData {
        int *loose_verts;
 
        float (*poly_normals)[3];
-       float (*vert_weight);
+       float *vert_weight;
        char (*vert_color)[3];
        GPUPackedNormal *poly_normals_pack;
        GPUPackedNormal *vert_normals_pack;
@@ -1422,7 +1422,7 @@ static float evaluate_vertex_weight(const MDeformVert *dvert, const DRW_MeshWeig
 /** Ensure #MeshRenderData.vert_weight */
 static void mesh_render_data_ensure_vert_weight(MeshRenderData *rdata, const struct DRW_MeshWeightState *wstate)
 {
-       float (*vweight) = rdata->vert_weight;
+       float *vweight = rdata->vert_weight;
        if (vweight == NULL) {
                if (wstate->defgroup_active == -1) {
                        goto fallback;
@@ -3245,7 +3245,7 @@ static void mesh_create_weights(MeshRenderData *rdata, GPUVertBuf *vbo, DRW_Mesh
        const int vbo_len_capacity = mesh_render_data_verts_len_get_maybe_mapped(rdata);
 
        mesh_render_data_ensure_vert_weight(rdata, wstate);
-       const float (*vert_weight) = rdata->vert_weight;
+       const float *vert_weight = rdata->vert_weight;
 
        GPU_vertbuf_init_with_format(vbo, &format);
        /* Meh, another allocation / copy for no benefit.
index a868e98e3dda07b7c81ca4c1dd4888b862edc87d..b6f81c818239983f98385e369572453f23c0d07b 100644 (file)
@@ -1697,8 +1697,8 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event, Depsg
        /* verify key status for straight lines */
        if ((event->ctrl > 0) || (event->alt > 0)) {
                if (p->straight[0] == 0) {
-                       int dx = abs(p->mval[0] - p->mvalo[0]);
-                       int dy = abs(p->mval[1] - p->mvalo[1]);
+                       int dx = abs((int)(p->mval[0] - p->mvalo[0]));
+                       int dy = abs((int)(p->mval[1] - p->mvalo[1]));
                        if ((dx > 0) || (dy > 0)) {
                                /* check mouse direction to replace the other coordinate with previous values */
                                if (dx >= dy) {
index 71d293d52446af724bb716ee1b6419747fe536d7..aaeb2603accdc51d2646e27018ea1436fe6b4a51 100644 (file)
@@ -508,7 +508,7 @@ struct GP_EditableStrokes_Iter {
  */
 #define GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)                           \
 {                                                                                       \
-       struct GP_EditableStrokes_Iter gpstroke_iter = {0};                                 \
+       struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}};                             \
        Depsgraph *depsgraph_ = CTX_data_depsgraph(C);                                      \
        Object *obact_ = CTX_data_active_object(C);                                         \
        bGPdata *gpd_ = CTX_data_gpencil_data(C);                                           \
index 8714c72686c589f59a45fbb344bdb9bccb756905..915a7669326f67e874ff45c9c1dd844e6b7fdcd0 100644 (file)
@@ -479,7 +479,7 @@ static void gpu_framebuffer_update_attachments_and_fill_empty_slots(GPUFrameBuff
 static struct {
        GPUFrameBuffer *framebuffers[FRAMEBUFFER_STACK_DEPTH];
        uint top;
-} FrameBufferStack = { 0 };
+} FrameBufferStack = {{0}};
 
 static void gpuPushFrameBuffer(GPUFrameBuffer *fbo)
 {
index 395bb90d686143d6ca43b97c0194c70cad69fc39..887e2390718f02bb178e5f657d13bd88cb45715a 100644 (file)
@@ -97,8 +97,8 @@ static int global_tot_looks = 0;
 float imbuf_luma_coefficients[3] = {0.0f};
 float imbuf_xyz_to_rgb[3][3] = {{0.0f}};
 float imbuf_rgb_to_xyz[3][3] = {{0.0f}};
-float imbuf_xyz_to_linear_srgb[3][3] = {{0.0f}};
-float imbuf_linear_srgb_to_xyz[3][3] = {{0.0f}};
+static float imbuf_xyz_to_linear_srgb[3][3] = {{0.0f}};
+static float imbuf_linear_srgb_to_xyz[3][3] = {{0.0f}};
 
 /* lock used by pre-cached processors getters, so processor wouldn't
  * be created several times
index 92d29b4c2c59093d3dfb5a970b88752ef38b715f..e632bf36d67bc191a8f50c3a759cb2d967c0d3c5 100644 (file)
@@ -72,7 +72,7 @@ static EnumPropertyItem rna_enum_gpencil_onion_modes_items[] = {
        {0, NULL, 0, NULL, NULL}
 };
 
-const EnumPropertyItem rna_enum_gplayer_move_type_items[] = {
+static const EnumPropertyItem rna_enum_gplayer_move_type_items[] = {
    {-1, "UP", 0, "Up", ""},
    {1, "DOWN", 0, "Down", ""},
    {0, NULL, 0, NULL, NULL}
index 411c6af5a3fb41af7467ec5317d728d2c5924dab..661a3c25e453b63b3a511b6087d3d9c13bde3740 100644 (file)
@@ -110,7 +110,7 @@ const EnumPropertyItem rna_enum_object_empty_drawtype_items[] = {
        {0, NULL, 0, NULL, NULL}
 };
 
-const EnumPropertyItem rna_enum_object_empty_image_depth_items[] = {
+static const EnumPropertyItem rna_enum_object_empty_image_depth_items[] = {
        {OB_EMPTY_IMAGE_DEPTH_DEFAULT, "DEFAULT", 0, "Default", ""},
        {OB_EMPTY_IMAGE_DEPTH_FRONT, "FRONT", 0, "Front", ""},
        {OB_EMPTY_IMAGE_DEPTH_BACK, "BACK", 0, "Back", ""},
index e2c13d028272400e10c54352080add0d972ab986..77f607d19a237b63620af9996b0bbee49b08e3eb 100644 (file)
@@ -32,7 +32,6 @@
  *  \ingroup modifiers
  */
 
-
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
@@ -51,6 +50,8 @@
 #include "BKE_particle.h"
 #include "BKE_scene.h"
 
+#include "MOD_modifiertypes.h"
+
 static void initData(ModifierData *md)
 {
        BuildModifierData *bmd = (BuildModifierData *) md;
index 0a5b34c90eed1fcba077a245596fb147a6ec7c13..fa305f4c8a72aef257ef43ace0665af40e03bc6e 100644 (file)
  *                 Campbell Barton
  *
  * ***** END GPL LICENSE BLOCK *****
- *
  */
 
 /** \file blender/modifiers/intern/MOD_particleinstance.c
  *  \ingroup modifiers
  */
 
-
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 
@@ -56,6 +54,8 @@
 #include "DEG_depsgraph_build.h"
 #include "DEG_depsgraph_query.h"
 
+#include "MOD_modifiertypes.h"
+
 static void initData(ModifierData *md)
 {
        ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;