if (light->Enabled) {
key->unit[i].light_enabled = 1;
- if (light->EyePosition[3] == 0.0)
+ if (light->EyePosition[3] == 0.0F)
key->unit[i].light_eyepos3_is_zero = 1;
- if (light->SpotCutoff == 180.0)
+ if (light->SpotCutoff == 180.0F)
key->unit[i].light_spotcutoff_is_180 = 1;
- if (light->ConstantAttenuation != 1.0 ||
- light->LinearAttenuation != 0.0 ||
- light->QuadraticAttenuation != 0.0)
+ if (light->ConstantAttenuation != 1.0F ||
+ light->LinearAttenuation != 0.0F ||
+ light->QuadraticAttenuation != 0.0F)
key->unit[i].light_attenuated = 1;
}
}
ctx->Fog.Mode = m;
break;
case GL_FOG_DENSITY:
- if (*params<0.0) {
+ if (*params<0.0F) {
_mesa_error( ctx, GL_INVALID_VALUE, "glFog" );
return;
}
break;
case GL_EDGE_FLAG:
- v->value_bool = ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0;
+ v->value_bool = ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0F;
break;
case GL_READ_BUFFER:
COPY_3V(light->SpotDirection, params);
break;
case GL_SPOT_EXPONENT:
- assert(params[0] >= 0.0);
+ assert(params[0] >= 0.0F);
assert(params[0] <= ctx->Const.MaxSpotExponent);
if (light->SpotExponent == params[0])
return;
light->SpotExponent = params[0];
break;
case GL_SPOT_CUTOFF:
- assert(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0));
+ assert(params[0] == 180.0F || (params[0] >= 0.0F && params[0] <= 90.0F));
if (light->SpotCutoff == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->SpotCutoff = params[0];
- light->_CosCutoff = (GLfloat) (cos(light->SpotCutoff * M_PI / 180.0));
+ light->_CosCutoff = (cosf(light->SpotCutoff * M_PI / 180.0));
if (light->_CosCutoff < 0)
light->_CosCutoff = 0;
if (light->SpotCutoff != 180.0F)
light->_Flags &= ~LIGHT_SPOT;
break;
case GL_CONSTANT_ATTENUATION:
- assert(params[0] >= 0.0);
+ assert(params[0] >= 0.0F);
if (light->ConstantAttenuation == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->ConstantAttenuation = params[0];
break;
case GL_LINEAR_ATTENUATION:
- assert(params[0] >= 0.0);
+ assert(params[0] >= 0.0F);
if (light->LinearAttenuation == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->LinearAttenuation = params[0];
break;
case GL_QUADRATIC_ATTENUATION:
- assert(params[0] >= 0.0);
+ assert(params[0] >= 0.0F);
if (light->QuadraticAttenuation == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
params = temp;
break;
case GL_SPOT_EXPONENT:
- if (params[0] < 0.0 || params[0] > ctx->Const.MaxSpotExponent) {
+ if (params[0] < 0.0F || params[0] > ctx->Const.MaxSpotExponent) {
_mesa_error(ctx, GL_INVALID_VALUE, "glLight");
return;
}
break;
case GL_SPOT_CUTOFF:
- if ((params[0] < 0.0 || params[0] > 90.0) && params[0] != 180.0) {
+ if ((params[0] < 0.0F || params[0] > 90.0F) && params[0] != 180.0F) {
_mesa_error(ctx, GL_INVALID_VALUE, "glLight");
return;
}
break;
case GL_CONSTANT_ATTENUATION:
- if (params[0] < 0.0) {
+ if (params[0] < 0.0F) {
_mesa_error(ctx, GL_INVALID_VALUE, "glLight");
return;
}
break;
case GL_LINEAR_ATTENUATION:
- if (params[0] < 0.0) {
+ if (params[0] < 0.0F) {
_mesa_error(ctx, GL_INVALID_VALUE, "glLight");
return;
}
break;
case GL_QUADRATIC_ATTENUATION:
- if (params[0] < 0.0) {
+ if (params[0] < 0.0F) {
_mesa_error(ctx, GL_INVALID_VALUE, "glLight");
return;
}
case GL_LIGHT_MODEL_LOCAL_VIEWER:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
- newbool = (params[0]!=0.0);
+ newbool = (params[0] != 0.0F);
if (ctx->Light.Model.LocalViewer == newbool)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Model.LocalViewer = newbool;
break;
case GL_LIGHT_MODEL_TWO_SIDE:
- newbool = (params[0]!=0.0);
+ newbool = (params[0] != 0.0F);
if (ctx->Light.Model.TwoSide == newbool)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
}
else {
/* positional light w/ homogeneous coordinate, divide by W */
- GLfloat wInv = (GLfloat)1.0 / light->_Position[3];
+ GLfloat wInv = 1.0F / light->_Position[3];
light->_Position[0] *= wInv;
light->_Position[1] *= wInv;
light->_Position[2] *= wInv;
if (!_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top)) {
const GLfloat *m = ctx->ModelviewMatrixStack.Top->inv;
GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10];
- if (f < 1e-12) f = 1.0;
+ if (f < 1e-12f) f = 1.0f;
if (ctx->_NeedEyeCoords)
ctx->_ModelViewInvScale = 1.0f / sqrtf(f);
else
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLineWidth %f\n", width);
- if (width<=0.0) {
+ if (width <= 0.0F) {
_mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
return;
}
if (ctx->API == API_OPENGL_CORE
&& ((ctx->Const.ContextFlags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
!= 0)
- && width > 1.0) {
+ && width > 1.0F) {
_mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
return;
}
FLUSH_VERTICES(ctx, 0);
- ctx->Multisample.SampleCoverageValue = (GLfloat) CLAMP(value, 0.0, 1.0);
+ ctx->Multisample.SampleCoverageValue = CLAMP(value, 0.0f, 1.0f);
ctx->Multisample.SampleCoverageInvert = invert;
ctx->NewState |= _NEW_MULTISAMPLE;
}
FLUSH_VERTICES(ctx, 0);
- ctx->Multisample.MinSampleShadingValue = CLAMP(value, 0.0, 1.0);
+ ctx->Multisample.MinSampleShadingValue = CLAMP(value, 0.0f, 1.0f);
ctx->NewState |= _NEW_MULTISAMPLE;
}
* back to an int type can introduce errors that will show up as
* artifacts in things like depth peeling which uses glCopyTexImage.
*/
- if (ctx->Pixel.DepthScale == 1.0 && ctx->Pixel.DepthBias == 0.0) {
+ if (ctx->Pixel.DepthScale == 1.0F && ctx->Pixel.DepthBias == 0.0F) {
if (srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_SHORT) {
const GLuint *src = (const GLuint *) source;
GLushort *dst = (GLushort *) dest;
case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */
if (dstType == GL_UNSIGNED_INT_24_8_EXT &&
depthMax == 0xffffff &&
- ctx->Pixel.DepthScale == 1.0 &&
- ctx->Pixel.DepthBias == 0.0) {
+ ctx->Pixel.DepthScale == 1.0F &&
+ ctx->Pixel.DepthBias == 0.0F) {
const GLuint *src = (const GLuint *) source;
GLuint *zValues = (GLuint *) dest;
GLuint i;
{
const GLfloat scale = ctx->Pixel.DepthScale;
const GLfloat bias = ctx->Pixel.DepthBias;
- if (scale != 1.0 || bias != 0.0) {
+ if (scale != 1.0F || bias != 0.0F) {
GLuint i;
for (i = 0; i < n; i++) {
depthValues[i] = depthValues[i] * scale + bias;
if (needClamp) {
GLuint i;
for (i = 0; i < n; i++) {
- depthValues[i] = (GLfloat)CLAMP(depthValues[i], 0.0, 1.0);
+ depthValues[i] = CLAMP(depthValues[i], 0.0F, 1.0F);
}
}
return;
}
- if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
+ if (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F) {
memcpy(depthCopy, depthSpan, n * sizeof(GLfloat));
_mesa_scale_and_bias_depth(ctx, n, depthCopy);
depthSpan = depthCopy;
return;
}
- if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
+ if (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F) {
memcpy(depthCopy, depthVals, n * sizeof(GLfloat));
_mesa_scale_and_bias_depth(ctx, n, depthCopy);
depthVals = depthCopy;
/* special cases */
case GL_PIXEL_MAP_I_TO_I:
for (i = 0; i < mapsize; i++) {
- values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0, 65535.);
+ values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0F, 65535.0F);
}
break;
case GL_PIXEL_MAP_S_TO_S:
for (i = 0; i < mapsize; i++) {
- values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0, 65535.);
+ values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0F, 65535.0F);
}
break;
default:
GLfloat rBias, GLfloat gBias,
GLfloat bBias, GLfloat aBias)
{
- if (rScale != 1.0 || rBias != 0.0) {
+ if (rScale != 1.0F || rBias != 0.0F) {
GLuint i;
for (i = 0; i < n; i++) {
rgba[i][RCOMP] = rgba[i][RCOMP] * rScale + rBias;
}
}
- if (gScale != 1.0 || gBias != 0.0) {
+ if (gScale != 1.0F || gBias != 0.0F) {
GLuint i;
for (i = 0; i < n; i++) {
rgba[i][GCOMP] = rgba[i][GCOMP] * gScale + gBias;
}
}
- if (bScale != 1.0 || bBias != 0.0) {
+ if (bScale != 1.0F || bBias != 0.0F) {
GLuint i;
for (i = 0; i < n; i++) {
rgba[i][BCOMP] = rgba[i][BCOMP] * bScale + bBias;
}
}
- if (aScale != 1.0 || aBias != 0.0) {
+ if (aScale != 1.0F || aBias != 0.0F) {
GLuint i;
for (i = 0; i < n; i++) {
rgba[i][ACOMP] = rgba[i][ACOMP] * aScale + aBias;
{
GET_CURRENT_CONTEXT(ctx);
- if (size <= 0.0) {
+ if (size <= 0.0F) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPointSize" );
return;
}
return;
FLUSH_VERTICES(ctx, _NEW_POINT);
COPY_3V(ctx->Point.Params, params);
- ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 ||
- ctx->Point.Params[1] != 0.0 ||
- ctx->Point.Params[2] != 0.0);
+ ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0F ||
+ ctx->Point.Params[1] != 0.0F ||
+ ctx->Point.Params[2] != 0.0F);
break;
case GL_POINT_SIZE_MIN_EXT:
if (params[0] < 0.0F) {
GLubyte *map, *dst;
int stride, dstStride, j;
- if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0)
+ if (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F)
return GL_FALSE;
if (packing->SwapBytes)
const struct gl_pixelstore_attrib *packing )
{
const GLboolean scaleOrBias
- = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
+ = ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F;
const GLboolean stencilTransfer = ctx->Pixel.IndexShift
|| ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag;
GLubyte *dst;
if (samp->MaxAnisotropy == param)
return GL_FALSE;
- if (param < 1.0)
+ if (param < 1.0F)
return INVALID_VALUE;
flush(ctx);
if (texObj->Sampler.MaxAnisotropy == params[0])
return GL_FALSE;
- if (params[0] < 1.0) {
+ if (params[0] < 1.0F) {
_mesa_error(ctx, GL_INVALID_VALUE, "glTex%sParameter(param)",
suffix);
return GL_FALSE;
if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT))
{
- facing = (cc < 0.0) ^ ctx->Polygon._FrontBit;
+ facing = (cc < 0.0F) ^ ctx->Polygon._FrontBit;
if (IND & SS_UNFILLED_BIT)
mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode;
* so no MRD value is used here.
*/
offset = ctx->Polygon.OffsetUnits;
- if (cc * cc > 1e-16) {
+ if (cc * cc > 1e-16F) {
const GLfloat ez = z[0] - z[2];
const GLfloat fz = z[1] - z[2];
const GLfloat oneOverArea = 1.0F / cc;