From f38e0686d909aa0d2882c197aeff59eeefa17081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Luc=20Peuri=C3=A8re?= Date: Sat, 4 Jun 2005 16:22:50 +0000 Subject: new round of warning fixes. we are now down to 24 with Xcode on blender alone with the following flags : -Wall -Wno-char-subscripts -Wno-missing-braces. the only one still worrying me is in rand.c line 57 : rand.c:57: integer constant is too large for "long" type but i have no clue about how correct cross-compiler and 32/64 bits friendly see also my mail to commiter list for signed/unsigned issues --- extern/qhull/src/geom.c | 4 ++-- extern/qhull/src/io.c | 4 ++-- extern/qhull/src/stat.c | 2 +- source/blender/blenkernel/intern/mball.c | 2 +- source/blender/blenlib/intern/scanfill.c | 2 +- source/blender/blenlib/intern/storage.c | 10 +++++----- source/blender/include/BIF_resources.h | 6 +++--- source/blender/python/BPY_interface.c | 3 +++ source/blender/python/api2_2x/Font.c | 4 ++-- source/blender/python/api2_2x/Text3d.c | 9 ++++++--- source/blender/render/intern/source/envmap.c | 2 +- source/blender/render/intern/source/initrender.c | 4 ++++ source/blender/render/intern/source/pixelshading.c | 2 +- source/blender/render/intern/source/zblur.c | 1 + source/blender/src/buttons_editing.c | 1 + source/blender/src/drawtext.c | 2 +- source/blender/src/drawtime.c | 3 +++ source/blender/src/editsima.c | 6 +++--- source/blender/src/edittime.c | 3 +++ source/blender/src/filesel.c | 3 ++- source/blender/src/transform.c | 4 ++-- source/blender/src/transform_generics.c | 4 ++-- source/gameengine/Ketsji/KX_NearSensor.cpp | 4 ++-- source/gameengine/Ketsji/KX_Scene.cpp | 2 +- source/gameengine/Ketsji/KX_TouchEventManager.cpp | 2 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 4 ++-- 26 files changed, 56 insertions(+), 37 deletions(-) diff --git a/extern/qhull/src/geom.c b/extern/qhull/src/geom.c index b3cf198d510..9d8f5480028 100755 --- a/extern/qhull/src/geom.c +++ b/extern/qhull/src/geom.c @@ -139,7 +139,7 @@ facetT *qh_findbest (pointT *point, facetT *startfacet, realT *dist, boolT *isoutside, int *numpart) { realT bestdist= -REALmax/2 /* avoid underflow */; facetT *facet, *neighbor, **neighborp, *bestfacet= NULL; - facetT *bestfacet_all= startfacet; + // facetT *bestfacet_all= startfacet; int oldtrace= qh IStracing; unsigned int visitid= ++qh visit_id; int numpartnew=0; @@ -409,7 +409,7 @@ facetT *qh_findbesthorizon (boolT ischeckmax, pointT* point, facetT *startfacet, */ facetT *qh_findbestnew (pointT *point, facetT *startfacet, realT *dist, boolT bestoutside, boolT *isoutside, int *numpart) { - realT bestdist= -REALmax/2, minsearch= -REALmax/2; + realT bestdist= -REALmax/2; //, minsearch= -REALmax/2; facetT *bestfacet= NULL, *facet; int oldtrace= qh IStracing, i; unsigned int visitid= ++qh visit_id; diff --git a/extern/qhull/src/io.c b/extern/qhull/src/io.c index 79ca7995d1e..9b0ccdd0b24 100755 --- a/extern/qhull/src/io.c +++ b/extern/qhull/src/io.c @@ -73,8 +73,8 @@ void qh_produce_output(void) { qh_memstatistics (qh ferr); d_1= sizeof(setT) + (qh hull_dim - 1) * SETelemsize; fprintf(qh ferr, "\ - size in bytes: merge %d ridge %d vertex %d facet %d\n\ - normal %d ridge vertices %d facet vertices or neighbors %d\n", + size in bytes: merge %ld ridge %ld vertex %ld facet %ld\n\ + normal %d ridge vertices %d facet vertices or neighbors %ld\n", sizeof(mergeT), sizeof(ridgeT), sizeof(vertexT), sizeof(facetT), qh normal_size, d_1, d_1 + SETelemsize); diff --git a/extern/qhull/src/stat.c b/extern/qhull/src/stat.c index e8d21fe69db..ede0323cb88 100755 --- a/extern/qhull/src/stat.c +++ b/extern/qhull/src/stat.c @@ -458,7 +458,7 @@ void qh_initstatistics (void) { qh_allstatI(); if (qhstat next > sizeof(qhstat id)) { fprintf (qhmem.ferr, "qhull error (qh_initstatistics): increase size of qhstat.id[].\n\ - qhstat.next %d should be <= sizeof(qhstat id) %d\n", qhstat next, sizeof(qhstat id)); + qhstat.next %d should be <= sizeof(qhstat id) %ld\n", qhstat next, sizeof(qhstat id)); #if 0 /* for locating error, Znumridges should be duplicated */ for (i=0; i < ZEND; i++) { int j; diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index c3e6801d957..35dfe5d2dfd 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -1446,7 +1446,7 @@ float init_meta(Object *ob) /* return totsize */ MetaBall *mb; MetaElem *ml; float size, totsize, (*mat)[4] = NULL, (*imat)[4] = NULL, obinv[4][4], vec[3]; - float temp1[4][4], temp2[4][4], temp3[4][4], max=0.0; + float temp1[4][4], temp2[4][4], temp3[4][4]; //max=0.0; int a, obnr; char obname[32]; diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 1f64ffbd79f..66c2e364ea3 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -461,7 +461,7 @@ ScFillVert *addedgetoscanlist(EditEdge *eed, int len) sc= (ScFillVert *)bsearch(&scsearch,scdata,len, sizeof(ScFillVert), vergscdata); - if(sc==0) printf("Error in search edge: %x\n",eed); + if(sc==0) printf("Error in search edge: %lx\n",eed); else if(addedgetoscanvert(sc,eed)==0) return sc; return 0; diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index def44bb69f2..25327c4943e 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -396,14 +396,14 @@ void BLI_adddirstrings() strftime(datum, 32, "%d-%b-%y %R", tm); if (st_size < 1000) { - sprintf(size, "%10d", st_size); + sprintf(size, "%10d", (int) st_size); } else if (st_size < 1000 * 1000) { - sprintf(size, "%6d %03d", st_size / 1000, st_size % 1000); + sprintf(size, "%6d %03d", (int) (st_size / 1000), (int) (st_size % 1000)); } else if (st_size < 100 * 1000 * 1000) { - sprintf(size, "%2d %03d %03d", st_size / (1000 * 1000), (st_size / 1000) % 1000, st_size % 1000); + sprintf(size, "%2d %03d %03d", (int) (st_size / (1000 * 1000)), (int) ((st_size / 1000) % 1000), (int) ( st_size % 1000)); } else { - sprintf(size, "> %4.1f M", st_size / (1024.0 * 1024.0)); - sprintf(size, "%10d", st_size); + sprintf(size, "> %4.1f M", (double) (st_size / (1024.0 * 1024.0))); + sprintf(size, "%10d", (int) st_size); } sprintf(buf,"%s %s %10s %s", files[num].date, files[num].time, size, diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h index 5a01276adbc..2f194a58118 100644 --- a/source/blender/include/BIF_resources.h +++ b/source/blender/include/BIF_resources.h @@ -299,7 +299,7 @@ typedef enum { ICON_CURSOR, ICON_ROTATECOLLECTION, ICON_ROTATECENTER, - ICON_ROTACTIVE, + ICON_ROTACTIVE #define BIFICONID_LAST (ICON_ROTACTIVE) #define BIFNICONIDS (BIFICONID_LAST-BIFICONID_FIRST + 1) @@ -312,7 +312,7 @@ typedef enum { COLORSHADE_MEDIUM, COLORSHADE_HILITE, COLORSHADE_LIGHT, - COLORSHADE_WHITE, + COLORSHADE_WHITE #define BIFCOLORSHADE_LAST (COLORSHADE_WHITE) #define BIFNCOLORSHADES (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1) } BIFColorShade; @@ -365,7 +365,7 @@ typedef enum { EDITVERTSEL, EDITVERTUNSEL, EDITEDGESEL, - EDITEDGEUNSEL, + EDITEDGEUNSEL #define BIFCOLORID_LAST (EDITEDGEUNSEL) #define BIFNCOLORIDS (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1) diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 3306f68ccf8..912a479eef9 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -115,6 +115,9 @@ int BPY_txt_do_python_Text( struct Text *text ); void BPY_Err_Handle( char *script_name ); PyObject *traceback_getFilename( PyObject * tb ); +void BPY_free_screen_spacehandlers(struct bScreen *sc); + + /**************************************************************************** * Description: This function will initialise Python and all the implemented * api variations. diff --git a/source/blender/python/api2_2x/Font.c b/source/blender/python/api2_2x/Font.c index 865285f1e42..6122477a515 100644 --- a/source/blender/python/api2_2x/Font.c +++ b/source/blender/python/api2_2x/Font.c @@ -200,7 +200,7 @@ struct VFont *Font_FromPyObject( PyObject * py_obj ) PyObject *M_Font_New( PyObject * self, PyObject * args ) { char *name_str = ""; - char *parent_str = ""; +// char *parent_str = ""; BPy_Font *py_font = NULL; /* for Font Data object wrapper in Python */ PyObject *tmp; @@ -211,7 +211,7 @@ PyObject *M_Font_New( PyObject * self, PyObject * args ) /*create python font*/ if( !S_ISDIR(BLI_exist(name_str)) ) { tmp= Py_BuildValue("(s)", name_str); - py_font= M_Text3d_LoadFont (self, Py_BuildValue("(s)", name_str)); + py_font= (BPy_Font *) M_Text3d_LoadFont (self, Py_BuildValue("(s)", name_str)); Py_DECREF (tmp); } else diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c index 44e01e8279d..e9a957648fe 100644 --- a/source/blender/python/api2_2x/Text3d.c +++ b/source/blender/python/api2_2x/Text3d.c @@ -905,7 +905,7 @@ static PyObject *Text3d_getFont( BPy_Text3d * self ) static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args ) { BPy_Font *pyobj= NULL; - VFont *vf, *vfont; + VFont *vf; //, *vfont; if( !PyArg_ParseTuple( args, "|O!",&Font_Type, &pyobj) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a string" ); @@ -941,11 +941,14 @@ PyObject *M_Text3d_LoadFont( PyObject * self, PyObject * args ) if( !PyArg_ParseTuple( args, "s", &fontfile ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a string" ); - if( vf= exist_vfont(fontfile) ) + vf= exist_vfont(fontfile); + if( vf ) return Font_CreatePyObject( vf ); /* return EXPP_incr_ret( Py_None ); */ - else + /* No use for that -- lukep + else vf= NULL; + */ file= fopen( fontfile, "r"); if( file || !strcmp (fontfile, "") ) { diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 168fe271f13..33321183e08 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -115,7 +115,7 @@ EnvMap *RE_copy_envmap(EnvMap *env) void RE_free_envmapdata(EnvMap *env) { Image *ima; - int a, part; + unsigned int a, part; for(part=0; part<6; part++) { ima= env->cube[part]; diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 4fd2d6104c9..8729ce42faf 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -114,6 +114,10 @@ char cmask[256], *centmask; Material defmaterial; +/* ------- prototypes ----------- */ +void init_filt_mask(void); + + /* ****************** GAMMA, MASKS and LUTS **************** */ static float calc_weight(float *weight, int i, int j) diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 0071195abce..0af4696eee0 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -89,7 +89,7 @@ static int calcHaloZ(HaloRen *har, int zz) return zz; } -void *renderHaloPixel(RE_COLBUFTYPE *collector, float x, float y, int haloNr) +static void *renderHaloPixel(RE_COLBUFTYPE *collector, float x, float y, int haloNr) { HaloRen *har = NULL; float dist = 0.0; diff --git a/source/blender/render/intern/source/zblur.c b/source/blender/render/intern/source/zblur.c index 67624d97ef4..a1e8304ba75 100644 --- a/source/blender/render/intern/source/zblur.c +++ b/source/blender/render/intern/source/zblur.c @@ -47,6 +47,7 @@ #include "pixelblending.h" #include "blendef.h" +#include "zblur.h" //#include "BIF_gl.h" diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index b5bfffdd0af..49fdf7fad67 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -169,6 +169,7 @@ extern ListBase editNurb; /* *************************** static functions prototypes ****************** */ void validate_editbonebutton(EditBone *); +VFont *exist_vfont(char *str); /* *************************** MESH DECIMATE ******************************** */ diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c index 1cb82581e9f..a6ee39907bb 100644 --- a/source/blender/src/drawtext.c +++ b/source/blender/src/drawtext.c @@ -1378,7 +1378,7 @@ void run_python_script(SpaceText *st) } } -void set_tabs(Text *text) +static void set_tabs(Text *text) { SpaceText *st = curarea->spacedata.first; st->currtab_set = setcurr_tab(text); diff --git a/source/blender/src/drawtime.c b/source/blender/src/drawtime.c index b01a13e9572..a41f9c86ce3 100644 --- a/source/blender/src/drawtime.c +++ b/source/blender/src/drawtime.c @@ -65,6 +65,9 @@ #include "blendef.h" +/* ---- prototypes ------ */ +void drawtimespace(ScrArea *, void *); + static void draw_cfra_time(SpaceTime *stime) { diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index cff2546e6ee..fc6506579ab 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -945,7 +945,7 @@ static int msel_hit(float *limit, unsigned int *hitarray, unsigned int vertexid, return 0; } -void find_nearest_tface(TFace **nearesttf, MFace **nearestmf) +static void find_nearest_tface(TFace **nearesttf, MFace **nearestmf) { Mesh *me; TFace *tf; @@ -987,7 +987,7 @@ void find_nearest_tface(TFace **nearesttf, MFace **nearestmf) } } -int nearest_uv_between(TFace *tf, int nverts, int id, short *mval, short *uval) +static int nearest_uv_between(TFace *tf, int nverts, int id, short *mval, short *uval) { float m[3], v1[3], v2[3], c1, c2; int id1, id2; @@ -1014,7 +1014,7 @@ int nearest_uv_between(TFace *tf, int nverts, int id, short *mval, short *uval) return (c1*c2 >= 0.0f); } -void find_nearest_uv(TFace **nearesttf, unsigned int *nearestv, int *nearestuv) +static void find_nearest_uv(TFace **nearesttf, unsigned int *nearestv, int *nearestuv) { Mesh *me; TFace *tf; diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c index e19771d0fdb..0bb4250c5a4 100644 --- a/source/blender/src/edittime.c +++ b/source/blender/src/edittime.c @@ -79,6 +79,9 @@ #include "PIL_time.h" +/* declarations */ +void winqreadtimespace(ScrArea *, void *, BWinEvent *); + /* ************* Timeline marker code **************** */ /* add TimeMarker at curent frame */ diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index 5e8d2e17b6f..929b8a93228 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -1020,7 +1020,8 @@ static int calc_filesel_line(SpaceFile *sfile, int nr, int *valx, int *valy) static void set_active_file(SpaceFile *sfile, int act) { struct direntry *file; - int num, redraw= 0, newflag; + int num, redraw= 0; + unsigned int newflag; int old=0, newi=0; file= sfile->filelist; diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 74029823204..bc26252007a 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -221,7 +221,7 @@ void checkFirstTime() { memset(&Trans, 0, sizeof(TransInfo)); } -void transformEvent(unsigned short event, short val) { +static void transformEvent(unsigned short event, short val) { float mati[3][3]; char cmode = constraintModeToChar(&Trans); Mat3One(mati); @@ -1052,7 +1052,7 @@ static void TransMat3ToSize( float mat[][3], float smat[][3], float *size) } -void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { +static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { float tmat[3][3], smat[3][3], center[3]; float vec[3]; diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index 6a4fefde029..2171978e336 100755 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -472,7 +472,7 @@ void postTrans (TransInfo *t) } -void apply_grid3(float *val, int max_index, float fac1, float fac2, float fac3) +static void apply_grid3(float *val, int max_index, float fac1, float fac2, float fac3) { /* fac1 is for 'nothing', fac2 for CTRL, fac3 for SHIFT */ int invert = U.flag & USER_AUTOGRABGRID; @@ -541,7 +541,7 @@ static void restore_ipokey(float *poin, float *old) } } -void restoreElement(TransData *td) { +static void restoreElement(TransData *td) { /* TransData for crease has no loc */ if (td->loc) { VECCOPY(td->loc, td->iloc); diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 9f9188ab9a1..bd3a4fc0b37 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -137,7 +137,7 @@ KX_NearSensor::~KX_NearSensor() bool KX_NearSensor::Evaluate(CValue* event) { bool result = false; - KX_GameObject* parent = static_cast(GetParent()); +// KX_GameObject* parent = static_cast(GetParent()); if (m_bTriggered != m_bLastTriggered) { @@ -166,7 +166,7 @@ bool KX_NearSensor::Evaluate(CValue* event) bool KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData * coll_data) { - KX_TouchEventManager* toucheventmgr = static_cast(m_eventmgr); +// KX_TouchEventManager* toucheventmgr = static_cast(m_eventmgr); KX_GameObject* parent = static_cast(GetParent()); // need the mapping from PHY_IPhysicsController to gameobjects now diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 67c056650bb..de2850864f1 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -399,7 +399,7 @@ KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CVal } SG_IObject* replicanode = newobj->GetSGNode(); - SG_Node* rootnode = (replicanode == m_rootnode ? NULL : m_rootnode); +// SG_Node* rootnode = (replicanode == m_rootnode ? NULL : m_rootnode); replicanode->SetSGClientObject(newobj); diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 575ade6dc3b..4c999b0ed69 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -114,7 +114,7 @@ void KX_TouchEventManager::NextFrame() for (std::set::iterator cit = m_newCollisions.begin(); cit != m_newCollisions.end(); ++cit) { PHY_IPhysicsController* ctrl1 = (*cit).first; - PHY_IPhysicsController* ctrl2 = (*cit).second; +// PHY_IPhysicsController* ctrl2 = (*cit).second; // KX_GameObject* gameOb1 = ctrl1->getClientInfo(); // KX_GameObject* gameOb1 = ctrl1->getClientInfo(); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index e89b1e41434..8eaaefe60b4 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -94,7 +94,7 @@ m_bCollision(false), m_bTriggered(false), m_bLastTriggered(false) { - KX_TouchEventManager* touchmgr = (KX_TouchEventManager*) eventmgr; +// KX_TouchEventManager* touchmgr = (KX_TouchEventManager*) eventmgr; // m_resptable = touchmgr->GetResponseTable(); // m_solidHandle = m_sumoObj->getObjectHandle(); @@ -159,7 +159,7 @@ void KX_TouchSensor::RegisterSumo(KX_TouchEventManager *touchman) bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_CollData* colldata) { - KX_TouchEventManager* toucheventmgr = (KX_TouchEventManager*)m_eventmgr; +// KX_TouchEventManager* toucheventmgr = (KX_TouchEventManager*)m_eventmgr; KX_GameObject* parent = (KX_GameObject*)GetParent(); // need the mapping from PHY_IPhysicsController to gameobjects now -- cgit v1.2.3