2.5: various warning fixes.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 17 Jan 2009 00:51:42 +0000 (00:51 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 17 Jan 2009 00:51:42 +0000 (00:51 +0000)
28 files changed:
intern/SoundSystem/SND_Utils.h
intern/SoundSystem/intern/SND_Utils.cpp
intern/decimation/intern/LOD_ExternNormalEditor.cpp
intern/decimation/intern/LOD_ManMesh2.cpp
intern/decimation/intern/LOD_QSDecimator.cpp
intern/elbeem/intern/solver_init.cpp
intern/ghost/intern/GHOST_WindowX11.cpp
intern/iksolver/intern/IK_Solver.cpp
intern/opennl/superlu/util.c
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/report.c
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/arithb.c
source/blender/blenlib/intern/fnmatch.c
source/blender/blenlib/intern/graph.c
source/blender/blenlib/intern/listbase.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/editarmature.c
source/blender/editors/transform/transform_conversions.c
source/blender/imbuf/intern/cineon/cineonlib.c
source/blender/imbuf/intern/cineon/dpxlib.c

index 26cf1bda11cc19dab04986825563f95803393676..82b7c69a595c180c2b47931e5656c70c3a8fa994 100644 (file)
@@ -97,8 +97,8 @@ extern unsigned int SND_GetSampleFormat(void* sample);
 extern unsigned int SND_GetNumberOfChannels(void* sample);
 extern unsigned int SND_GetSampleRate(void* sample);
 extern unsigned int SND_GetBitRate(void* sample);
-extern unsigned int SND_GetNumberOfSamples(void* sample, int sample_length);
-extern unsigned int SND_GetHeaderSize(void* sample, int sample_length);
+extern unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length);
+extern unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length);
 extern unsigned int SND_GetExtraChunk(void* sample);
 
 extern void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot);
index 26ce106a24e5cbab243e2c3f7694211426dfb8a9..a9239576c9605806f437a6d8d6e895e05db9a447 100644 (file)
@@ -290,7 +290,7 @@ unsigned int SND_GetBitRate(void* sample)
 
 
 /* gets the length of the actual sample data (without the header) */
