unbind_uniform_buffers(struct gl_context *ctx, GLuint first, GLsizei count)
{
struct gl_buffer_object *bufObj = ctx->Shared->NullBufferObj;
- GLuint i;
+ GLint i;
for (i = 0; i < count; i++)
set_ubo_binding(ctx, &ctx->UniformBufferBindings[first + i],
bind_uniform_buffers_base(struct gl_context *ctx, GLuint first, GLsizei count,
const GLuint *buffers)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_uniform_buffers(ctx, first, count, "glBindBuffersBase"))
return;
const GLuint *buffers,
const GLintptr *offsets, const GLsizeiptr *sizes)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_uniform_buffers(ctx, first, count,
"glBindBuffersRange"))
GLuint first, GLsizei count)
{
struct gl_buffer_object * const bufObj = ctx->Shared->NullBufferObj;
- GLuint i;
+ GLint i;
for (i = 0; i < count; i++)
_mesa_set_transform_feedback_binding(ctx, tfObj, first + i,
{
struct gl_transform_feedback_object *tfObj =
ctx->TransformFeedback.CurrentObject;
- GLuint i;
+ GLint i;
if (!error_check_bind_xfb_buffers(ctx, tfObj, first, count,
"glBindBuffersBase"))
{
struct gl_transform_feedback_object *tfObj =
ctx->TransformFeedback.CurrentObject;
- GLuint i;
+ GLint i;
if (!error_check_bind_xfb_buffers(ctx, tfObj, first, count,
"glBindBuffersRange"))
unbind_atomic_buffers(struct gl_context *ctx, GLuint first, GLsizei count)
{
struct gl_buffer_object * const bufObj = ctx->Shared->NullBufferObj;
- GLuint i;
+ GLint i;
for (i = 0; i < count; i++)
set_atomic_buffer_binding(ctx, &ctx->AtomicBufferBindings[first + i],
GLsizei count,
const GLuint *buffers)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_atomic_buffers(ctx, first, count,
"glBindBuffersBase"))
const GLintptr *offsets,
const GLsizeiptr *sizes)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_atomic_buffers(ctx, first, count,
"glBindBuffersRange"))
void GLAPIENTRY
_mesa_DrawBuffers(GLsizei n, const GLenum *buffers)
{
- GLint output;
+ GLuint output;
GLbitfield usedBufferMask, supportedMask;
GLbitfield destMask[MAX_DRAW_BUFFERS];
GET_CURRENT_CONTEXT(ctx);
/** Returned by make_color_buffer_mask() for errors */
-#define INVALID_MASK ~0x0
+#define INVALID_MASK ~0x0U
/**
const GLuint contNodes = 1 + POINTER_DWORDS; /* size of continue info */
Node *n;
- if (opcode < (GLuint) OPCODE_EXT_0) {
+ if (opcode < OPCODE_EXT_0) {
if (InstSize[opcode] == 0) {
/* save instruction size now */
InstSize[opcode] = numNodes;
static enum mesa_debug_source
gl_enum_to_debug_source(GLenum e)
{
- int i;
+ unsigned i;
for (i = 0; i < Elements(debug_source_enums); i++) {
if (debug_source_enums[i] == e)
static enum mesa_debug_type
gl_enum_to_debug_type(GLenum e)
{
- int i;
+ unsigned i;
for (i = 0; i < Elements(debug_type_enums); i++) {
if (debug_type_enums[i] == e)
static enum mesa_debug_severity
gl_enum_to_debug_severity(GLenum e)
{
- int i;
+ unsigned i;
for (i = 0; i < Elements(debug_severity_enums); i++) {
if (debug_severity_enums[i] == e)
* Delete the oldest debug messages out of the log.
*/
static void
-debug_delete_messages(struct gl_debug_state *debug, unsigned count)
+debug_delete_messages(struct gl_debug_state *debug, int count)
{
struct gl_debug_log *log = &debug->Log;
static void
framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
GLenum attachment, GLenum textarget, GLuint texture,
- GLint level, GLint zoffset, GLboolean layered)
+ GLint level, GLuint zoffset, GLboolean layered)
{
struct gl_renderbuffer_attachment *att;
struct gl_texture_object *texObj = NULL;
}
if (texObj->Target == GL_TEXTURE_3D) {
- const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
- if (zoffset < 0 || zoffset >= maxSize) {
+ const GLuint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
+ if (zoffset >= maxSize) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glFramebufferTexture%s(zoffset)", caller);
return;
(texObj->Target == GL_TEXTURE_2D_ARRAY_EXT) ||
(texObj->Target == GL_TEXTURE_CUBE_MAP_ARRAY) ||
(texObj->Target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)) {
- if (zoffset < 0 ||
- zoffset >= (GLint) ctx->Const.MaxArrayTextureLayers) {
+ if (zoffset >= ctx->Const.MaxArrayTextureLayers) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glFramebufferTexture%s(layer)", caller);
return;
struct tnl_program {
const struct state_key *state;
struct gl_vertex_program *program;
- GLint max_inst; /** number of instructions allocated for program */
+ GLuint max_inst; /** number of instructions allocated for program */
GLboolean mvp_with_dp4;
GLuint temp_in_use;
GLuint nr;
struct prog_instruction *inst;
- assert((GLint) p->program->Base.NumInstructions <= p->max_inst);
+ assert(p->program->Base.NumInstructions <= p->max_inst);
if (p->program->Base.NumInstructions == p->max_inst) {
/* need to extend the program's instruction array */
static inline int
_mesa_unsigned_to_signed(unsigned src, unsigned dst_size)
{
- return MIN2(src, MAX_INT(dst_size));
+ return MIN2(src, (unsigned)MAX_INT(dst_size));
}
static inline int
}
}
- if (minWidth != ~0) {
+ if (minWidth != ~0U) {
fb->Width = minWidth;
fb->Height = minHeight;
}
*/
void _mesa_init_matrix( struct gl_context * ctx )
{
- GLint i;
+ GLuint i;
/* Initialize matrix stacks */
init_matrix_stack(&ctx->ModelviewMatrixStack, MAX_MODELVIEW_STACK_DEPTH,
init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH,
_NEW_TEXTURE_MATRIX);
for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++)
- init_matrix_stack(&ctx->ProgramMatrixStack[i],
+ init_matrix_stack(&ctx->ProgramMatrixStack[i],
MAX_PROGRAM_MATRIX_STACK_DEPTH, _NEW_TRACK_MATRIX);
ctx->CurrentStack = &ctx->ModelviewMatrixStack;
*/
void _mesa_free_matrix_data( struct gl_context *ctx )
{
- GLint i;
+ GLuint i;
free_matrix_stack(&ctx->ModelviewMatrixStack);
free_matrix_stack(&ctx->ProjectionMatrixStack);
GLint border;
GLboolean nextLevel;
GLuint temp_dst_row_stride, temp_dst_img_stride; /* in bytes */
- GLuint i;
+ GLint i;
/* get src image parameters */
srcImage = _mesa_select_tex_image(texObj, target, level);
*/
void _mesa_init_rastpos( struct gl_context * ctx )
{
- int i;
+ unsigned i;
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
if (memCopy) {
const GLuint bpp = _mesa_get_format_bytes(texImage->TexFormat);
- const GLuint bytesPerRow = texImage->Width * bpp;
+ const GLint bytesPerRow = texImage->Width * bpp;
GLubyte *dst =
_mesa_image_address2d(&ctx->Pack, pixels, texImage->Width,
texImage->Height, format, type, 0, 0);
const GLuint dimensions =
_mesa_get_texture_dimensions(texImage->TexObject->Target);
struct compressed_pixelstore store;
- GLuint i, slice;
+ GLint slice;
GLubyte *dest;
_mesa_compute_compressed_pixelstore(dimensions, texImage->TexFormat,
GL_MAP_READ_BIT, &src, &srcRowStride);
if (src) {
-
+ GLint i;
for (i = 0; i < store.CopyRowsPerSlice; i++) {
memcpy(dest, src, store.CopyBytesPerRow);
dest += store.TotalBytesPerRow;
{
struct gl_vertex_attrib_array *array;
GLbitfield typeBit;
- GLuint elementSize;
+ GLint elementSize;
GLenum format = GL_RGBA;
if (ctx->Array.LegalTypesMask == 0 || ctx->Array.LegalTypesMaskAPI != ctx->API) {
return (GLfloat *) prog->Parameters->ParameterValues[reg];
case PROGRAM_SYSTEM_VALUE:
- assert(reg < Elements(machine->SystemValues));
+ assert(reg < (GLint) Elements(machine->SystemValues));
return machine->SystemValues[reg];
default:
for (j = 0; j < numSrc; j++) {
if (inst->SrcReg[j].RelAddr ||
(inst->SrcReg[j].File == PROGRAM_TEMPORARY &&
- inst->SrcReg[j].Index == index &&
+ inst->SrcReg[j].Index == (GLint)index &&
(get_src_arg_mask(inst,j,NO_MASK) & mask)))
return READ;
}
struct loop_info *loopStack, GLuint loopStackDepth,
GLuint index, GLuint ic)
{
- int i;
+ unsigned i;
GLuint begin = ic;
GLuint end = ic;
* Return ARB_v/f_prog-style input attrib string.
*/
static const char *
-arb_input_attrib_string(GLint index, GLenum progType)
+arb_input_attrib_string(GLuint index, GLenum progType)
{
/*
* These strings should match the VERT_ATTRIB_x and VARYING_SLOT_x tokens.
* Return ARB_v/f_prog-style output attrib string.
*/
static const char *
-arb_output_attrib_string(GLint index, GLenum progType)
+arb_output_attrib_string(GLuint index, GLenum progType)
{
/*
* These strings should match the VARYING_SLOT_x and FRAG_RESULT_x tokens.
blend_per_rt(const struct gl_context *ctx)
{
if (ctx->Color.BlendEnabled &&
- (ctx->Color.BlendEnabled != ((1 << ctx->Const.MaxDrawBuffers) - 1))) {
+ (ctx->Color.BlendEnabled != ((1U << ctx->Const.MaxDrawBuffers) - 1))) {
/* This can only happen if GL_EXT_draw_buffers2 is enabled */
return GL_TRUE;
}
const struct gl_context *ctx = st->ctx;
const struct gl_framebuffer *fb = ctx->DrawBuffer;
GLint miny, maxy;
- int i;
+ unsigned i;
bool changed = false;
for (i = 0 ; i < ctx->Const.MaxViewports; i++) {
scissor[i].minx = 0;
{
struct gl_context *ctx = st->ctx;
GLfloat yScale, yBias;
- int i;
+ unsigned i;
/* _NEW_BUFFERS
*/
if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
{
struct pipe_context *pipe = st->pipe;
struct pipe_resource *resource = strb->texture;
- int rtt_width = strb->Base.Width;
- int rtt_height = strb->Base.Height;
- int rtt_depth = strb->Base.Depth;
+ unsigned rtt_width = strb->Base.Width;
+ unsigned rtt_height = strb->Base.Height;
+ unsigned rtt_depth = strb->Base.Depth;
/*
* For winsys fbo, it is possible that the renderbuffer is sRGB-capable but
* the format of strb->texture is linear (because we have no control over
}
info.indexed = TRUE;
- if (min_index != ~0 && max_index != ~0) {
+ if (min_index != ~0U && max_index != ~0U) {
info.min_index = min_index;
info.max_index = max_index;
}
struct st_config_options *options,
boolean has_lib_dxtc)
{
- int i, glsl_feature_level;
+ unsigned i;
+ int glsl_feature_level;
GLboolean *extension_table = (GLboolean *) extensions;
static const struct st_extension_cap_mapping cap_mapping[] = {
extensions->EXT_texture_integer = GL_FALSE;
}
- consts->UniformBooleanTrue = consts->NativeIntegers ? ~0 : fui(1.0f);
+ consts->UniformBooleanTrue = consts->NativeIntegers ? ~0U : fui(1.0f);
/* Below are the cases which cannot be moved into tables easily. */
unsigned bindings, boolean allow_dxt)
{
struct pipe_screen *screen = st->pipe->screen;
- int i, j;
+ unsigned i;
+ int j;
enum pipe_format pf;
#ifdef DEBUG
if (attribs->major > 1 || attribs->minor > 0) {
/* Is the actual version less than the requested version?
*/
- if (st->ctx->Version < attribs->major * 10 + attribs->minor) {
+ if (st->ctx->Version < attribs->major * 10U + attribs->minor) {
*error = ST_CONTEXT_ERROR_BAD_VERSION;
st_destroy_context(st);
return NULL;
/* find max output slot referenced to compute gs_num_outputs */
for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
- if (outputMapping[attr] != ~0 && outputMapping[attr] > maxSlot)
+ if (outputMapping[attr] != ~0U && outputMapping[attr] > maxSlot)
maxSlot = outputMapping[attr];
}
gs_num_outputs = maxSlot + 1;
{
struct gl_vertex_array_object *vao = ctx->Array.VAO;
const void *elemMap;
- GLint i, k;
+ GLint i;
+ GLuint k;
if (_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) {
elemMap = ctx->Driver.MapBufferRange(ctx, 0,
const void *key, void *data);
static void
-_mesa_hash_table_rehash(struct hash_table *ht, int new_size_index)
+_mesa_hash_table_rehash(struct hash_table *ht, unsigned new_size_index)
{
struct hash_table old_ht;
struct hash_entry *table, *entry;
set_add(struct set *ht, uint32_t hash, const void *key);
static void
-set_rehash(struct set *ht, int new_size_index)
+set_rehash(struct set *ht, unsigned new_size_index)
{
struct set old_ht;
struct set_entry *table, *entry;