summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/bufferobj.c18
-rw-r--r--src/mesa/main/buffers.c2
-rw-r--r--src/mesa/main/clear.c2
-rw-r--r--src/mesa/main/dlist.c2
-rw-r--r--src/mesa/main/errors.c8
-rw-r--r--src/mesa/main/fbobject.c9
-rw-r--r--src/mesa/main/ffvertex_prog.c4
-rw-r--r--src/mesa/main/format_utils.h2
-rw-r--r--src/mesa/main/framebuffer.c2
-rw-r--r--src/mesa/main/matrix.c6
-rw-r--r--src/mesa/main/mipmap.c2
-rw-r--r--src/mesa/main/rastpos.c2
-rw-r--r--src/mesa/main/texgetimage.c6
-rw-r--r--src/mesa/main/varray.c2
14 files changed, 33 insertions, 34 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 2bae1bc72d9..0c1ce984f4a 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2887,7 +2887,7 @@ static void
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],
@@ -2898,7 +2898,7 @@ static void
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;
@@ -2965,7 +2965,7 @@ bind_uniform_buffers_range(struct gl_context *ctx, GLuint first, GLsizei count,
const GLuint *buffers,
const GLintptr *offsets, const GLsizeiptr *sizes)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_uniform_buffers(ctx, first, count,
"glBindBuffersRange"))
@@ -3122,7 +3122,7 @@ unbind_xfb_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++)
_mesa_set_transform_feedback_binding(ctx, tfObj, first + i,
@@ -3136,7 +3136,7 @@ bind_xfb_buffers_base(struct gl_context *ctx,
{
struct gl_transform_feedback_object *tfObj =
ctx->TransformFeedback.CurrentObject;
- GLuint i;
+ GLint i;
if (!error_check_bind_xfb_buffers(ctx, tfObj, first, count,
"glBindBuffersBase"))
@@ -3204,7 +3204,7 @@ bind_xfb_buffers_range(struct gl_context *ctx,
{
struct gl_transform_feedback_object *tfObj =
ctx->TransformFeedback.CurrentObject;
- GLuint i;
+ GLint i;
if (!error_check_bind_xfb_buffers(ctx, tfObj, first, count,
"glBindBuffersRange"))
@@ -3342,7 +3342,7 @@ static void
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],
@@ -3355,7 +3355,7 @@ bind_atomic_buffers_base(struct gl_context *ctx,
GLsizei count,
const GLuint *buffers)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_atomic_buffers(ctx, first, count,
"glBindBuffersBase"))
@@ -3422,7 +3422,7 @@ bind_atomic_buffers_range(struct gl_context *ctx,
const GLintptr *offsets,
const GLsizeiptr *sizes)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_atomic_buffers(ctx, first, count,
"glBindBuffersRange"))
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 49157f7fdf4..a2d02d56154 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -301,7 +301,7 @@ _mesa_DrawBuffer(GLenum buffer)
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);
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index 4671ee245d8..3c4ced8ed06 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -225,7 +225,7 @@ _mesa_Clear( GLbitfield mask )
/** Returned by make_color_buffer_mask() for errors */
-#define INVALID_MASK ~0x0
+#define INVALID_MASK ~0x0U
/**
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 06a038a2eb0..138d3600699 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1021,7 +1021,7 @@ dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes)
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;
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index 4e7853b9066..478e4ed33db 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -134,7 +134,7 @@ static const GLenum debug_severity_enums[] = {
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)
@@ -146,7 +146,7 @@ gl_enum_to_debug_source(GLenum 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)
@@ -158,7 +158,7 @@ gl_enum_to_debug_type(GLenum 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)
@@ -633,7 +633,7 @@ debug_fetch_message(const struct gl_debug_state *debug)
* 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;
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 80dc35394dd..7d91470ed95 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2347,7 +2347,7 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb,
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;
@@ -2441,8 +2441,8 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
}
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;
@@ -2452,8 +2452,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
(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;
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index d5afc3d812c..c51c20ddf02 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -302,7 +302,7 @@ struct ureg {
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;
@@ -578,7 +578,7 @@ static void emit_op3fn(struct tnl_program *p,
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 */
diff --git a/src/mesa/main/format_utils.h b/src/mesa/main/format_utils.h
index 2faaf76f016..7f500ec78da 100644
--- a/src/mesa/main/format_utils.h
+++ b/src/mesa/main/format_utils.h
@@ -163,7 +163,7 @@ _mesa_unsigned_to_unsigned(unsigned src, unsigned dst_size)
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
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 7416bb11892..dc0386d23be 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -345,7 +345,7 @@ update_framebuffer_size(struct gl_context *ctx, struct gl_framebuffer *fb)
}
}
- if (minWidth != ~0) {
+ if (minWidth != ~0U) {
fb->Width = minWidth;
fb->Height = minHeight;
}
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 99a50132170..0539caa4722 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -690,7 +690,7 @@ free_matrix_stack( struct gl_matrix_stack *stack )
*/
void _mesa_init_matrix( struct gl_context * ctx )
{
- GLint i;
+ GLuint i;
/* Initialize matrix stacks */
init_matrix_stack(&ctx->ModelviewMatrixStack, MAX_MODELVIEW_STACK_DEPTH,
@@ -701,7 +701,7 @@ void _mesa_init_matrix( struct gl_context * ctx )
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;
@@ -720,7 +720,7 @@ void _mesa_init_matrix( struct gl_context * ctx )
*/
void _mesa_free_matrix_data( struct gl_context *ctx )
{
- GLint i;
+ GLuint i;
free_matrix_stack(&ctx->ModelviewMatrixStack);
free_matrix_stack(&ctx->ProjectionMatrixStack);
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 3ea04e900bc..75a12cd165b 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -2093,7 +2093,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
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);
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index a9a6ceec0c1..2027a9bd023 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -490,7 +490,7 @@ void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
*/
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;
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index e4572e43b67..ee465e65434 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -596,7 +596,7 @@ get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type,
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);
@@ -707,7 +707,7 @@ _mesa_GetCompressedTexImage_sw(struct gl_context *ctx,
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,
@@ -745,7 +745,7 @@ _mesa_GetCompressedTexImage_sw(struct gl_context *ctx,
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;
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 89aaad1aabd..978ec7b535b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -255,7 +255,7 @@ update_array_format(struct gl_context *ctx,
{
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) {