Mesa (master): mesa: Make numSamples an unsigned int

Emil Velikov evelikov at kemper.freedesktop.org
Fri Jan 19 15:54:12 UTC 2018


Module: Mesa
Branch: master
Commit: fef4b16523dea0be0de748fcab7e6367ed8e9542
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fef4b16523dea0be0de748fcab7e6367ed8e9542

Author: Gert Wollny <gw.fossdev at gmail.com>
Date:   Thu Jan 18 09:57:27 2018 +0100

mesa: Make numSamples an unsigned int

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 at gmail.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/context.c            | 4 ++--
 src/mesa/main/context.h            | 4 ++--
 src/mesa/main/mtypes.h             | 2 +-
 src/mesa/main/multisample.c        | 2 +-
 src/mesa/state_tracker/st_cb_fbo.c | 2 +-
 src/mesa/state_tracker/st_cb_fbo.h | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 53261fea51..a52c98112e 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -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);
 
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 17fb86c323..5d9e2ede47 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -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 );
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 1f1792e426..af67d59fef 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -242,7 +242,7 @@ struct gl_config
 
    /* ARB_multisample / SGIS_multisample */
    GLint sampleBuffers;
-   GLint samples;
+   GLuint samples;
 
    /* SGIX_pbuffer / GLX 1.3 */
    GLint maxPbufferWidth;
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 8ede94b745..dfe6a37142 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -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;
       }
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index a982f87b60..3a5c03c335 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -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;
 
diff --git a/src/mesa/state_tracker/st_cb_fbo.h b/src/mesa/state_tracker/st_cb_fbo.h
index 02dee86576..345c11442c 100644
--- a/src/mesa/state_tracker/st_cb_fbo.h
+++ b/src/mesa/state_tracker/st_cb_fbo.h
@@ -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,




More information about the mesa-commit mailing list