]> granicus.if.org Git - graphviz/commitdiff
Clean up warning messages; fix incorrect coding of smyrnaPath, plus remove static...
authorerg <devnull@localhost>
Thu, 8 Oct 2009 21:31:30 +0000 (21:31 +0000)
committererg <devnull@localhost>
Thu, 8 Oct 2009 21:31:30 +0000 (21:31 +0000)
cmd/smyrna/glexpose.c
cmd/smyrna/gui/glcompui.c
cmd/smyrna/main.c

index 0c28edddd8917133f77ec2fcbdff84aece20b654..f5ba4e1b6df69ce110c251b4b8ada30782664e5d 100644 (file)
@@ -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)
        {
index 35162dd36764ece863dd3166bf68c93694c49b55..e28dfcfc748ed99ce0d1fdc2e5b1e8e0196cf0bd 100644 (file)
@@ -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
+}
index 309782fccaedb1015aa0781182f74aa405d04fe5..be44b8fc70e6a696c41aedd6f6eebec314cac61f 100755 (executable)
@@ -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;
 }