Mesa (master): egl: Fix several ' comparison between signed and unsigned integer' warnings

Ian Romanick idr at kemper.freedesktop.org
Fri Sep 24 18:01:16 UTC 2010


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Sep 24 10:54:28 2010 -0700

egl: Fix several 'comparison between signed and unsigned integer' warnings

I hate GCC for requiring the (int) cast on sizeof.

---

 src/egl/drivers/dri2/egl_dri2.c |    4 ++--
 src/egl/drivers/glx/egl_glx.c   |    6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 2b6e368..d17a2ab 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -292,7 +292,7 @@ dri2_process_buffers(struct dri2_egl_surface *dri2_surf,
    struct dri2_egl_display *dri2_dpy =
       dri2_egl_display(dri2_surf->base.Resource.Display);
    xcb_rectangle_t rectangle;
-   int i;
+   unsigned i;
 
    dri2_surf->buffer_count = count;
    dri2_surf->have_fake_front = 0;
@@ -1386,7 +1386,7 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
    xcb_rectangle_t rectangles[16];
    int i;
 
-   if (numRects > ARRAY_SIZE(rectangles))
+   if (numRects > (int)ARRAY_SIZE(rectangles))
       return dri2_copy_region(drv, disp, draw, dri2_surf->region);
 
    /* FIXME: Invert y here? */
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c
index 29bc803..8a46f9c 100644
--- a/src/egl/drivers/glx/egl_glx.c
+++ b/src/egl/drivers/glx/egl_glx.c
@@ -162,7 +162,8 @@ static EGLBoolean
 convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
                  struct GLX_egl_config *GLX_conf)
 {
-   int err = 0, attr, egl_attr, val, i;
+   int err = 0, attr, egl_attr, val;
+   unsigned i;
    EGLint conformant, config_caveat, surface_type;
 
    for (i = 0; i < ARRAY_SIZE(fbconfig_attributes); i++) {
@@ -243,7 +244,8 @@ static EGLBoolean
 convert_visual(Display *dpy, XVisualInfo *vinfo,
                struct GLX_egl_config *GLX_conf)
 {
-   int err, attr, egl_attr, val, i;
+   int err, attr, egl_attr, val;
+   unsigned i;
    EGLint conformant, config_caveat, surface_type;
 
    /* the visual must support OpenGL */




More information about the mesa-commit mailing list