{
struct mem_block *p;
const int mask = (1 << align2)-1;
- unsigned int startofs = 0;
- unsigned int endofs;
+ int startofs = 0;
+ int endofs;
if (!heap || align2 < 0 || size <= 0)
return NULL;
for (i = 0; i < prog->NumInstructions; i++) {
struct prog_instruction *inst = prog->Instructions + i;
if (inst->BranchTarget > 0) {
- if (inst->BranchTarget >= start) {
+ if ((GLuint)inst->BranchTarget >= start) {
inst->BranchTarget += count;
}
}
*/
static void
set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location,
- GLenum type, GLint count, GLint elems, const void *values)
+ GLenum type, GLsizei count, GLint elems, const void *values)
{
if (program->Parameters->Parameters[location].Type == PROGRAM_SAMPLER) {
/* This controls which texture unit which is used by a sampler */
}
else {
/* ordinary uniform variable */
- GLuint k, i;
+ GLsizei k, i;
if (count * elems > program->Parameters->Parameters[location].Size) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count too large)");
byte *prod;
GLuint size, start, version;
slang_string preprocessed;
- int maxVersion;
+ GLuint maxVersion;
#if FEATURE_ARB_shading_language_120
maxVersion = 120;
print_generic2(const slang_operation *op, const char *oper,
const char *s, int indent)
{
- int i;
+ GLuint i;
if (oper) {
spaces(indent);
printf("[%p locals %p] %s %s\n", (void*) op, (void*) op->locals, oper, s);
}
for (i = 0; i < op->num_children; i++) {
spaces(indent);
- printf("//child %d:\n", i);
+ printf("//child %u:\n", i);
slang_print_tree(&op->children[i], indent);
}
}
slang_checksum_tree(const slang_operation *op)
{
int s = op->num_children;
- int i;
+ GLuint i;
for (i = 0; i < op->num_children; i++) {
s += slang_checksum_tree(&op->children[i]);
struct pipe_context *pipe = ctx->st->pipe;
struct cso_context *cso = ctx->st->cso_context;
GLfloat x0, y0, x1, y1;
- GLuint maxSize;
+ GLsizei maxSize;
/* limit checks */
/* XXX if DrawPixels image is larger than max texture size, break
const float width = ctx->DrawBuffer->Width;
const float height = ctx->DrawBuffer->Height;
struct pipe_viewport_state vp;
- vp.scale[0] = 0.5 * width;
- vp.scale[1] = -0.5 * height;
- vp.scale[2] = 1.0;
- vp.scale[3] = 1.0;
- vp.translate[0] = 0.5 * width;
- vp.translate[1] = 0.5 * height;
- vp.translate[2] = 0.0;
- vp.translate[3] = 0.0;
+ vp.scale[0] = 0.5f * width;
+ vp.scale[1] = -0.5f * height;
+ vp.scale[2] = 1.0f;
+ vp.scale[3] = 1.0f;
+ vp.translate[0] = 0.5f * width;
+ vp.translate[1] = 0.5f * height;
+ vp.translate[2] = 0.0f;
+ vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
struct pipe_screen *screen = pipe->screen;
GLfloat temp[MAX_WIDTH][4];
const GLbitfield transferOps = ctx->_ImageTransferState;
- GLint i, yStep, dfStride;
+ GLsizei i, j;
+ GLint yStep, dfStride;
GLfloat *df;
struct st_renderbuffer *strb;
struct gl_pixelstore_attrib clippedPacking = *pack;
surf->format == PIPE_FORMAT_X8Z24_UNORM) {
if (format == GL_DEPTH_COMPONENT) {
for (i = 0; i < height; i++) {
- GLuint ztemp[MAX_WIDTH], j;
+ GLuint ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / ((1 << 24) - 1);
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
}
else if (surf->format == PIPE_FORMAT_Z16_UNORM) {
for (i = 0; i < height; i++) {
- GLushort ztemp[MAX_WIDTH], j;
+ GLushort ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / 0xffff;
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
}
else if (surf->format == PIPE_FORMAT_Z32_UNORM) {
for (i = 0; i < height; i++) {
- GLuint ztemp[MAX_WIDTH], j;
+ GLuint ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / 0xffffffff;
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
(ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL)) {
/* need edge flags */
- GLuint i;
+ GLint i;
unsigned *vec;
struct st_buffer_object *stobj = st_buffer_object(array->BufferObj);
ubyte *map;
return (a < b) ? a : b;
}
-static int _max(int a, int b)
+static float _maxf(float a, float b)
{
return (a > b) ? a : b;
}
1, MAX_DRAW_BUFFERS);
c->MaxLineWidth
- = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
c->MaxLineWidthAA
- = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
c->MaxPointSize
- = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
c->MaxPointSizeAA
- = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
c->MaxTextureMaxAnisotropy
- = _max(2.0, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
+ = _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
c->MaxTextureLodBias
= screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);