-unsigned int SND_GetNumberOfSamples(void* sample, int sample_length)
+unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length)
 {
        unsigned int chunklength, length = 0, offset;
        unsigned short block_align;
@@ -330,7 +330,7 @@ unsigned int SND_GetNumberOfSamples(void* sample, int sample_length)
 
 
 /* gets the size of the entire header (file - sampledata) */
-unsigned int SND_GetHeaderSize(void* sample, int sample_length)
+unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length)
 {
        unsigned int chunklength, headersize = 0, offset = 16;
        unsigned short block_align;
index b7c7b5a529b5850087d827e8e4fd8fe5e01b1985..21fd4f3e39fd57d323a58b6206bce9c3c22c7aae 100644 (file)
@@ -41,8 +41,8 @@ LOD_ExternNormalEditor(
        LOD_Decimation_InfoPtr extern_info,
        LOD_ManMesh2 &mesh
 ) :
-       m_extern_info (extern_info),
-       m_mesh(mesh)
+       m_mesh(mesh),
+       m_extern_info (extern_info)
 {
 }
 
index 2fe49b36583c47c756fa1dd498d08908fd7ccb3e..99f1c7d926a03791ff745d2e1c548146b98c9a06 100644 (file)
@@ -546,7 +546,7 @@ DeleteEdge(
 
                // edges[e] should already have been removed from the heap
 
-               MT_assert(edges[e].HeapPos() == 0xffffffff);
+               MT_assert(edges[e].HeapPos() == -1);
 
                edges[e] = edges[last];
                // also have to swap there heap positions.!!!!!
index 1a0ec87f05b1be6d8b876d8c7e56e4328e3c8729..0b0de767a9a39db39990330110c244e50e54e82c 100644 (file)
@@ -91,10 +91,10 @@ LOD_QSDecimator(
        LOD_ExternNormalEditor &face_editor,
        LOD_ExternBufferEditor &extern_editor
 ) :
+       m_is_armed (false),
        m_mesh(mesh),
        m_face_editor(face_editor),
-       m_extern_editor(extern_editor),
-       m_is_armed (false)
+       m_extern_editor(extern_editor)
 {      
        m_deg_edges.reserve(32);
        m_deg_faces.reserve(32);
@@ -318,7 +318,7 @@ UpdateHeap(
                LOD_Edge &e = edge_set[*edge_it];
                m_heap->Remove(&edge_set[0],e.HeapPos());
 
-               e.HeapPos() = 0xffffffff;
+               e.HeapPos() = -1;
 
        }
 }
index 270531d80be9a9b8119cb33166d593bfe75605b0..ce54adb48ee4b913a8fe9a0aeabffb560d5c4914 100644 (file)
@@ -1401,7 +1401,7 @@ void LbmFsgrSolver::initMovingObstacles(bool staticInit) {
                debMsgStd("LbmFsgrSolver::initMovingObstacles",DM_MSG," obj "<<obj->getName()<<" skip:"<<skip<<", static:"<<staticInit<<" anim:"<<obj->getIsAnimated()<<" gid:"<<obj->getGeoInitId()<<" simgid:"<<mLbmInitId, 10);
 
                if( (obj->getGeoInitType()&FGI_ALLBOUNDS) || 
-                               (obj->getGeoInitType()&FGI_FLUID) && staticInit ) {
+                               ((obj->getGeoInitType()&FGI_FLUID) && staticInit) ) {
 
                        otype = ntype = CFInvalid;
                        switch(obj->getGeoInitType()) {
index 34ce0409d53b6b4d9b575faa2a37b44ef4ccf22c..2cc30aaa5bc11a0fe3d30e767597783f99c7b4f6 100644 (file)
@@ -719,17 +719,17 @@ void GHOST_WindowX11::netwmMaximized(bool set)
 bool GHOST_WindowX11::netwmIsMaximized(void) const
 {
        unsigned char *prop_ret;
-       unsigned long bytes_after, num_ret;
+       unsigned long bytes_after, num_ret, i;
        Atom type_ret;
        bool st;
-       int format_ret, count, i;
+       int format_ret, ret, count;
 
        prop_ret = NULL;
        st = False;
-       i = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
+       ret = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
                        0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
                        &num_ret, &bytes_after, &prop_ret);
-       if ((i == Success) && (prop_ret) && (format_ret == 32)) {
+       if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
                count = 0;
                for (i = 0; i < num_ret; i++) {
                        if (((unsigned long *) prop_ret)[i] == m_system->m_net_max_horz)
@@ -775,17 +775,17 @@ void GHOST_WindowX11::netwmFullScreen(bool set)
 bool GHOST_WindowX11::netwmIsFullScreen(void) const
 {
        unsigned char *prop_ret;
-       unsigned long bytes_after, num_ret;
+       unsigned long bytes_after, num_ret, i;
        Atom type_ret;
        bool st;
-       int format_ret, i;
+       int format_ret, ret;
 
        prop_ret = NULL;
        st = False;
-       i = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
+       ret = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
                        0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
                        &num_ret, &bytes_after, &prop_ret);
-       if ((i == Success) && (prop_ret) && (format_ret == 32)) {
+       if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
                for (i = 0; i < num_ret; i++) {
                        if (((unsigned long *) prop_ret)[i] == m_system->m_net_fullscreen) {
                                st = True;
@@ -868,7 +868,6 @@ GHOST_TSuccess GHOST_WindowX11::setState(GHOST_TWindowState state)
 {
        GHOST_TWindowState cur_state;
        bool is_max, is_full, is_motif_full;
-       int icccm_state;
 
        cur_state = getState();
         if (state == (int)cur_state)
index 9de937ea4b25c783f04d3a0a43abc4eea92741a8..9eec1c38a2d1f6cb7bfbe26bd7a778e17c22165f 100644 (file)
@@ -175,11 +175,12 @@ void IK_SetLimit(IK_Segment *seg, IK_SegmentAxis axis, float lmin, float lmax)
        IK_QSegment *qseg = (IK_QSegment*)seg;
 
        if (axis >= IK_TRANS_X) {
-               if(!qseg->Translational())
+               if(!qseg->Translational()) {
                        if(qseg->Composite() && qseg->Composite()->Translational())
                                qseg = qseg->Composite();
                        else
                                return;
+               }
 
                if(axis == IK_TRANS_X) axis = IK_X;
                else if(axis == IK_TRANS_Y) axis = IK_Y;
@@ -201,11 +202,12 @@ void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness)
        MT_Scalar weight = 1.0-stiffness;
 
        if (axis >= IK_TRANS_X) {
-               if(!qseg->Translational())
+               if(!qseg->Translational()) {
                        if(qseg->Composite() && qseg->Composite()->Translational())
                                qseg = qseg->Composite();
                        else
                                return;
+               }
 
                if(axis == IK_TRANS_X) axis = IK_X;
                else if(axis == IK_TRANS_Y) axis = IK_Y;
index 824cabacee5df377fe2e894b0f82302a51654585..f77da9c47361dfa60fa248068e2f527a42a25317 100644 (file)
@@ -34,7 +34,7 @@ float DenseSize(int n, float sum_nw);
 
 void superlu_abort_and_exit(char* msg)
 {
-    fprintf(stderr, msg);
+    fprintf(stderr, "%s", msg);
     exit (-1);
 }
 
index d6efc1288ec7e607a8ef34ae76a28171986c39ce..d9988abdaaba0e96483cff6c573e3e8b67bcdfe3 100644 (file)
@@ -127,10 +127,10 @@ void CTX_data_list_add(bContextDataResult *result, void *data);
                BLI_freelistN(&ctx_data_list); \
        }
 
-#define CTX_DATA_COUNT(C, member, i) \
-       CTX_DATA_BEGIN(C, void*, unused, member) \
-               i++; \
-       CTX_DATA_END
+int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*));
+
+#define CTX_DATA_COUNT(C, member) \
+       ctx_data_list_count(C, CTX_data_##member)
 
 /* Data Context Members */
 
index 063a0e4a31fd730b182be422309496159d7acec0..2ecc8cb175468cd9328ec28a102e19fa5b428b86 100644 (file)
@@ -1635,7 +1635,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                        }
 
                        /* create an orco derivedmesh in parallel */
-                       mask= (CustomDataMask)curr->link;
+                       mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
                        if(mask & CD_MASK_ORCO) {
                                if(!orcodm)
                                        orcodm= create_orco_dm(ob, me, NULL);
@@ -1655,7 +1655,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                        DM_set_only_copy(dm, mask);
                        
                        /* add an origspace layer if needed */
-                       if(((CustomDataMask)curr->link) & CD_MASK_ORIGSPACE)
+                       if(((CustomDataMask)GET_INT_FROM_POINTER(curr->link)) & CD_MASK_ORIGSPACE)
                                if(!CustomData_has_layer(&dm->faceData, CD_ORIGSPACE))
                                        DM_add_face_layer(dm, CD_ORIGSPACE, CD_DEFAULT, NULL);
 
@@ -1847,7 +1847,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
                        }
 
                        /* create an orco derivedmesh in parallel */
-                       mask= (CustomDataMask)curr->link;
+                       mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
                        if(mask & CD_MASK_ORCO) {
                                if(!orcodm)
                                        orcodm= create_orco_dm(ob, ob->data, em);
@@ -1864,9 +1864,9 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
                        }
 
                        /* set the DerivedMesh to only copy needed data */
-                       DM_set_only_copy(dm, (CustomDataMask)curr->link);
+                       DM_set_only_copy(dm, (CustomDataMask)GET_INT_FROM_POINTER(curr->link));
 
-                       if(((CustomDataMask)curr->link) & CD_MASK_ORIGSPACE)
+                       if(((CustomDataMask)GET_INT_FROM_POINTER(curr->link)) & CD_MASK_ORIGSPACE)
                                if(!CustomData_has_layer(&dm->faceData, CD_ORIGSPACE))
                                        DM_add_face_layer(dm, CD_ORIGSPACE, CD_DEFAULT, NULL);
                        
index ef8b922c0b39a8b0fa16546055a00558b4e3cb20..ceac604aacec15f5f342eaca4d5ddba659126cb5 100644 (file)
@@ -310,6 +310,16 @@ void CTX_data_list_add(bContextDataResult *result, void *data)
        BLI_addtail(&result->list, link);
 }
 
+int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*))
+{
+       ListBase list;
+
+       if(func(C, &list))
+               return BLI_countlist(&list);
+       else
+               return 0;
+}
+
 /* data context */
 
 Main *CTX_data_main(const bContext *C)
index f2bcfdb50652940d094e1f1a67d0d14ac0af49c1..9c5d67660baef0e79d116b300889d249e6df451a 100644 (file)
@@ -3329,7 +3329,7 @@ static int read_groupf(char *str)
 }
 
 //XXX error() is now printf until we have a callback error
-#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);printf(errmsg); return;}
+#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);printf("%s", errmsg); return;}
 
 #define read_group(id,str) {id= read_groupf(str); id_test(id);}
 
index ae1247a732758440a226b93f0f04a97b549ce8d1..62c9699aaf91610f9aeb6fc708ba3a588e728cf1 100644 (file)
@@ -8604,7 +8604,7 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask)
 
                if(mti->requiredDataMask) mask = mti->requiredDataMask(md);
 
-               BLI_linklist_prepend(&dataMasks, (void *)mask);
+               BLI_linklist_prepend(&dataMasks, SET_INT_IN_POINTER(mask));
        }
 
        /* build the list of required data masks - each mask in the list must
@@ -8615,14 +8615,14 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask)
        */
        for(curr = dataMasks, prev = NULL; curr; prev = curr, curr = curr->next) {
                if(prev) {
-                       CustomDataMask prev_mask = (CustomDataMask)prev->link;
-                       CustomDataMask curr_mask = (CustomDataMask)curr->link;
+                       CustomDataMask prev_mask = (CustomDataMask)GET_INT_FROM_POINTER(prev->link);
+                       CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
 
-                       curr->link = (void *)(curr_mask | prev_mask);
+                       curr->link = SET_INT_IN_POINTER(curr_mask | prev_mask);
                } else {
-                       CustomDataMask curr_mask = (CustomDataMask)curr->link;
+                       CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
 
-                       curr->link = (void *)(curr_mask | dataMask);
+                       curr->link = SET_INT_IN_POINTER(curr_mask | dataMask);
                }
        }
 
index 89496fda7017ef9c900021b3de6ebbc366ec7925..116fd06994861b64ccc5160ed337e942d915c324 100644 (file)
@@ -245,7 +245,7 @@ void BKE_reports_print(ReportList *reports, ReportType level)
        if (cstring == NULL)
                return;
        
-       printf(cstring);
+       printf("%s", cstring);
        fflush(stdout);
        MEM_freeN(cstring);
 }
index 1967b8a88e2376b34c19ceaeb9abe49e8cf1c127..80cd507520cfc9164bf9e0e69b6045ee615d0ca8 100644 (file)
@@ -253,7 +253,7 @@ int BLI_ghashIterator_isDone(GHashIterator *ghi) {
 /***/
 
 unsigned int BLI_ghashutil_ptrhash(void *key) {
-       return (unsigned int) key;
+       return (unsigned int)(intptr_t)key;
 }
 int BLI_ghashutil_ptrcmp(void *a, void *b) {
        if (a==b)
index 30472beb3e638ff04eb6222f865ca7eeda9a0d31..0f8194362c99a0a2eff726c0be399f758d321f26 100644 (file)
@@ -478,6 +478,7 @@ static void node_join(BVHTree *tree, BVHNode *node)
 /*
  * Debug and information functions
  */
+#if 0
 static void bvhtree_print_tree(BVHTree *tree, BVHNode *node, int depth)
 {
        int i;
@@ -509,6 +510,7 @@ static void bvhtree_info(BVHTree *tree)
 
 //     bvhtree_print_tree(tree, tree->nodes[tree->totleaf], 0);
 }
+#endif
 
 #if 0
 
@@ -1238,7 +1240,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
                int i;
                float nearest[3];
 
-               if(data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1])
+               if(data->proj[ (int)node->main_axis ] <= node->children[0]->bv[(int)node->main_axis*2+1])
                {
 
                        for(i=0; i != node->totnode; i++)
@@ -1267,6 +1269,7 @@ static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node)
 }
 
 
+#if 0
 static void NodeDistance_push_heap(NodeDistance *heap, int heap_size)
 PUSH_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size)
 
@@ -1350,7 +1353,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
        if(heap != default_heap)
                free(heap);
 }
