static void
loopback_VertexAttrib4bvARB(GLuint index, const GLbyte * v)
{
- ATTRIB(index, v[0], v[1], v[2], v[3]);
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
}
static void
loopback_VertexAttrib4ivARB(GLuint index, const GLint * v)
{
- ATTRIB(index, v[0], v[1], v[2], v[3]);
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
}
static void
loopback_VertexAttrib4ubvARB(GLuint index, const GLubyte * v)
{
- ATTRIB(index, v[0], v[1], v[2], v[3]);
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
}
static void
loopback_VertexAttrib4usvARB(GLuint index, const GLushort * v)
{
- ATTRIB(index, v[0], v[1], v[2], v[3]);
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
}
static void
loopback_VertexAttrib4uivARB(GLuint index, const GLuint * v)
{
- ATTRIB(index, v[0], v[1], v[2], v[3]);
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
}
static void
switch (pname) {
case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
- params[0] = ctx->Array.VertexAttrib[index].Enabled;
+ params[0] = (GLfloat) ctx->Array.VertexAttrib[index].Enabled;
break;
case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB:
- params[0] = ctx->Array.VertexAttrib[index].Size;
+ params[0] = (GLfloat) ctx->Array.VertexAttrib[index].Size;
break;
case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB:
- params[0] = ctx->Array.VertexAttrib[index].Stride;
+ params[0] = (GLfloat) ctx->Array.VertexAttrib[index].Stride;
break;
case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB:
- params[0] = ctx->Array.VertexAttrib[index].Type;
+ params[0] = (GLfloat) ctx->Array.VertexAttrib[index].Type;
break;
case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB:
params[0] = ctx->Array.VertexAttrib[index].Normalized;
_mesa_GetVertexAttribfvARB(index, pname, fparams);
if (ctx->ErrorValue == GL_NO_ERROR) {
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
- COPY_4V(params, fparams); /* float to int */
+ COPY_4V_CAST(params, fparams, GLint); /* float to int */
}
else {
- params[0] = fparams[0];
+ params[0] = (GLint) fparams[0];
}
}
}
_mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index,
GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
- _mesa_ProgramEnvParameter4fARB(target, index, x, y, z, w);
+ _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y,
+ (GLfloat) z, (GLfloat) w);
}
_mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
const GLdouble *params)
{
- _mesa_ProgramEnvParameter4fARB(target, index, params[0], params[1],
- params[2], params[3]);
+ _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0],
+ (GLfloat) params[1], (GLfloat) params[2],
+ (GLfloat) params[3]);
}
if (reg[0] == 'R') {
/* Temp register */
GLint i = _mesa_atoi(reg + 1);
- if (i >= ctx->Const.MaxVertexProgramTemps) {
+ if (i >= (GLint)ctx->Const.MaxVertexProgramTemps) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glGetProgramRegisterfvMESA(registerName)");
return;
}
else if (reg[0] == 'v' && reg[1] == '[') {
/* Vertex Input attribute */
- GLint i;
+ GLuint i;
for (i = 0; i < ctx->Const.MaxVertexProgramAttribs; i++) {
const char *name = _mesa_nv_vertex_input_register_name(i);
char number[10];
if (reg[0] == 'R') {
/* Temp register */
GLint i = _mesa_atoi(reg + 1);
- if (i >= ctx->Const.MaxFragmentProgramTemps) {
+ if (i >= (GLint)ctx->Const.MaxFragmentProgramTemps) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glGetProgramRegisterfvMESA(registerName)");
return;
}
else if (reg[0] == 'f' && reg[1] == '[') {
/* Fragment input attribute */
- GLint i;
+ GLuint i;
for (i = 0; i < ctx->Const.MaxFragmentProgramAttribs; i++) {
const char *name = _mesa_nv_fragment_input_register_name(i);
if (_mesa_strncmp(reg + 2, name, 4) == 0) {
eat_children = 0;
bind_row = 0;
bind_nrows = 1;
- bind_vals[0] = bind_vals[1] = bind_vals[2] = bind_vals[3];
+ bind_vals[0] = bind_vals[1] = bind_vals[2] = bind_vals[3] = 0.0f;
switch (ptn->prod_applied) {
/* vertex */
case 121:
#define FOLD_FLOAT_CONSTANT(float_ptr, bind_vals_idx, sign) \
if (float_ptr->tok == 49) /* GLfloat */ {\
- bind_vals[bind_vals_idx] = sign * s->floats.data[float_ptr->tok_attr];\
+ bind_vals[bind_vals_idx] = sign * (GLfloat) s->floats.data[float_ptr->tok_attr];\
}\
else /* GLint */ {\
bind_vals[bind_vals_idx] = sign * s->ints.data[float_ptr->tok_attr];\
#define FOLD_SIGNED_FLOAT_CONSTANT(sf_ptr, bind_vals_idx) \
{\
- GLfloat __mul = 1.;\
+ GLfloat __mul = 1.0F;\
if (sf_ptr->children[0]->prod_applied == 282) \
- __mul = -1.;\
+ __mul = -1.0F;\
FOLD_FLOAT_CONSTANT(sf_ptr->children[1], bind_vals_idx, __mul);\
}
return;
FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.BoundsMin = zmin;
- ctx->Depth.BoundsMax = zmax;
+ ctx->Depth.BoundsMin = (GLfloat) zmin;
+ ctx->Depth.BoundsMax = (GLfloat) zmax;
}
if (n) {
n[1].e = target;
n[2].ui = index;
- n[3].f = x;
- n[4].f = y;
- n[5].f = z;
- n[6].f = w;
+ n[3].f = (GLfloat) x;
+ n[4].f = (GLfloat) y;
+ n[5].f = (GLfloat) z;
+ n[6].f = (GLfloat) w;
}
if (ctx->ExecuteFlag) {
(*ctx->Exec->ProgramLocalParameter4dARB)(target, index, x, y, z, w);
if (n) {
n[1].e = target;
n[2].ui = index;
- n[3].f = params[0];
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
+ n[3].f = (GLfloat) params[0];
+ n[4].f = (GLfloat) params[1];
+ n[5].f = (GLfloat) params[2];
+ n[6].f = (GLfloat) params[3];
}
if (ctx->ExecuteFlag) {
(*ctx->Exec->ProgramLocalParameter4dvARB)(target, index, params);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = ALLOC_INSTRUCTION( ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 2 );
if (n) {
- n[1].f = zmin;
- n[2].f = zmax;
+ n[1].f = (GLfloat) zmin;
+ n[2].f = (GLfloat) zmax;
}
if (ctx->ExecuteFlag) {
(*ctx->Exec->DepthBoundsEXT)( zmin, zmax );
#elif defined(XFree86LOADER) && defined(IN_MODULE)
return 1.0F / xf86sqrt(n);
#else
- return 1.0F / sqrt(n);
+ return (float) (1.0 / sqrt(n));
#endif
}
(DST)[3] = (SRC)[3]; \
} while (0)
+/** Copy a 4-element vector with cast */
+#define COPY_4V_CAST( DST, SRC, CAST ) \
+do { \
+ (DST)[0] = (CAST)(SRC)[0]; \
+ (DST)[1] = (CAST)(SRC)[1]; \
+ (DST)[2] = (CAST)(SRC)[2]; \
+ (DST)[3] = (CAST)(SRC)[3]; \
+} while (0)
+
/** Copy a 4-element unsigned byte vector */
#if defined(__i386__)
#define COPY_4UBV(DST, SRC) \
case GL_MATRIX7_ARB:
if (ctx->Extensions.ARB_vertex_program ||
ctx->Extensions.ARB_fragment_program) {
- const GLint m = mode - GL_MATRIX0_ARB;
+ const GLuint m = mode - GL_MATRIX0_ARB;
if (m > ctx->Const.MaxProgramMatrices) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glMatrixMode(GL_MATRIX%d_ARB)", m);
static const GLint
lookup_parameter_index(struct parse_state *parseState, const char *name)
{
- GLint i;
+ GLuint i;
for (i = 0; i < parseState->numParameters; i++) {
if (_mesa_strcmp(parseState->parameters[i].Name, name) == 0)
return i;
{
struct program *prog;
struct fragment_program *fragProg;
- GLint i;
+ GLuint i;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
{
struct program *prog;
struct fragment_program *fragProg;
- GLint i;
+ GLuint i;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
{
GLfloat t[4];
fetch_vector1( &inst->SrcReg[0], state, t );
- t[0] = t[1] = t[2] = t[3] = _mesa_pow(2.0, t[0]);
+ t[0] = t[1] = t[2] = t[3] = (GLfloat)_mesa_pow(2.0, t[0]);
store_vector4( &inst->DstReg, state, t );
}
break;
GLfloat t[4], u[4];
fetch_vector1( &inst->SrcReg[0], state, t );
fetch_vector1( &inst->SrcReg[1], state, u );
- t[0] = t[1] = t[2] = t[3] = _mesa_pow(t[0], u[0]);
+ t[0] = t[1] = t[2] = t[3] = (GLfloat)_mesa_pow(t[0], u[0]);
store_vector4( &inst->DstReg, state, t );
}
break;
first = _mesa_HashFindFreeKeyBlock(ctx->Occlusion.QueryObjects, n);
if (first) {
- GLuint i;
+ GLsizei i;
for (i = 0; i < n; i++) {
struct occlusion_query *q = new_query_object(GL_SAMPLES_PASSED_ARB,
first + i);
}
/* ndc = clip / W */
- d = (clip[3] == 0.0) ? 1.0 : 1.0F / clip[3];
+ d = (clip[3] == 0.0F) ? 1.0F : 1.0F / clip[3];
ndc[0] = clip[0] * d;
ndc[1] = clip[1] * d;
ndc[2] = clip[2] * d;
GLdouble len = x * x + y * y + z * z;
if (len > 1e-50) {
len = INV_SQRTF(len);
- out[i][0] = x * len;
- out[i][1] = y * len;
- out[i][2] = z * len;
+ out[i][0] = (GLfloat)(x * len);
+ out[i][1] = (GLfloat)(y * len);
+ out[i][2] = (GLfloat)(z * len);
}
else {
out[i][0] = x;
/***** Rasterization *****/
/**********************************************************************/
-
/* Simple color index line (no stipple, width=1, no Z, no fog, no tex)*/
#define NAME simple_ci_line
#define INTERP_INDEX
#define RENDER_SPAN(span) _swrast_write_index_span(ctx, &span)
#include "s_linetemp.h"
-
/* Simple RGBA index line (no stipple, width=1, no Z, no fog, no tex)*/
#define NAME simple_rgba_line
#define INTERP_RGBA
#define RENDER_SPAN(span) \
if (ctx->Line.StippleFlag) { \
span.arrayMask |= SPAN_MASK; \
- compute_stipple_mask(ctx, span.end, span.array->mask); \
+ compute_stipple_mask(ctx, span.end, span.array->mask); \
} \
if (ctx->Line.Width > 1.0) { \
- draw_wide_line(ctx, &span, dx > dy); \
+ draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
} \
else { \
_swrast_write_index_span(ctx, &span); \
compute_stipple_mask(ctx, span.end, span.array->mask); \
} \
if (ctx->Line.Width > 1.0) { \
- draw_wide_line(ctx, &span, dx > dy); \
+ draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
} \
else { \
_swrast_write_rgba_span(ctx, &span); \
compute_stipple_mask(ctx, span.end, span.array->mask); \
} \
if (ctx->Line.Width > 1.0) { \
- draw_wide_line(ctx, &span, dx > dy); \
+ draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
} \
else { \
_swrast_write_texture_span(ctx, &span); \
compute_stipple_mask(ctx, span.end, span.array->mask); \
} \
if (ctx->Line.Width > 1.0) { \
- draw_wide_line(ctx, &span, dx > dy); \
+ draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
} \
else { \
_swrast_write_texture_span(ctx, &span); \
{
GLfloat a[4], result[4];
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
- result[0] = result[1] = result[2] = result[3] = _mesa_cos(a[0]);
+ result[0] = result[1] = result[2] = result[3] = (GLfloat)_mesa_cos(a[0]);
store_vector4( inst, machine, result );
}
break;
a[1] = 0.0F;
result[0] = 1.0F;
result[1] = a[0];
- result[2] = (a[0] > 0.0) ? _mesa_pow(2.0, a[3]) : 0.0F;
+ result[2] = (a[0] > 0.0F) ? (GLfloat)_mesa_pow(2.0, a[3]) : 0.0F;
result[3] = 1.0F;
store_vector4( inst, machine, result );
}
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
fetch_vector1( ctx, &inst->SrcReg[1], machine, program, b );
result[0] = result[1] = result[2] = result[3]
- = _mesa_pow(a[0], b[0]);
+ = (GLfloat)_mesa_pow(a[0], b[0]);
store_vector4( inst, machine, result );
}
break;
{
GLfloat a[4], result[4];
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
- result[0] = result[1] = result[2] = result[3] = _mesa_sin(a[0]);
+ result[0] = result[1] = result[2] =
+ result[3] = (GLfloat)_mesa_sin(a[0]);
store_vector4( inst, machine, result );
}
break;
/* Load input registers */
if (inputsRead & (1 << FRAG_ATTRIB_WPOS)) {
GLfloat *wpos = machine->Inputs[FRAG_ATTRIB_WPOS];
- wpos[0] = span->x + col;
- wpos[1] = span->y;
+ wpos[0] = (GLfloat) span->x + col;
+ wpos[1] = (GLfloat) span->y;
wpos[2] = (GLfloat) span->array->z[col] / ctx->DepthMaxF;
wpos[3] = span->w + col * span->dwdx;
}
else {
ASSERT (ctx->Light.ShadeModel == GL_FLAT);
span.interpMask |= SPAN_FLAT;
- span.drdx = span.drdy = span.redStep = 0;
- span.dgdx = span.dgdy = span.greenStep = 0;
- span.dbdx = span.dbdy = span.blueStep = 0;
+ span.drdx = span.drdy = 0.0F;
+ span.dgdx = span.dgdy = 0.0F;
+ span.dbdx = span.dbdy = 0.0F;
+# if CHAN_TYPE == GL_FLOAT
+ span.redStep = 0.0F;
+ span.greenStep = 0.0F;
+ span.blueStep = 0.0F;
+# else
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+# endif /* GL_FLOAT */
# ifdef INTERP_ALPHA
- span.dadx = span.dady = span.alphaStep = 0;
+ span.dadx = span.dady = 0.0F;
+# if CHAN_TYPE == GL_FLOAT
+ span.alphaStep = 0.0F;
+# else
+ span.alphaStep = 0;
+# endif /* GL_FLOAT */
# endif
}
#endif /* INTERP_RGB */
# endif
}
else {
- span.dsrdx = span.dsrdy = span.specRedStep = 0;
- span.dsgdx = span.dsgdy = span.specGreenStep = 0;
- span.dsbdx = span.dsbdy = span.specBlueStep = 0;
+ span.dsrdx = span.dsrdy = 0.0F;
+ span.dsgdx = span.dsgdy = 0.0F;
+ span.dsbdx = span.dsbdy = 0.0F;
+# if CHAN_TYPE == GL_FLOAT
+ span.specRedStep = 0.0F;
+ span.specGreenStep = 0.0F;
+ span.specBlueStep = 0.0F;
+# else
+ span.specRedStep = 0;
+ span.specGreenStep = 0;
+ span.specBlueStep = 0;
+# endif
}
#endif /* INTERP_SPEC */
#ifdef INTERP_INDEX
fdgOuter = span.dgdy + dxOuter * span.dgdx;
fdbOuter = span.dbdy + dxOuter * span.dbdx;
# else
- rLeft = (ChanToFixed(vLower->color[RCOMP]) + span.drdx * adjx + span.drdy * adjy) + FIXED_HALF;
- gLeft = (ChanToFixed(vLower->color[GCOMP]) + span.dgdx * adjx + span.dgdy * adjy) + FIXED_HALF;
- bLeft = (ChanToFixed(vLower->color[BCOMP]) + span.dbdx * adjx + span.dbdy * adjy) + FIXED_HALF;
+ rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP]) + span.drdx * adjx + span.drdy * adjy) + FIXED_HALF;
+ gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP]) + span.dgdx * adjx + span.dgdy * adjy) + FIXED_HALF;
+ bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP]) + span.dbdx * adjx + span.dbdy * adjy) + FIXED_HALF;
fdrOuter = SignedFloatToFixed(span.drdy + dxOuter * span.drdx);
fdgOuter = SignedFloatToFixed(span.dgdy + dxOuter * span.dgdx);
fdbOuter = SignedFloatToFixed(span.dbdy + dxOuter * span.dbdx);
aLeft = vLower->color[ACOMP] + (span.dadx * adjx + span.dady * adjy) * (1.0F / FIXED_SCALE);
fdaOuter = span.dady + dxOuter * span.dadx;
# else
- aLeft = (ChanToFixed(vLower->color[ACOMP]) + span.dadx * adjx + span.dady * adjy) + FIXED_HALF;
+ aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP]) + span.dadx * adjx + span.dady * adjy) + FIXED_HALF;
fdaOuter = SignedFloatToFixed(span.dady + dxOuter * span.dadx);
# endif
# endif