fixed more warnings

This commit is contained in:
Pawel Kolodziejski 2005-01-13 00:15:15 +00:00
parent 5a0c809972
commit c0f8811e01
13 changed files with 50 additions and 50 deletions

View file

@ -1422,7 +1422,7 @@ static void SetAmbientLight() {
}
static void EngineDisplay() {
/*bool mode = */check_int(1) != 0;
/*bool mode = check_int(1) != 0;*/
// it enable/disable updating display
}

View file

@ -325,7 +325,7 @@ void lua_pushnil (void)
void lua_pushnumber (double n)
{
ttype(L->stack.top) = LUA_T_NUMBER;
nvalue(L->stack.top) = n;
nvalue(L->stack.top) = (real)n;
incr_top;
}

View file

@ -428,7 +428,7 @@ int luaX_lex (LexState *LS) {
ea *= ea;
}
}
LS->seminfo.r = a;
LS->seminfo.r = (real)a;
return NUMBER;
}

View file

@ -284,7 +284,7 @@ void luaV_pack (StkId firstel, int nvararg, TObject *tab)
for (i=0; i<nvararg; i++) {
TObject index;
ttype(&index) = LUA_T_NUMBER;
nvalue(&index) = i+1;
nvalue(&index) = (real)i+1;
*(luaH_set(avalue(tab), &index)) = *(firstelem+i);
}
/* store counter in field "n" */ {
@ -292,7 +292,7 @@ void luaV_pack (StkId firstel, int nvararg, TObject *tab)
ttype(&index) = LUA_T_STRING;
tsvalue(&index) = luaS_new("n");
ttype(&extra) = LUA_T_NUMBER;
nvalue(&extra) = nvararg;
nvalue(&extra) = (real)nvararg;
*(luaH_set(avalue(tab), &index)) = extra;
}
}
@ -346,7 +346,7 @@ StkId luaV_execute (struct CallInfo *ci)
aux -= PUSHNUMBER0;
pushnumber:
ttype(S->top) = LUA_T_NUMBER;
nvalue(S->top) = aux;
nvalue(S->top) = (real)aux;
S->top++;
break;
@ -475,7 +475,7 @@ StkId luaV_execute (struct CallInfo *ci)
TObject *arr = S->top-n-1;
for (; n; n--) {
ttype(S->top) = LUA_T_NUMBER;
nvalue(S->top) = n+aux;
nvalue(S->top) = (real)(n+aux);
*(luaH_set(avalue(arr), S->top)) = *(S->top-1);
S->top--;
}

View file

@ -357,12 +357,12 @@ void tglFrustum(double left,double right,double bottom,double top,
TGLParam p[7];
p[0].op=OP_Frustum;
p[1].f=left;
p[2].f=right;
p[3].f=bottom;
p[4].f=top;
p[5].f=near;
p[6].f=farv;
p[1].f=(float)left;
p[2].f=(float)right;
p[3].f=(float)bottom;
p[4].f=(float)top;
p[5].f=(float)near;
p[6].f=(float)farv;
gl_add_op(p);
}
@ -496,7 +496,7 @@ void tglClearDepth(double depth)
TGLParam p[2];
p[0].op=OP_ClearDepth;
p[1].f=depth;
p[1].f=(float)depth;
gl_add_op(p);
}

View file

