diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-12-13 18:06:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-12-13 18:06:02 +0300 |
commit | f15956356c7706c93152f4267cd1cea24b2c9e30 (patch) | |
tree | 0b91608e19ce81285823ba8559cfdc118ee220e8 | |
parent | 6d6f5bbc1a79c2ed2fb8ce84dd4fc23e4763d926 (diff) |
misc warning fixes and one fix for a big in curve allocation
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 5 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_blenlib.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/util.c | 10 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Geometry.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Key.c | 4 | ||||
-rw-r--r-- | source/blender/python/api2_2x/sceneSequence.c | 2 | ||||
-rw-r--r-- | source/blender/src/buttons_object.c | 4 | ||||
-rw-r--r-- | source/blender/src/language.c | 2 | ||||
-rw-r--r-- | source/blender/src/poseobject.c | 2 |
9 files changed, 15 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index c50374388a9..b7f616e1e49 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1480,7 +1480,7 @@ void makeBevelList(Object *ob) while(nu) { if(nu->pntsu<=1) { - bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList"); + bl= MEM_callocN(sizeof(BevList)+1*sizeof(BevPoint), "makeBevelList"); BLI_addtail(&(cu->bev), bl); bl->nr= 0; } else { @@ -1490,8 +1490,7 @@ void makeBevelList(Object *ob) resolu= nu->resolu; if((nu->type & 7)==CU_POLY) { - - len= nu->pntsu; + bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList"); BLI_addtail(&(cu->bev), bl); diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 57248fb1d68..bcb51fa1393 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -368,7 +368,7 @@ void BLI_setInterruptCallBack(int (*f)(void)); char *BLI_strcasestr(const char *s, const char *find); int BLI_strcasecmp(const char *s1, const char *s2); int BLI_strncasecmp(const char *s1, const char *s2, int n); -void BLI_timestr(double time, char *str); +void BLI_timestr(double _time, char *str); /* time var is global */ /** * Trick to address 32 GB with an int (only for malloced pointers) diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index dc2e53483db..7c94cc80847 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1621,13 +1621,13 @@ void BLI_string_to_utf8(char *original, char *utf_8, char *code) } #endif // WITH_ICONV -void BLI_timestr(double time, char *str) +void BLI_timestr(double _time, char *str) { /* format 00:00:00.00 (hr:min:sec) string has to be 12 long */ - int hr= ((int) time) / (60*60); - int min= ( ((int) time) / 60 ) % 60; - int sec= ((int) (time)) % 60; - int hun= ((int) (time * 100.0)) % 100; + int hr= ( (int) _time) / (60*60); + int min= (((int) _time) / 60 ) % 60; + int sec= ( (int) (_time)) % 60; + int hun= ( (int) (_time * 100.0)) % 100; if (hr) { sprintf(str, "%.2d:%.2d:%.2d.%.2d",hr,min,sec,hun); diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c index 344fdcf20a9..842479e35fb 100644 --- a/source/blender/python/api2_2x/Geometry.c +++ b/source/blender/python/api2_2x/Geometry.c @@ -287,7 +287,7 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args VectorObject *pt, *line_1, *line_2; float pt_in[3], pt_out[3], l1[3], l2[3]; float lambda; - PyObject *ret, *val1, *val2; + PyObject *ret; if( !PyArg_ParseTuple ( args, "O!O!O!", &vector_Type, &pt, diff --git a/source/blender/python/api2_2x/Key.c b/source/blender/python/api2_2x/Key.c index 88facd80b4e..90a628152e0 100644 --- a/source/blender/python/api2_2x/Key.c +++ b/source/blender/python/api2_2x/Key.c @@ -41,6 +41,7 @@ #include <BKE_main.h> #include <BKE_curve.h> #include <BKE_library.h> +#include <BKE_utildefines.h> #include "BIF_space.h" #include "Ipocurve.h" @@ -60,9 +61,6 @@ #define KEY_TYPE_CURVE 1 #define KEY_TYPE_LATTICE 2 -/* macro from blenkernel/intern/key.c:98 */ -#define GS(a) (*((short *)(a))) - static int Key_compare( BPy_Key * a, BPy_Key * b ); static PyObject *Key_repr( BPy_Key * self ); static void Key_dealloc( BPy_Key * self ); diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c index c2cd7d090c3..86e36655c28 100644 --- a/source/blender/python/api2_2x/sceneSequence.c +++ b/source/blender/python/api2_2x/sceneSequence.c @@ -536,7 +536,7 @@ static int Sequence_setImages( BPy_Sequence * self, PyObject *value ) Strip *strip; StripElem *se; int i; - PyObject *list, *item; + PyObject *list; char *basepath, *name; if (self->seq->type != SEQ_IMAGE) { diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 8d29e044142..ae259bf6372 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -3438,7 +3438,7 @@ static void sb_clear_cache(void *ob_v, void *actsoft_v) static void object_softbodies(Object *ob) { SoftBody *sb=ob->soft; - ParticleSystem *psys; + ParticleSystem *psys=NULL; uiBlock *block; uiBut *but; static int val; @@ -3471,7 +3471,7 @@ static void object_softbodies(Object *ob) MEM_freeN(menustr); } - if(psys_cur){ + if(psys_cur && psys){ if(*softflag & OB_SB_ENABLE) val=1; else diff --git a/source/blender/src/language.c b/source/blender/src/language.c index c289d75f88b..5eb4bf3dc61 100644 --- a/source/blender/src/language.c +++ b/source/blender/src/language.c @@ -173,8 +173,8 @@ float BIF_GetStringWidth(BMF_Font* font, char *str, int translate) } void BIF_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf *bbox){ - float dummy; #ifdef INTERNATIONAL + float dummy; if(G.ui_international == TRUE) if(translate && (U.transopts & USER_TR_BUTTONS)) FTF_GetBoundingBox(str, &bbox->xmin, &bbox->ymin, &dummy, &bbox->xmax, &bbox->ymax, &dummy, FTF_USE_GETTEXT | FTF_INPUT_UTF8); diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 8add5b3dce9..585ff320b71 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -1154,7 +1154,7 @@ void pose_relax() int do_loc = 0; int do_quat = 0; int flag = 0;*/ - int do_w, do_x, do_y, do_z; + int do_x, do_y, do_z; if (!ob) return; |