]> granicus.if.org Git - graphviz/commitdiff
lib/glcomp: remove unnecessary 'static' from some variables
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 21 Mar 2022 04:35:20 +0000 (21:35 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Mar 2022 05:31:13 +0000 (22:31 -0700)
These are unconditionally overwritten during their respective functions before
they are ever read.

lib/glcomp/glcompfont.c
lib/glcomp/glutils.c

index b881bc3654e18ae7b7b7d39043e077774c6967cb..5c4a00378c7d24a0aac85fa8e47c7af2b60a0b59 100644 (file)
@@ -149,13 +149,12 @@ void glCompDrawText(glCompFont * f,GLfloat x,GLfloat y)
 /*text rendering functions, depends on a globject to retrieve stats*/
 void glCompRenderText(glCompFont * f, glCompObj * parentObj)
 {
-    static glCompCommon ref;
     GLfloat x, y;
     if (!f->tex)
        return;
     x = 0;
     y = 0;
-    ref = parentObj->common;
+    glCompCommon ref = parentObj->common;
     switch (f->justify.HJustify) 
     {
     case glFontHJustifyNone:
index 90a22f0f71bb68b57a081b0537ca852ccdc72d91..4d847be5e3b5205ab864168889c44955c017354d 100644 (file)
@@ -110,7 +110,6 @@ void to3D(int x, int y, GLfloat * X, GLfloat * Y, GLfloat * Z)
     GLfloat winZ[400];
     GLdouble posX, posY, posZ;
     int idx;
-    static float comp;
 
     glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
     glGetDoublev(GL_PROJECTION_MATRIX, projection);
@@ -121,7 +120,7 @@ void to3D(int x, int y, GLfloat * X, GLfloat * Y, GLfloat * Z)
 
     glReadPixels(x - WIDTH / 2, (int) winY - WIDTH / 2, WIDTH, WIDTH,
                 GL_DEPTH_COMPONENT, GL_FLOAT, &winZ);
-    comp = -9999999;
+    float comp = -9999999;
     for (idx = 0; idx < WIDTH * WIDTH; idx++) {
        if (winZ[idx] > comp && winZ[idx] < 1)
            comp = winZ[idx];
@@ -322,8 +321,8 @@ void glCompDrawRectangle(glCompRect * r)
 void glCompDrawRectPrism(glCompPoint * p, GLfloat w, GLfloat h, GLfloat b,
                         GLfloat d, glCompColor * c, int bumped)
 {
-    static GLfloat color_fac;
-    static glCompPoint A, B, C, D, E, F, G, H;
+    GLfloat color_fac;
+    glCompPoint A, B, C, D, E, F, G, H;
     GLfloat dim = 1.00;
     if (!bumped) {
        color_fac = (GLfloat) 1.3;