@ -15,7 +15,7 @@ void gl_transform_to_viewport(GLContext *c,GLVertex *v)
float winv;
/* coordinates */
winv=1.0/v->pc.W;
winv=(float)(1.0/v->pc.W);
v->zp.x= (int) ( v->pc.X * winv * c->viewport.scale.X
+ c->viewport.trans.X );
v->zp.y= (int) ( v->pc.Y * winv * c->viewport.scale.Y

View file

@ -80,7 +80,7 @@ void tglInit(void *zbuffer1)
l->enabled=0;
}
c->first_light=NULL;
c->ambient_light_model=gl_V4_New(0.2,0.2,0.2,1);
c->ambient_light_model=gl_V4_New(0.2f,0.2f,0.2f,1);
c->local_light_model=0;
c->lighting_enabled=0;
c->light_model_two_side = 0;
@ -89,8 +89,8 @@ void tglInit(void *zbuffer1)
for(i=0;i<2;i++) {
GLMaterial *m=&c->materials[i];
m->emission=gl_V4_New(0,0,0,1);
m->ambient=gl_V4_New(0.2,0.2,0.2,1);
m->diffuse=gl_V4_New(0.8,0.8,0.8,1);
m->ambient=gl_V4_New(0.2f,0.2f,0.2f,1);
m->diffuse=(gl_V4_New(0.8f,0.8f,0.8f,1));
m->specular=gl_V4_New(0,0,0,1);
m->shininess=0;
}

View file

@ -113,7 +113,7 @@ void glopLight(GLContext *c,TGLParam *p)
float a=v.v[0];
assert(a == 180 || (a>=0 && a<=90));
l->spot_cutoff=a;
if (a != 180) l->cos_spot_cutoff=cos(a * PI / 180.0);
if (a != 180) l->cos_spot_cutoff=(float)(cos(a * PI / 180.0));
}
break;
case TGL_CONSTANT_ATTENUATION:
@ -268,7 +268,7 @@ void gl_shade_vertex(GLContext *c,GLVertex *v)
} else {
s.X=d.X;
s.Y=d.Y;
s.Z=d.Z+1.0;
s.Z=(float)(d.Z+1.0);
}
dot_spec=n.X*s.X+n.Y*s.Y+n.Z*s.Z;
if (twoside && dot_spec < 0) dot_spec = -dot_spec;

View file

@ -116,7 +116,7 @@ void glopRotate(GLContext *c,TGLParam *p)
float angle;
int dir_code;
angle = p[1].f * PI / 180.0;
angle = (float)(p[1].f * PI / 180.0);
u[0]=p[2].f;
u[1]=p[3].f;
u[2]=p[4].f;
@ -221,12 +221,12 @@ void glopFrustum(GLContext *c,TGLParam *p)
float farp=p[6].f;
float x,y,A,B,C,D;
x = (2.0*near) / (right-left);
y = (2.0*near) / (top-bottom);
x = (float)((2.0*near) / (right-left));
y = (float)((2.0*near) / (top-bottom));
A = (right+left) / (right-left);
B = (top+bottom) / (top-bottom);
C = -(farp+near) / ( farp-near);
D = -(2.0*farp*near) / (farp-near);
D = (float)(-(2.0*farp*near) / (farp-near));
r=&m.m[0][0];
r[0]= x; r[1]=0; r[2]=A; r[3]=0;

View file

@ -60,13 +60,13 @@ void gl_eval_viewport(GLContext * c)
v = &c->viewport;
v->trans.X = ((v->xsize - 0.5) / 2.0) + v->xmin;
v->trans.Y = ((v->ysize - 0.5) / 2.0) + v->ymin;
v->trans.Z = ((zsize - 0.5) / 2.0) + ((1 << ZB_POINT_Z_FRAC_BITS)) / 2;
v->trans.X = (float)(((v->xsize - 0.5) / 2.0) + v->xmin);
v->trans.Y = (float)(((v->ysize - 0.5) / 2.0) + v->ymin);
v->trans.Z = (float)(((zsize - 0.5) / 2.0) + ((1 << ZB_POINT_Z_FRAC_BITS)) / 2);
v->scale.X = (v->xsize - 0.5) / 2.0;
v->scale.Y = -(v->ysize - 0.5) / 2.0;
v->scale.Z = -((zsize - 0.5) / 2.0);
v->scale.X = (float)((v->xsize - 0.5) / 2.0);
v->scale.Y = (float)(-(v->ysize - 0.5) / 2.0);
v->scale.Z = (float)(-((zsize - 0.5) / 2.0));
}
void glopBegin(GLContext * c, TGLParam * p)

View file