-
+#endif
 
 int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
 {
@@ -1463,7 +1466,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
        else
        {
                //pick loop direction to dive into the tree (based on ray direction and split axis)
-               if(data->ray_dot_axis[ node->main_axis ] > 0.0f)
+               if(data->ray_dot_axis[ (int)node->main_axis ] > 0.0f)
                {
                        for(i=0; i != node->totnode; i++)
                        {
index 4d555a009c591d1e15401feef5f8f64b29afe20e..a21252d9aa8e53e3ec0c3d37953355502728000d 100644 (file)
@@ -4263,6 +4263,7 @@ float lambda_cp_line_ex(float p[3], float l1[3], float l2[3], float cp[3])
        return lambda;
 }
 
+#if 0
 /* little sister we only need to know lambda */
 static float lambda_cp_line(float p[3], float l1[3], float l2[3])
 {
@@ -4271,6 +4272,7 @@ static float lambda_cp_line(float p[3], float l1[3], float l2[3])
        VecSubf(h, p, l1);
        return(Inpf(u,h)/Inpf(u,u));
 }
+#endif
 
 /* Similar to LineIntersectsTriangleUV, except it operates on a quad and in 2d, assumes point is in quad */
 void PointInQuad2DUV(float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv)
@@ -4423,7 +4425,7 @@ int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2])
                Vec2Copyf(v2_3d, v2);
                
                /* Doing this in 3D is not nice */
-               return LineIntersectsTriangle(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, &uv);
+               return LineIntersectsTriangle(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, uv);
 }
 
 /*
@@ -4505,6 +4507,7 @@ but see a 'spat' which is a deformed cube with paired parallel planes needs only
        return 1;
 }
 
+#if 0
 /*adult sister defining the slice planes by the origin and the normal  
 NOTE |normal| may not be 1 but defining the thickness of the slice*/
 static int point_in_slice_as(float p[3],float origin[3],float normal[3])
