From 9bcdb4b758d96d1fe5345858f6c61a90f7c57eac Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 17 Jan 2009 00:51:42 +0000 Subject: 2.5: various warning fixes. --- intern/SoundSystem/SND_Utils.h | 4 ++-- intern/SoundSystem/intern/SND_Utils.cpp | 4 ++-- intern/decimation/intern/LOD_ExternNormalEditor.cpp | 4 ++-- intern/decimation/intern/LOD_ManMesh2.cpp | 2 +- intern/decimation/intern/LOD_QSDecimator.cpp | 6 +++--- intern/elbeem/intern/solver_init.cpp | 2 +- intern/ghost/intern/GHOST_WindowX11.cpp | 17 ++++++++--------- intern/iksolver/intern/IK_Solver.cpp | 6 ++++-- intern/opennl/superlu/util.c | 2 +- source/blender/blenkernel/BKE_context.h | 8 ++++---- source/blender/blenkernel/intern/DerivedMesh.c | 10 +++++----- source/blender/blenkernel/intern/context.c | 10 ++++++++++ source/blender/blenkernel/intern/exotic.c | 2 +- source/blender/blenkernel/intern/modifier.c | 12 ++++++------ source/blender/blenkernel/intern/report.c | 2 +- source/blender/blenlib/intern/BLI_ghash.c | 2 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 9 ++++++--- source/blender/blenlib/intern/arithb.c | 6 +++++- source/blender/blenlib/intern/fnmatch.c | 5 +---- source/blender/blenlib/intern/graph.c | 2 -- source/blender/blenlib/intern/listbase.c | 2 -- source/blender/blenlib/intern/winstuff.c | 5 +---- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/editors/animation/keyframing.c | 2 +- source/blender/editors/armature/editarmature.c | 2 +- .../blender/editors/transform/transform_conversions.c | 2 +- source/blender/imbuf/intern/cineon/cineonlib.c | 6 +++--- source/blender/imbuf/intern/cineon/dpxlib.c | 8 ++++---- 28 files changed, 76 insertions(+), 68 deletions(-) diff --git a/intern/SoundSystem/SND_Utils.h b/intern/SoundSystem/SND_Utils.h index 26cf1bda11c..82b7c69a595 100644 --- a/intern/SoundSystem/SND_Utils.h +++ b/intern/SoundSystem/SND_Utils.h @@ -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); diff --git a/intern/SoundSystem/intern/SND_Utils.cpp b/intern/SoundSystem/intern/SND_Utils.cpp index 26ce106a24e..a9239576c96 100644 --- a/intern/SoundSystem/intern/SND_Utils.cpp +++ b/intern/SoundSystem/intern/SND_Utils.cpp @@ -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; diff --git a/intern/decimation/intern/LOD_ExternNormalEditor.cpp b/intern/decimation/intern/LOD_ExternNormalEditor.cpp index b7c7b5a529b..21fd4f3e39f 100644 --- a/intern/decimation/intern/LOD_ExternNormalEditor.cpp +++ b/intern/decimation/intern/LOD_ExternNormalEditor.cpp @@ -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) { } diff --git a/intern/decimation/intern/LOD_ManMesh2.cpp b/intern/decimation/intern/LOD_ManMesh2.cpp index 2fe49b36583..99f1c7d926a 100644 --- a/intern/decimation/intern/LOD_ManMesh2.cpp +++ b/intern/decimation/intern/LOD_ManMesh2.cpp @@ -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.!!!!! diff --git a/intern/decimation/intern/LOD_QSDecimator.cpp b/intern/decimation/intern/LOD_QSDecimator.cpp index 1a0ec87f05b..0b0de767a9a 100644 --- a/intern/decimation/intern/LOD_QSDecimator.cpp +++ b/intern/decimation/intern/LOD_QSDecimator.cpp @@ -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; } } diff --git a/intern/elbeem/intern/solver_init.cpp b/intern/elbeem/intern/solver_init.cpp index 270531d80be..ce54adb48ee 100644 --- a/intern/elbeem/intern/solver_init.cpp +++ b/intern/elbeem/intern/solver_init.cpp @@ -1401,7 +1401,7 @@ void LbmFsgrSolver::initMovingObstacles(bool staticInit) { debMsgStd("LbmFsgrSolver::initMovingObstacles",DM_MSG," obj "<getName()<<" skip:"<getIsAnimated()<<" gid:"<getGeoInitId()<<" simgid:"<getGeoInitType()&FGI_ALLBOUNDS) || - (obj->getGeoInitType()&FGI_FLUID) && staticInit ) { + ((obj->getGeoInitType()&FGI_FLUID) && staticInit) ) { otype = ntype = CFInvalid; switch(obj->getGeoInitType()) { diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 34ce0409d53..2cc30aaa5bc 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -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) diff --git a/intern/iksolver/intern/IK_Solver.cpp b/intern/iksolver/intern/IK_Solver.cpp index 9de937ea4b2..9eec1c38a2d 100644 --- a/intern/iksolver/intern/IK_Solver.cpp +++ b/intern/iksolver/intern/IK_Solver.cpp @@ -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; diff --git a/intern/opennl/superlu/util.c b/intern/opennl/superlu/util.c index 824cabacee5..f77da9c4736 100644 --- a/intern/opennl/superlu/util.c +++ b/intern/opennl/superlu/util.c @@ -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); } diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index d6efc1288ec..d9988abdaab 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -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 */ diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 063a0e4a31f..2ecc8cb1754 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index ef8b922c0b3..ceac604aace 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -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) diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index f2bcfdb5065..9c5d67660ba 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -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);} diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index ae1247a7327..62c9699aaf9 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -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); } } diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index 89496fda701..116fd069948 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -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); } diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 1967b8a88e2..80cd507520c 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -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) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 30472beb3e6..0f8194362c9 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -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++) { diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 4d555a009c5..a21252d9aa8 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -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]) diff --git a/source/blender/blenlib/intern/fnmatch.c b/source/blender/blenlib/intern/fnmatch.c index 54114ad3448..32065283bd0 100644 --- a/source/blender/blenlib/intern/fnmatch.c +++ b/source/blender/blenlib/intern/fnmatch.c @@ -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 */ diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c index 8f35b38379e..03a565ef0bf 100644 --- a/source/blender/blenlib/intern/graph.c +++ b/source/blender/blenlib/intern/graph.c @@ -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); } diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 774e72091c0..e0fd5c37494 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -43,8 +43,6 @@ #include "BLI_listbase.h" -static int add_win32_extension(char *name); - /* implementation */ /* Ripped this from blender.c */ diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 666a54b54cc..2f96f7b6af1 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -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 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c0d873ed6b0..8e5b7ff06ed 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 2cd2db3237a..5121932d0cc 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -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; diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 54da3901a59..5548700b2e1 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -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); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 783636e3fdd..d69f318aa3f 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -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"); diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index 75516bbf3ae..85b7ef0d5e9 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -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; } diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index 8a9adc73cdc..7314e82a132 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -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; } -- cgit v1.2.3