From c84b5892e7b11596cdf6728c6a96f204421e4886 Mon Sep 17 00:00:00 2001 From: erg Date: Thu, 8 Oct 2009 21:31:30 +0000 Subject: [PATCH] Clean up warning messages; fix incorrect coding of smyrnaPath, plus remove static arrays. --- cmd/smyrna/glexpose.c | 2 ++ cmd/smyrna/gui/glcompui.c | 20 +++++++++++--------- cmd/smyrna/main.c | 18 +++++++++++++++--- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/cmd/smyrna/glexpose.c b/cmd/smyrna/glexpose.c index 0c28edddd..f5ba4e1b6 100644 --- a/cmd/smyrna/glexpose.c +++ b/cmd/smyrna/glexpose.c @@ -62,10 +62,12 @@ glBegin(GL_QUADS); // Draw The Cube Using quads void drawRotatingAxis(void) { +#ifdef UNUSED float x,y; float x1,y1,z1; float x2,y2,z2; float R1,R2; +#endif static GLUquadricObj *quadratic=(GLUquadricObj*)0; if (!quadratic) { diff --git a/cmd/smyrna/gui/glcompui.c b/cmd/smyrna/gui/glcompui.c index 35162dd36..e28dfcfc7 100644 --- a/cmd/smyrna/gui/glcompui.c +++ b/cmd/smyrna/gui/glcompui.c @@ -11,8 +11,8 @@ #include "viewportcamera.h" -static glCompPanel *controlPanel; -static glCompButton *rotatebutton; +/* static glCompPanel *controlPanel; */ +/* static glCompButton *rotatebutton; */ static glCompPanel* sel=NULL; static glCompButton* to3DBtn; static glCompButton* to2DBtn; @@ -30,10 +30,12 @@ static void menu_click_pan(void* obj,GLfloat x,GLfloat y,glMouseButtonType t) } +#ifdef UNUSED static void menu_click_zoom(void* obj,GLfloat x,GLfloat y,glMouseButtonType t) { switch_Mouse(NULL,MM_ZOOM); } +#endif static void menu_click_fisheye_magnifier(void* obj,GLfloat x,GLfloat y,glMouseButtonType t) { @@ -138,7 +140,7 @@ static void switch2D3D(void* obj,GLfloat x,GLfloat y,glMouseButtonType t) void CBglCompMouseUp (void* obj,GLfloat x,GLfloat y,glMouseButtonType t) { - glCompMouse* m=&((glCompSet*)obj)->mouse; + /* glCompMouse* m=&((glCompSet*)obj)->mouse; */ sel->common.visible=0; sel->common.pos.x=-5000; @@ -176,14 +178,14 @@ void glCompMouseMove (void* obj,GLfloat x,GLfloat y) glCompSet *glcreate_gl_topview_menu(void) { - static char* icondir[512]; - int ind=0; + /* static char* icondir[512]; */ + /* int ind=0; */ GLfloat y=5; GLfloat off=43; glCompSet *s = glCompSetNew(view->w,view->h); glCompPanel *p=NULL; glCompButton *b=NULL; - glCompLabel *l=NULL; + /* glCompLabel *l=NULL; */ glCompImage *i=NULL; glCompColor c; s->common.callbacks.click=CBglCompMouseRightClick; @@ -336,10 +338,10 @@ int getIconsDirectory(char* bf) int a=GetCurrentDirectory(512,bf); if ((a > 512) || (a==0)) return 0; - return 1; #else //code *nix implementation to retrieve the icon directory, possibly some /share dir. - + /* FIXME */ #endif + return 1; -} \ No newline at end of file +} diff --git a/cmd/smyrna/main.c b/cmd/smyrna/main.c index 309782fcc..be44b8fc7 100755 --- a/cmd/smyrna/main.c +++ b/cmd/smyrna/main.c @@ -67,15 +67,27 @@ unsigned char SmyrnaVerbose; char* smyrnaPath (char* suffix) { - static char* buf[1024]; + static int buflen; + static char* buf; + static int baselen; + int slen; #ifdef WIN32 char* pathSep = "\\"; #else char* pathSep = "/"; #endif assert (smyrnaDir); - if ((strlen(smyrnaDir)+strlen(suffix)+ strlen(suffix) + 2) > 512) - return NULL; + + if (!buf) { + baselen = strlen (smyrnaDir) + 2; + buflen = baselen + 100; + buf = N_NEW(buflen,char); + } + slen = strlen (suffix); + if (baselen + slen > buflen) { + buflen = baselen + slen; + buf = realloc (buf, buflen); + } sprintf (buf, "%s%s%s", smyrnaDir, pathSep, suffix); return buf; } -- 2.50.1