@@ -4525,6 +4528,7 @@ static int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns
        if (h < 0.0f || h > 1.0f) return 0;
        return 1;
 }
+#endif
 
 
 int point_in_tri_prism(float p[3], float v1[3], float v2[3], float v3[3])
index 54114ad34483fb8f3dcd9abf846924e1bf19e703..32065283bd0e5e57c85dfcf50e33a50c67434674 100644 (file)
@@ -240,10 +240,7 @@ fnmatch (const char *pattern, const char *string, int flags)
 
 #else
 
-static void BLI_FNMATCH_C_IS_EMPTY_FOR_UNIX(void) 
-{
-  /*intentionally empty*/
-}
+/* intentionally empty for UNIX */
 
 #endif /* WIN32 */
 
index 8f35b38379e6c0b83f21f909ee286566b5a363ce..03a565ef0bfffe1eb7b373dd9d4c95ba4dd9fb21 100644 (file)
@@ -465,8 +465,6 @@ int subtreeShape(BNode *node, BArc *rootArc, int include_root)
 
 int BLI_subtreeShape(BGraph *graph, BNode *node, BArc *rootArc, int include_root)
 {
-       BNode *test_node;
-       
        BLI_flagNodes(graph, 0);
        return subtreeShape(node, rootArc, include_root);
 }
