Fix some warnings
This commit is contained in:
@@ -49,6 +49,10 @@
|
|||||||
#undef GET_PROGRAM_NAME
|
#undef GET_PROGRAM_NAME
|
||||||
|
|
||||||
#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
|
#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
|
# define GET_PROGRAM_NAME() program_invocation_short_name
|
||||||
#elif defined(__FreeBSD__) && (__FreeBSD__ >= 2)
|
#elif defined(__FreeBSD__) && (__FreeBSD__ >= 2)
|
||||||
# include <osreldate.h>
|
# include <osreldate.h>
|
||||||
@@ -256,7 +260,7 @@ static GLfloat strToF (const XML_Char *string, const XML_Char **tail) {
|
|||||||
string = numStart;
|
string = numStart;
|
||||||
|
|
||||||
/* scale of the first digit */
|
/* 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 */
|
/* second pass: parse digits */
|
||||||
do {
|
do {
|
||||||
|
@@ -162,9 +162,12 @@ XVisualInfo PUBLIC *
|
|||||||
glXChooseVisual(Display *dpy, int screen, int *list)
|
glXChooseVisual(Display *dpy, int screen, int *list)
|
||||||
{
|
{
|
||||||
struct _glxapi_table *t;
|
struct _glxapi_table *t;
|
||||||
|
printf("1\n");
|
||||||
GET_DISPATCH(dpy, t);
|
GET_DISPATCH(dpy, t);
|
||||||
|
printf("2\n");
|
||||||
if (!t)
|
if (!t)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
printf("3\n");
|
||||||
return (t->ChooseVisual)(dpy, screen, list);
|
return (t->ChooseVisual)(dpy, screen, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -886,11 +886,9 @@ _mesa_max_texture_levels(GLcontext *ctx, GLenum target)
|
|||||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||||
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
|
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
|
||||||
return ctx->Const.MaxCubeTextureLevels;
|
return ctx->Const.MaxCubeTextureLevels;
|
||||||
break;
|
|
||||||
case GL_TEXTURE_RECTANGLE_NV:
|
case GL_TEXTURE_RECTANGLE_NV:
|
||||||
case GL_PROXY_TEXTURE_RECTANGLE_NV:
|
case GL_PROXY_TEXTURE_RECTANGLE_NV:
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return 0; /* bad target */
|
return 0; /* bad target */
|
||||||
}
|
}
|
||||||
|
@@ -541,8 +541,7 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
|
|||||||
_mesa_problem(ctx, "Invalid material state in fetch_state");
|
_mesa_problem(ctx, "Invalid material state in fetch_state");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
return;
|
|
||||||
case STATE_LIGHT:
|
case STATE_LIGHT:
|
||||||
{
|
{
|
||||||
/* state[1] is the light number */
|
/* state[1] is the light number */
|
||||||
@@ -590,7 +589,6 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
case STATE_LIGHTMODEL_AMBIENT:
|
case STATE_LIGHTMODEL_AMBIENT:
|
||||||
COPY_4V(value, ctx->Light.Model.Ambient);
|
COPY_4V(value, ctx->Light.Model.Ambient);
|
||||||
return;
|
return;
|
||||||
@@ -650,7 +648,6 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
case STATE_TEXGEN:
|
case STATE_TEXGEN:
|
||||||
{
|
{
|
||||||
/* state[1] is the texture unit */
|
/* state[1] is the texture unit */
|
||||||
@@ -686,7 +683,6 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
case STATE_TEXENV_COLOR:
|
case STATE_TEXENV_COLOR:
|
||||||
{
|
{
|
||||||
/* state[1] is the texture unit */
|
/* state[1] is the texture unit */
|
||||||
|
@@ -178,16 +178,12 @@ GLchan *get_alpha_buffer( GLcontext *ctx )
|
|||||||
switch (swrast->CurrentBufferBit) {
|
switch (swrast->CurrentBufferBit) {
|
||||||
case DD_FRONT_LEFT_BIT:
|
case DD_FRONT_LEFT_BIT:
|
||||||
return ctx->DrawBuffer->FrontLeftAlpha;
|
return ctx->DrawBuffer->FrontLeftAlpha;
|
||||||
break;
|
|
||||||
case DD_BACK_LEFT_BIT:
|
case DD_BACK_LEFT_BIT:
|
||||||
return ctx->DrawBuffer->BackLeftAlpha;
|
return ctx->DrawBuffer->BackLeftAlpha;
|
||||||
break;
|
|
||||||
case DD_FRONT_RIGHT_BIT:
|
case DD_FRONT_RIGHT_BIT:
|
||||||
return ctx->DrawBuffer->FrontRightAlpha;
|
return ctx->DrawBuffer->FrontRightAlpha;
|
||||||
break;
|
|
||||||
case DD_BACK_RIGHT_BIT:
|
case DD_BACK_RIGHT_BIT:
|
||||||
return ctx->DrawBuffer->BackRightAlpha;
|
return ctx->DrawBuffer->BackRightAlpha;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
_mesa_problem(ctx, "Bad CurrentBuffer in get_alpha_buffer()");
|
_mesa_problem(ctx, "Bad CurrentBuffer in get_alpha_buffer()");
|
||||||
return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
|
return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
|
||||||
|
@@ -425,6 +425,8 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
|
|||||||
RENDER_SPAN( span );
|
RENDER_SPAN( span );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
(void)span;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2727,7 +2727,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
|
|||||||
ASSERT(t->MinFilter == GL_NEAREST);
|
ASSERT(t->MinFilter == GL_NEAREST);
|
||||||
return &sample_nearest_1d;
|
return &sample_nearest_1d;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case GL_TEXTURE_2D:
|
case GL_TEXTURE_2D:
|
||||||
if (format == GL_DEPTH_COMPONENT) {
|
if (format == GL_DEPTH_COMPONENT) {
|
||||||
return &sample_depth_texture;
|
return &sample_depth_texture;
|
||||||
@@ -2759,7 +2758,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
|
|||||||
return &sample_nearest_2d;
|
return &sample_nearest_2d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case GL_TEXTURE_3D:
|
case GL_TEXTURE_3D:
|
||||||
if (needLambda) {
|
if (needLambda) {
|
||||||
return &sample_lambda_3d;
|
return &sample_lambda_3d;
|
||||||
@@ -2771,7 +2769,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
|
|||||||
ASSERT(t->MinFilter == GL_NEAREST);
|
ASSERT(t->MinFilter == GL_NEAREST);
|
||||||
return &sample_nearest_3d;
|
return &sample_nearest_3d;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case GL_TEXTURE_CUBE_MAP:
|
case GL_TEXTURE_CUBE_MAP:
|
||||||
if (needLambda) {
|
if (needLambda) {
|
||||||
return &sample_lambda_cube;
|
return &sample_lambda_cube;
|
||||||
@@ -2783,7 +2780,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
|
|||||||
ASSERT(t->MinFilter == GL_NEAREST);
|
ASSERT(t->MinFilter == GL_NEAREST);
|
||||||
return &sample_nearest_cube;
|
return &sample_nearest_cube;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case GL_TEXTURE_RECTANGLE_NV:
|
case GL_TEXTURE_RECTANGLE_NV:
|
||||||
if (needLambda) {
|
if (needLambda) {
|
||||||
return &sample_lambda_rect;
|
return &sample_lambda_rect;
|
||||||
@@ -2795,7 +2791,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
|
|||||||
ASSERT(t->MinFilter == GL_NEAREST);
|
ASSERT(t->MinFilter == GL_NEAREST);
|
||||||
return &sample_nearest_rect;
|
return &sample_nearest_rect;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
_mesa_problem(ctx,
|
_mesa_problem(ctx,
|
||||||
"invalid target in _swrast_choose_texture_sample_func");
|
"invalid target in _swrast_choose_texture_sample_func");
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* define TRACE to trace lighting code */
|
/* define TRACE to trace lighting code */
|
||||||
/* #define TRACE 1 */
|
#define TRACE 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ctx is the current context
|
* ctx is the current context
|
||||||
@@ -253,8 +253,9 @@ static void TAG(light_rgba)( GLcontext *ctx,
|
|||||||
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
|
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
|
||||||
|
|
||||||
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
||||||
|
#if IDX & LIGHT_TWOSIDE
|
||||||
GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
|
GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
|
||||||
GLfloat (*color[2])[4];
|
#endif
|
||||||
|
|
||||||
const GLuint nr = VB->Count;
|
const GLuint nr = VB->Count;
|
||||||
|
|
||||||
@@ -265,9 +266,6 @@ static void TAG(light_rgba)( GLcontext *ctx,
|
|||||||
(void) nstride;
|
(void) nstride;
|
||||||
(void) vstride;
|
(void) vstride;
|
||||||
|
|
||||||
color[0] = Fcolor;
|
|
||||||
color[1] = Bcolor;
|
|
||||||
|
|
||||||
VB->ColorPtr[0] = &store->LitColor[0];
|
VB->ColorPtr[0] = &store->LitColor[0];
|
||||||
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
|
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user