Cleanup: fix mismatch in printf formating (int/unsigned int).
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 19 Jun 2015 10:29:06 +0000 (12:29 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 19 Jun 2015 10:31:25 +0000 (12:31 +0200)
Noisy and annoying with new gcc5...

14 files changed:
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/mesh_validate.c
source/blender/collada/ControllerExporter.cpp
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/armature/pose_select.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/object/object_lattice.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/imbuf/intern/cineon/cineonlib.c
source/blender/imbuf/intern/cineon/dpxlib.c
source/blender/imbuf/intern/cineon/logImageCore.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c

index d850dd3ee266ea54e4d4f9fa7220097224aa8ec7..22d450d57673573fd47c1ce344a67d9d97fb1132 100644 (file)
@@ -412,7 +412,7 @@ void DM_ensure_tessface(DerivedMesh *dm)
                        /* printf("info %s: polys -> ngons calculated\n", __func__); */
                }
                else {
-                       printf("warning %s: could not create tessfaces from %d polygons, dm->type=%d\n",
+                       printf("warning %s: could not create tessfaces from %d polygons, dm->type=%u\n",
                               __func__, numPolys, dm->type);
                }
        }
index f758bcdf2f5d34c3f7a7739f4381e88c536719bd..418c2911b5bd99ae9fd7a3cd86512b3f07e5c19f 100644 (file)
@@ -500,13 +500,13 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
 
                        if (mp->loopstart < 0 || mp->totloop < 3) {
                                /* Invalid loop data. */
-                               PRINT_ERR("\tPoly %u is invalid (loopstart: %u, totloop: %u)\n",
+                               PRINT_ERR("\tPoly %u is invalid (loopstart: %d, totloop: %d)\n",
                                          sp->index, mp->loopstart, mp->totloop);
                                sp->invalid = true;
                        }
                        else if (mp->loopstart + mp->totloop > totloop) {
                                /* Invalid loop data. */
-                               PRINT_ERR("\tPoly %u uses loops out of range (loopstart: %u, loopend: %u, max nbr of loops: %u)\n",
+                               PRINT_ERR("\tPoly %u uses loops out of range (loopstart: %d, loopend: %d, max nbr of loops: %u)\n",
                                          sp->index, mp->loopstart, mp->loopstart + mp->totloop - 1, totloop - 1);
                                sp->invalid = true;
                        }
@@ -552,7 +552,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                                        v2 = mloops[sp->loopstart + (j + 1) % mp->totloop].v;
                                        if (!BLI_edgehash_haskey(edge_hash, v1, v2)) {
                                                /* Edge not existing. */
-                                               PRINT_ERR("\tPoly %u needs missing edge (%u, %u)\n", sp->index, v1, v2);
+                                               PRINT_ERR("\tPoly %u needs missing edge (%d, %d)\n", sp->index, v1, v2);
                                                if (do_fixes)
                                                        recalc_flag.edges = true;
                                                else
@@ -564,7 +564,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                                                if (do_fixes) {
                                                        int prev_e = ml->e;
                                                        ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
-                                                       PRINT_ERR("\tLoop %u has invalid edge reference (%u), fixed using edge %u\n",
+                                                       PRINT_ERR("\tLoop %u has invalid edge reference (%d), fixed using edge %u\n",
                                                                  sp->loopstart + j, prev_e, ml->e);
                                                }
                                                else {
@@ -580,7 +580,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                                                        if (do_fixes) {
                                                                int prev_e = ml->e;
                                                                ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
-                                                               PRINT_ERR("\tPoly %u has invalid edge reference (%u), fixed using edge %u\n",
+                                                               PRINT_ERR("\tPoly %u has invalid edge reference (%d), fixed using edge %u\n",
                                                                          sp->index, prev_e, ml->e);
                                                        }
                                                        else {
@@ -602,7 +602,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                                                if (*v != *prev_v) {
                                                        int dlt = v - prev_v;
                                                        if (dlt > 1) {
-                                                               PRINT_ERR("\tPoly %u is invalid, it multi-uses vertex %u (%u times)\n",
+                                                               PRINT_ERR("\tPoly %u is invalid, it multi-uses vertex %d (%d times)\n",
                                                                          sp->index, *prev_v, dlt);
                                                                sp->invalid = true;
                                                        }
@@ -610,7 +610,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                                                }
                                        }
                                        if (v - prev_v > 1) { /* Don't forget final verts! */
-                                               PRINT_ERR("\tPoly %u is invalid, it multi-uses vertex %u (%u times)\n",
+                                               PRINT_ERR("\tPoly %u is invalid, it multi-uses vertex %d (%d times)\n",
                                                          sp->index, *prev_v, (int)(v - prev_v));
                                                sp->invalid = true;
                                        }
@@ -689,10 +689,10 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                        }
                        if ((p1_nv == p2_nv) && (memcmp(p1_v, p2_v, p1_nv * sizeof(*p1_v)) == 0)) {
                                if (do_verbose) {
-                                       PRINT_ERR("\tPolys %u and %u use same vertices (%u",
+                                       PRINT_ERR("\tPolys %u and %u use same vertices (%d",
                                                  prev_sp->index, sp->index, *p1_v);
                                        for (j = 1; j < p1_nv; j++)
-                                               PRINT_ERR(", %u", p1_v[j]);
+                                               PRINT_ERR(", %d", p1_v[j]);
                                        PRINT_ERR("), considering poly %u as invalid.\n", sp->index);
                                }
                                else {
@@ -741,7 +741,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                                }
                                /* Multi-used loops. */
                                else if (prev_end > sp->loopstart) {
-                                       PRINT_ERR("\tPolys %u and %u share loops from %u to %u, considering poly %u as invalid.\n",
+                                       PRINT_ERR("\tPolys %u and %u share loops from %d to %d, considering poly %u as invalid.\n",
                                                  prev_sp->index, sp->index, sp->loopstart, prev_end, sp->index);
                                        if (do_fixes) {
                                                REMOVE_POLY_TAG((&mpolys[sp->index]));
@@ -846,7 +846,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                        int tot_elem = 0;
 
                        if (msel->index < 0) {
-                               PRINT_ERR("\tMesh select element %d type %d index is negative, "
+                               PRINT_ERR("\tMesh select element %u type %d index is negative, "
                                          "resetting selection stack.\n", i, msel->type);
                                free_flag.mselect = do_fixes;
                                break;
@@ -865,7 +865,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
                        }
 
                        if (msel->index > tot_elem) {
-                               PRINT_ERR("\tMesh select element %d type %d index %d is larger than data array size %d, "
+                               PRINT_ERR("\tMesh select element %u type %d index %d is larger than data array size %d, "
                                          "resetting selection stack.\n", i, msel->type, msel->index, tot_elem);
 
                                free_flag.mselect = do_fixes;
index 16c3f68bca44a0cb2388507f6eb78848ef11b1cb..06e151c363bae052f278fe7fedbe8f43af5e499d 100644 (file)
@@ -284,7 +284,8 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm)
                }
 
                if (oob_counter > 0) {
-                       fprintf(stderr, "Ignored %d Vertex weights which use index to non existing VGroup %ld.\n", oob_counter, joint_index_by_def_index.size());
+                       fprintf(stderr, "Ignored %d Vertex weights which use index to non existing VGroup %lu.\n",
+                               oob_counter, joint_index_by_def_index.size());
                }
        }
 
index d08a32c6e6ba0c11fde7bb837e4413d6c04749d8..f9e3c8a9fa62724360451b52a69f8726d26c7d0c 100644 (file)
@@ -874,7 +874,7 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands, ListBase *sr
                        break;
                }
                default:
-                       printf("rearrange_animchannel_add_to_islands(): don't know how to handle channels of type %d\n", type);
+                       printf("rearrange_animchannel_add_to_islands(): don't know how to handle channels of type %u\n", type);
                        return;
        }
        
index a396b122f69dfd8d39b313590d67dc26f418e2ba..75f5eb17b09fb3ba08215ff0e98f0ddfe81c52d4 100644 (file)
@@ -2922,7 +2922,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_F
                        /* unhandled */
                        default:
                        {
-                               printf("ANIM_animdata_filter() - Invalid datatype argument %d\n", datatype);
+                               printf("ANIM_animdata_filter() - Invalid datatype argument %u\n", datatype);
                                break;
                        }
                }
index 3bac50ef3ed1d4963928d6cb64e4b2b93bafd8ee..44470c1f827bce9baf8212c61a3cdd245b404cee 100644 (file)
@@ -821,7 +821,7 @@ static int pose_select_grouped_exec(bContext *C, wmOperator *op)
                        break;
                
                default:
-                       printf("pose_select_grouped() - Unknown selection type %d\n", type);
+                       printf("pose_select_grouped() - Unknown selection type %u\n", type);
                        break;
        }
        
index c911e6c355842a8e23fdf68537ededc142c3f5e7..6226ca56a2cb8a95f0592fb321e8a0a6dedabdfe 100644 (file)
@@ -9002,7 +9002,7 @@ static int ui_handle_menu_event(
                                                                        ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE);
                                                                }
                                                                else {
-                                                                       printf("%s: error, but->menu_key type: %d\n", __func__, but->type);
+                                                                       printf("%s: error, but->menu_key type: %u\n", __func__, but->type);
                                                                }
 
                                                                break;
index b577dab8a77c9f55c77d576e2097cc7bed822fe5..76d9facf701b5e6b657994b113ac807889253965 100644 (file)
@@ -713,7 +713,7 @@ static int lattice_flip_exec(bContext *C, wmOperator *op)
                        break;
                        
                default:
-                       printf("lattice_flip(): Unknown flipping axis (%d)\n", axis);
+                       printf("lattice_flip(): Unknown flipping axis (%u)\n", axis);
                        return OPERATOR_CANCELLED;
        }
        
index 44a3654109fc5eea7cf554979666258fc7aa2472..bab489a7d22070926f71313f5da29cc522522ef7 100644 (file)
@@ -1953,7 +1953,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
        }
 
        if (retval == NULL)
-               printf("Unable to create a GPUShader for builtin shader: %d\n", shader);
+               printf("Unable to create a GPUShader for builtin shader: %u\n", shader);
 
        return retval;
 }
@@ -1976,7 +1976,7 @@ GPUProgram *GPU_shader_get_builtin_program(GPUBuiltinProgram program)
        }
 
        if (retval == NULL)
-               printf("Unable to create a GPUProgram for builtin program: %d\n", program);
+               printf("Unable to create a GPUProgram for builtin program: %u\n", program);
 
        return retval;
 }
index 0e71206517ee4d083fb862af698a3e6061fe7f08..fbce508af17d072b88482c2cb5489289336430b2 100644 (file)
@@ -307,7 +307,7 @@ LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t
                        printf("  Transfer characteristics: %d\n", cineon->element[i].transfer);
                        printf("  Packing: %d\n", cineon->element[i].packing);
                        printf("  Descriptor: %d\n", cineon->element[i].descriptor);
-                       printf("  Data offset: %u\n", cineon->element[i].dataOffset);
+                       printf("  Data offset: %d\n", cineon->element[i].dataOffset);
                        printf("  Reference low data: %u\n", cineon->element[i].refLowData);
                        printf("  Reference low quantity: %f\n", cineon->element[i].refLowQuantity);
                        printf("  Reference high data: %u\n", cineon->element[i].refHighData);
index 23e5517bb09bf4ad8eee21b8aef6ec023095bd40..562bdecb8427928776b1a283d0e570abc04bda65 100644 (file)
@@ -366,7 +366,7 @@ LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t buf
                        printf("  Transfer characteristics: %d\n", dpx->element[i].transfer);
                        printf("  Packing: %d\n", dpx->element[i].packing);
                        printf("  Descriptor: %d\n", dpx->element[i].descriptor);
-                       printf("  Data offset: %u\n", dpx->element[i].dataOffset);
+                       printf("  Data offset: %d\n", dpx->element[i].dataOffset);
                        printf("  Reference low data: %u\n", dpx->element[i].refLowData);
                        printf("  Reference low quantity: %f\n", dpx->element[i].refLowQuantity);
                        printf("  Reference high data: %u\n", dpx->element[i].refHighData);
index 1500f4282e51bbc39a18fe94d8c1c01a2a31fbea..5ec0a87890c5184326f14cb1df5eef3e9a9adc37 100644 (file)
@@ -623,7 +623,7 @@ static int logImageElementGetData8(LogImageFile *logImage, LogImageElement logEl
        for (y = 0; y < logImage->height; y++) {
                /* 8 bits are 32-bits padded so we need to seek at each row */
                if (logimage_fseek(logImage, logElement.dataOffset + y * rowLength, SEEK_SET) != 0) {
-                       if (verbose) printf("DPX/Cineon: Couldn't seek at %d\n", logElement.dataOffset + y * rowLength);
+                       if (verbose) printf("DPX/Cineon: Couldn't seek at %d\n", logElement.dataOffset + y * (int)rowLength);
                        return 1;
                }
 
index b1fe4bf168551227e839332760275fca37c3c7a2..075390f9a15fdbd5a0d51c949a345ad2a24c2dde 100644 (file)
@@ -578,7 +578,7 @@ void WM_event_print(const wmEvent *event)
                if (ISNDOF(event->type)) {
                        const wmNDOFMotionData *ndof = event->customdata;
                        if (event->type == NDOF_MOTION) {
-                               printf("   ndof: rot: (%.4f %.4f %.4f), tx: (%.4f %.4f %.4f), dt: %.4f, progress: %d\n",
+                               printf("   ndof: rot: (%.4f %.4f %.4f), tx: (%.4f %.4f %.4f), dt: %.4f, progress: %u\n",
                                       UNPACK3(ndof->rvec), UNPACK3(ndof->tvec), ndof->dt, ndof->progress);
                        }
                        else {
index c7544f213720e85f0d5668b6de21d6355606de72..edca1f97ecf37409c078b2a23885dff875948950 100644 (file)
@@ -550,7 +550,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
 
        if (MEM_get_memory_blocks_in_use() != 0) {
                size_t mem_in_use = MEM_get_memory_in_use() + MEM_get_memory_in_use();
-               printf("Error: Not freed memory blocks: %d, total unfreed memory %f MB\n",
+               printf("Error: Not freed memory blocks: %u, total unfreed memory %f MB\n",
                       MEM_get_memory_blocks_in_use(),
                       (double)mem_in_use / 1024 / 1024);
                MEM_printmemlist();