index 774e72091c0a01ef786a631080d234c81efd12d1..e0fd5c3749490cd002d217207c2dcb78d21a02cc 100644 (file)
@@ -43,8 +43,6 @@
 #include "BLI_listbase.h"
 
 
-static int add_win32_extension(char *name);
-
 /* implementation */
 
 /* Ripped this from blender.c */
index 666a54b54cc99e20be4d8dbc0e5a210ef466849a..2f96f7b6af1173bf9ed1de26e8bff7099132f2e7 100644 (file)
@@ -219,9 +219,6 @@ int check_file_chars(char *filename)
 
 #else
 
-static void BLI_WINSTUFF_C_IS_EMPTY_FOR_UNIX(void) 
-{
-  /*intentionally empty*/
-}
+/* intentionally empty for UNIX */
 
 #endif
index c0d873ed6b028ebc0963492352c726feea284217..8e5b7ff06ed1697ecc750b734aa7199788165906 100644 (file)
@@ -5366,7 +5366,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                        }
                        case SPACE_FILE:
                        {
-                               SpaceFile *sfile= (SpaceFile *)sl;
+                               // SpaceFile *sfile= (SpaceFile *)sl;
                                ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0;
                                ar->v2d.tot.xmax = ar->winx;
                                ar->v2d.tot.ymax = ar->winy;
index 2cd2db3237ae9c0cfcf691931bc08fb48b2c9c1e..5121932d0ccaa9d533bfd0f7c2b8d73b3032f9f9 100644 (file)
@@ -1416,7 +1416,7 @@ static short incl_v3d_ob_shapekey (bKeyingSet *ks, const char mode[])
        
        /* if ks is shapekey entry (this could be callled for separator before too!) */
        if (ks->flag == -3)
-               sprintf(ks->name, newname);
+               BLI_strncpy(ks->name, newname, sizeof(ks->name));
        
        /* if it gets here, it's ok */
        return 1;
index 54da3901a592c9948703453a39764e7f01b41cba..5548700b2e1fd0a41178f1664bb11b35fbc1450f 100644 (file)
@@ -747,7 +747,7 @@ int join_armature(Scene *scene, View3D *v3d)
                                        joined_armature_fix_links(ob, base->object, pchan, curbone);
                                        
                                        /* Rename pchan */
-                                       sprintf(pchan->name, curbone->name);
+                                       BLI_strncpy(pchan->name, curbone->name, sizeof(pchan->name));
                                        
                                        /* Jump Ship! */
                                        BLI_remlink(curarm->edbo, curbone);
index 783636e3fdd52fa65f1703efa799dc73c0d0d7ec..d69f318aa3f143127e770d93333cea212205d45c 100644 (file)
@@ -4153,7 +4153,7 @@ void createTransNodeData(bContext *C, TransInfo *t)
        TransData *td;
        TransData2D *td2d;
        
-       CTX_DATA_COUNT(C, selected_nodes, t->total)
+       t->total= CTX_DATA_COUNT(C, selected_nodes);
        
        td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransNode TransData");
        td2d = t->data2d = MEM_callocN(t->total*sizeof(TransData2D), "TransNode TransData2D");
index 75516bbf3ae8a28bc9fdd2774ccd6049d054357e..85b7ef0d5e95e352c605ea04906c678cdad9d96b 100644 (file)
@@ -558,7 +558,7 @@ cineonOpen(const char* filename) {
        cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short));
        if (cineon->pixelBuffer == 0) {
                if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
-                               (cineon->width * cineon->depth) * sizeof(unsigned short));
+                               (cineon->width * cineon->depth) * (int)sizeof(unsigned short));
                cineonClose(cineon);
                return 0;
        }
