Fix some warnings
authorAlan Hourihane <alanh@tungstengraphics.com>
Thu, 2 Dec 2004 13:29:40 +0000 (13:29 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Thu, 2 Dec 2004 13:29:40 +0000 (13:29 +0000)
src/mesa/drivers/dri/common/xmlconfig.c
src/mesa/drivers/x11/glxapi.c
src/mesa/main/teximage.c
src/mesa/shader/program.c
src/mesa/swrast/s_alphabuf.c
src/mesa/swrast/s_linetemp.h
src/mesa/swrast/s_texture.c
src/mesa/tnl/t_vb_lighttmp.h

index 8eb82a8..b635894 100644 (file)
 #undef GET_PROGRAM_NAME
 
 #if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
+#    if !defined(__GLIBC__) || (__GLIBC__ < 2)
+/* These aren't declared in any libc5 header */
+extern char *program_invocation_name, *program_invocation_short_name;
+#    endif
 #    define GET_PROGRAM_NAME() program_invocation_short_name
 #elif defined(__FreeBSD__) && (__FreeBSD__ >= 2)
 #    include <osreldate.h>
@@ -256,7 +260,7 @@ static GLfloat strToF (const XML_Char *string, const XML_Char **tail) {
     string = numStart;
 
     /* scale of the first digit */
-    scale = sign * powf (10.0f, (GLfloat)(pointPos-1 + exponent));
+    scale = sign * (GLfloat)pow (10.0, (GLdouble)(pointPos-1 + exponent));
 
     /* second pass: parse digits */
     do {
index ae221d1..d333587 100644 (file)
@@ -162,9 +162,12 @@ XVisualInfo PUBLIC *
 glXChooseVisual(Display *dpy, int screen, int *list)
 {
    struct _glxapi_table *t;
+printf("1\n");
    GET_DISPATCH(dpy, t);
+printf("2\n");
    if (!t)
       return NULL;
+printf("3\n");
    return (t->ChooseVisual)(dpy, screen, list);
 }
 
index f35b236..4dff275 100644 (file)
@@ -886,11 +886,9 @@ _mesa_max_texture_levels(GLcontext *ctx, GLenum target)
    case GL_TEXTURE_CUBE_MAP_ARB:
    case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
       return ctx->Const.MaxCubeTextureLevels;
-      break;
    case GL_TEXTURE_RECTANGLE_NV:
    case GL_PROXY_TEXTURE_RECTANGLE_NV:
       return 1;
-      break;
    default:
       return 0; /* bad target */
    }
index 88085f8..c2f4b14 100644 (file)
@@ -541,8 +541,7 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
             _mesa_problem(ctx, "Invalid material state in fetch_state");
             return;
          }
-      };
-      return;
+      }
    case STATE_LIGHT:
       {
          /* state[1] is the light number */
@@ -590,7 +589,6 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
             return;
          }
       }
-      return;
    case STATE_LIGHTMODEL_AMBIENT:
       COPY_4V(value, ctx->Light.Model.Ambient);
       return;
@@ -650,7 +648,6 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
                return;
          }
       }
-      return;
    case STATE_TEXGEN:
       {
          /* state[1] is the texture unit */
@@ -686,7 +683,6 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
             return;
          }
       }
-      return;
    case STATE_TEXENV_COLOR:
       {                
          /* state[1] is the texture unit */
index 736ff2d..5d8107c 100644 (file)
@@ -178,16 +178,12 @@ GLchan *get_alpha_buffer( GLcontext *ctx )
    switch (swrast->CurrentBufferBit) {
    case DD_FRONT_LEFT_BIT:
       return ctx->DrawBuffer->FrontLeftAlpha;
-      break;
    case DD_BACK_LEFT_BIT:
       return ctx->DrawBuffer->BackLeftAlpha;
-      break;
    case DD_FRONT_RIGHT_BIT:
       return ctx->DrawBuffer->FrontRightAlpha;
-      break;
    case DD_BACK_RIGHT_BIT:
       return ctx->DrawBuffer->BackRightAlpha;
-      break;
    default:
       _mesa_problem(ctx, "Bad CurrentBuffer in get_alpha_buffer()");
       return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
index 77c9854..5d9591d 100644 (file)
@@ -425,6 +425,8 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
    RENDER_SPAN( span );
 #endif
 
+   (void)span;
+
 }
 
 
index 4cb84d1..2139716 100644 (file)
@@ -2727,7 +2727,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
             ASSERT(t->MinFilter == GL_NEAREST);
             return &sample_nearest_1d;
          }
-         break;
       case GL_TEXTURE_2D:
          if (format == GL_DEPTH_COMPONENT) {
             return &sample_depth_texture;
@@ -2759,7 +2758,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
                return &sample_nearest_2d;
             }
          }
-         break;
       case GL_TEXTURE_3D:
          if (needLambda) {
             return &sample_lambda_3d;
@@ -2771,7 +2769,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
             ASSERT(t->MinFilter == GL_NEAREST);
             return &sample_nearest_3d;
          }
-         break;
       case GL_TEXTURE_CUBE_MAP:
          if (needLambda) {
             return &sample_lambda_cube;
@@ -2783,7 +2780,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
             ASSERT(t->MinFilter == GL_NEAREST);
             return &sample_nearest_cube;
          }
-         break;
       case GL_TEXTURE_RECTANGLE_NV:
          if (needLambda) {
             return &sample_lambda_rect;
@@ -2795,7 +2791,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
             ASSERT(t->MinFilter == GL_NEAREST);
             return &sample_nearest_rect;
          }
-         break;
       default:
          _mesa_problem(ctx,
                        "invalid target in _swrast_choose_texture_sample_func");
index 2eaf61f..3226585 100644 (file)
@@ -36,7 +36,7 @@
 
 
 /* define TRACE to trace lighting code */
-/* #define TRACE 1 */
+#define TRACE 1
 
 /*
  * ctx is the current context
@@ -253,8 +253,9 @@ static void TAG(light_rgba)( GLcontext *ctx,
    const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
 
    GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
+#if IDX & LIGHT_TWOSIDE
    GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
-   GLfloat (*color[2])[4];
+#endif
 
    const GLuint nr = VB->Count;
 
@@ -265,9 +266,6 @@ static void TAG(light_rgba)( GLcontext *ctx,
    (void) nstride;
    (void) vstride;
 
-   color[0] = Fcolor;
-   color[1] = Bcolor;
-
    VB->ColorPtr[0] = &store->LitColor[0];
    sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];