@ -356,7 +356,7 @@ static inline int gl_clipcode(float x,float y,float z,float w1)
{
float w;
w=w1 * (1.0 + CLIP_EPSILON);
w=(float)(w1 * (1.0 + CLIP_EPSILON));
return (x<-w) |
((x>w)<<1) |
((y<-w)<<2) |

View file

@ -298,7 +298,7 @@ void ZB_fillTriangleMappingPerspective(ZBuffer *zb,
float sz,tz,fz,zinv; \
n=(x2>>16)-x1; \
fz=(float)z1;\
zinv=1.0 / fz;\
zinv=(float)(1.0 / fz);\
pp=(PIXEL *)((char *)pp1 + x1 * PSZB); \
pz=pz1+x1; \
z=z1; \
@ -314,7 +314,7 @@ void ZB_fillTriangleMappingPerspective(ZBuffer *zb,
dsdx= (int)( (dszdx - ss*fdzdx)*zinv );\
dtdx= (int)( (dtzdx - tt*fdzdx)*zinv );\
fz+=fndzdx;\
zinv=1.0 / fz;\
zinv=(float)(1.0 / fz);\
}\
PUT_PIXEL(0); \
PUT_PIXEL(1); \

View file

@ -52,16 +52,16 @@
/* we compute dXdx and dXdy for all interpolated values */
fdx1 = p1->x - p0->x;
fdy1 = p1->y - p0->y;
fdx1 = (float)(p1->x - p0->x);
fdy1 = (float)(p1->y - p0->y);
fdx2 = p2->x - p0->x;
fdy2 = p2->y - p0->y;
fdx2 = (float)(p2->x - p0->x);
fdy2 = (float)(p2->y - p0->y);
fz = fdx1 * fdy2 - fdx2 * fdy1;
if (fz == 0)
return;
fz = 1.0 / fz;
fz = (float)(1.0 / fz);
fdx1 *= fz;
fdy1 *= fz;
@ -69,38 +69,38 @@
fdy2 *= fz;
#ifdef INTERP_Z
d1 = p1->z - p0->z;
d2 = p2->z - p0->z;
d1 = (float)(p1->z - p0->z);
d2 = (float)(p2->z - p0->z);
dzdx = (int) (fdy2 * d1 - fdy1 * d2);
dzdy = (int) (fdx1 * d2 - fdx2 * d1);
#endif
#ifdef INTERP_RGB
d1 = p1->r - p0->r;
d2 = p2->r - p0->r;
d1 = (float)(p1->r - p0->r);
d2 = (float)(p2->r - p0->r);
drdx = (int) (fdy2 * d1 - fdy1 * d2);
drdy = (int) (fdx1 * d2 - fdx2 * d1);
d1 = p1->g - p0->g;
d2 = p2->g - p0->g;
d1 = (float)(p1->g - p0->g);
d2 = (float)(p2->g - p0->g);
dgdx = (int) (fdy2 * d1 - fdy1 * d2);
dgdy = (int) (fdx1 * d2 - fdx2 * d1);
d1 = p1->b - p0->b;
d2 = p2->b - p0->b;
d1 = (float)(p1->b - p0->b);
d2 = (float)(p2->b - p0->b);
dbdx = (int) (fdy2 * d1 - fdy1 * d2);
dbdy = (int) (fdx1 * d2 - fdx2 * d1);
#endif
#ifdef INTERP_ST
d1 = p1->s - p0->s;
d2 = p2->s - p0->s;
d1 = (float)(p1->s - p0->s);
d2 = (float)(p2->s - p0->s);
dsdx = (int) (fdy2 * d1 - fdy1 * d2);
dsdy = (int) (fdx1 * d2 - fdx2 * d1);
d1 = p1->t - p0->t;
d2 = p2->t - p0->t;
d1 = (float)(p1->t - p0->t);
d2 = (float)(p2->t - p0->t);
dtdx = (int) (fdy2 * d1 - fdy1 * d2);
dtdy = (int) (fdx1 * d2 - fdx2 * d1);
#endif