@@ -658,7 +658,7 @@ cineonOpenFromMem(unsigned char *mem, unsigned int size) {
        cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short));
        if (cineon->pixelBuffer == 0) {
                if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
-                               (cineon->width * cineon->depth) * sizeof(unsigned short));
+                               (cineon->width * cineon->depth) * (int)sizeof(unsigned short));
                cineonClose(cineon);
                return 0;
        }
@@ -744,7 +744,7 @@ cineonCreate(const char* filename, int width, int height, int depth) {
        cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short));
        if (cineon->pixelBuffer == 0) {
                if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
-                               (cineon->width * cineon->depth) * sizeof(unsigned short));
+                               (cineon->width * cineon->depth) * (int)sizeof(unsigned short));
                cineonClose(cineon);
                return 0;
        }
index 8a9adc73cdc1a1e010caa767b1d086ac79e91c2f..7314e82a1323025d1384c034ae74962a9b9ffc14 100644 (file)
@@ -240,7 +240,7 @@ dpxGetRowBytes(DpxFile* dpx, unsigned short* row, int y) {
        /* read enough longwords */
        readLongs = pixelsToLongs(numPixels - dpx->pixelBufferUsed);
        if (logimage_fread(dpx->lineBuffer, 4, readLongs, dpx) != readLongs) {
-               if (verbose) d_printf("Couldn't read line %d length %d\n", y, readLongs * 4);
+               if (verbose) d_printf("Couldn't read line %d length %d\n", y, (int)readLongs * 4);
                return 1;
        }
        ++dpx->fileYPos;
@@ -352,7 +352,7 @@ dpxSetRowBytes(DpxFile* dpx, const unsigned short* row, int y) {
 
        /* write them */
        if (fwrite(dpx->lineBuffer, 4, writeLongs, dpx->file) != writeLongs) {
-               if (verbose) d_printf("Couldn't write line %d length %d\n", y, writeLongs * 4);
+               if (verbose) d_printf("Couldn't write line %d length %d\n", y, (int)writeLongs * 4);
                return 1;
        }
        ++dpx->fileYPos;
@@ -462,7 +462,7 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) {
        dpx->pixelBuffer = malloc((dpx->lineBufferLength * 3 + 2) * sizeof(unsigned short));
        if (dpx->pixelBuffer == 0) {
                if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
-                               (dpx->width * dpx->depth + 2 + 2) * sizeof(unsigned short));
+                               (dpx->width * dpx->depth + 2 + 2) * (int)sizeof(unsigned short));
                dpxClose(dpx);
                return 0;
        }
@@ -574,7 +574,7 @@ dpxCreate(const char* filename, int width, int height, int depth) {
        dpx->pixelBuffer = malloc((dpx->lineBufferLength * 3 + 2) * sizeof(unsigned short));
        if (dpx->pixelBuffer == 0) {
                if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
-                               (dpx->width * dpx->depth + 2 + 2) * sizeof(unsigned short));
+                               (dpx->width * dpx->depth + 2 + 2) * (int)sizeof(unsigned short));
                dpxClose(dpx);
                return 0;
        }