mesa: Make numSamples an unsigned int
authorGert Wollny <gw.fossdev@gmail.com>
Thu, 18 Jan 2018 08:57:27 +0000 (09:57 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 19 Jan 2018 15:45:57 +0000 (15:45 +0000)
As a followup to the previous patch propagate the change of numSamples
from int to unsigned to gl_config::samples and consequently fix some
-Wsign-compare warnings.

Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/context.c
src/mesa/main/context.h
src/mesa/main/mtypes.h
src/mesa/main/multisample.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_fbo.h

index 53261fea51b26b85f928f9dbf7082c50a3579042..a52c98112e0dce3a63c143e37965313a0074f4cd 100644 (file)
@@ -227,7 +227,7 @@ _mesa_create_visual( GLboolean dbFlag,
                      GLint accumGreenBits,
                      GLint accumBlueBits,
                      GLint accumAlphaBits,
-                     GLint numSamples )
+                     GLuint numSamples )
 {
    struct gl_config *vis = CALLOC_STRUCT(gl_config);
    if (vis) {
@@ -269,7 +269,7 @@ _mesa_initialize_visual( struct gl_config *vis,
                          GLint accumGreenBits,
                          GLint accumBlueBits,
                          GLint accumAlphaBits,
-                         GLint numSamples )
+                         GLuint numSamples )
 {
    assert(vis);
 
index 17fb86c3239a1f35f478f9de7980f0a0bd5c6549..5d9e2ede4738efb13775f3911ebcceeabaf4efca 100644 (file)
@@ -79,7 +79,7 @@ _mesa_create_visual( GLboolean dbFlag,
                      GLint accumGreenBits,
                      GLint accumBlueBits,
                      GLint accumAlphaBits,
-                     GLint numSamples );
+                     GLuint numSamples );
 
 extern GLboolean
 _mesa_initialize_visual( struct gl_config *v,
@@ -95,7 +95,7 @@ _mesa_initialize_visual( struct gl_config *v,
                          GLint accumGreenBits,
                          GLint accumBlueBits,
                          GLint accumAlphaBits,
-                         GLint numSamples );
+                         GLuint numSamples );
 
 extern void
 _mesa_destroy_visual( struct gl_config *vis );
index 1f1792e42631fb4fd8b0ecd552811ab08e677f64..af67d59feff4305e1f074e57edf3693fade85346 100644 (file)
@@ -242,7 +242,7 @@ struct gl_config
 
    /* ARB_multisample / SGIS_multisample */
    GLint sampleBuffers;
-   GLint samples;
+   GLuint samples;
 
    /* SGIX_pbuffer / GLX 1.3 */
    GLint maxPbufferWidth;
index 8ede94b7458f8edfce7fb0fb27c52de8243b00e8..dfe6a3714273209739cbd0b54a725c0119093ebd 100644 (file)
@@ -87,7 +87,7 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
 
    switch (pname) {
    case GL_SAMPLE_POSITION: {
-      if ((int) index >= ctx->DrawBuffer->Visual.samples) {
+      if (index >= ctx->DrawBuffer->Visual.samples) {
          _mesa_error( ctx, GL_INVALID_VALUE, "glGetMultisamplefv(index)" );
          return;
       }
index a982f87b60831ab7935e938342ba22791ee488a8..3a5c03c33548954bbe5108058dd26cfc2b117fda 100644 (file)
@@ -268,7 +268,7 @@ st_new_renderbuffer(struct gl_context *ctx, GLuint name)
  * renderbuffer).  The window system code determines the format.
  */
 struct gl_renderbuffer *
-st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw)
+st_new_renderbuffer_fb(enum pipe_format format, unsigned samples, boolean sw)
 {
    struct st_renderbuffer *strb;
 
index 02dee8657637638b2491d7957d76ab937fc561d8..345c11442c61a79f658c49a16729ddd3ae9ca2c4 100644 (file)
@@ -102,7 +102,7 @@ st_ws_framebuffer(struct gl_framebuffer *fb)
 
 
 extern struct gl_renderbuffer *
-st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw);
+st_new_renderbuffer_fb(enum pipe_format format, unsigned samples, boolean sw);
 
 extern void
 st_update_renderbuffer_surface(struct st_context *st,