Mesa (master): mesa: fix some MSVC signed/unsigned compiler warnings

Brian Paul brianp at kemper.freedesktop.org
Thu Oct 31 14:38:41 UTC 2013


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

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Oct 29 14:11:01 2013 -0600

mesa: fix some MSVC signed/unsigned compiler warnings

---

 src/mesa/main/performance_monitor.c |    6 +++---
 src/mesa/main/uniforms.c            |    2 +-
 src/mesa/main/vdpau.c               |    6 ++++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/performance_monitor.c b/src/mesa/main/performance_monitor.c
index 8dfa826..17cae51 100644
--- a/src/mesa/main/performance_monitor.c
+++ b/src/mesa/main/performance_monitor.c
@@ -127,7 +127,7 @@ _mesa_GetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize,
 
    if (groupsSize > 0 && groups != NULL) {
       unsigned i;
-      unsigned n = MIN2(groupsSize, ctx->PerfMonitor.NumGroups);
+      unsigned n = MIN2((GLuint) groupsSize, ctx->PerfMonitor.NumGroups);
 
       /* We just use the index in the Groups array as the ID. */
       for (i = 0; i < n; i++)
@@ -156,7 +156,7 @@ _mesa_GetPerfMonitorCountersAMD(GLuint group, GLint *numCounters,
 
    if (counters != NULL) {
       unsigned i;
-      unsigned n = MIN2(group_obj->NumCounters, countersSize);
+      unsigned n = MIN2(group_obj->NumCounters, (GLuint) countersSize);
       for (i = 0; i < n; i++) {
          /* We just use the index in the Counters array as the ID. */
          counters[i] = i;
@@ -379,7 +379,7 @@ _mesa_SelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable,
                                    GLuint *counterList)
 {
    GET_CURRENT_CONTEXT(ctx);
-   unsigned i;
+   int i;
    struct gl_perf_monitor_object *m;
    const struct gl_perf_monitor_group *group_obj;
 
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 2e847fe..17e24f6 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -853,7 +853,7 @@ _mesa_GetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex,
    GET_CURRENT_CONTEXT(ctx);
    struct gl_shader_program *shProg;
    struct gl_active_atomic_buffer *ab;
-   int i;
+   GLuint i;
 
    if (!ctx->Extensions.ARB_shader_atomic_counters) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
index e21a26b..3597576 100644
--- a/src/mesa/main/vdpau.c
+++ b/src/mesa/main/vdpau.c
@@ -324,7 +324,7 @@ void GLAPIENTRY
 _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
 {
    GET_CURRENT_CONTEXT(ctx);
-   int i, j;
+   int i;
 
    if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnmapSurfacesNV");
@@ -348,6 +348,7 @@ _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
    for (i = 0; i < numSurfaces; ++i) {
       struct vdp_surface *surf = (struct vdp_surface *)surfaces[i];
       unsigned numTextureNames = surf->output ? 1 : 4;
+      unsigned j;
 
       for (j = 0; j < numTextureNames; ++j) {
          struct gl_texture_object *tex = surf->textures[j];
@@ -377,7 +378,7 @@ void GLAPIENTRY
 _mesa_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
 {
    GET_CURRENT_CONTEXT(ctx);
-   int i, j;
+   int i;
 
    if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnmapSurfacesNV");
@@ -401,6 +402,7 @@ _mesa_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
    for (i = 0; i < numSurfaces; ++i) {
       struct vdp_surface *surf = (struct vdp_surface *)surfaces[i];
       unsigned numTextureNames = surf->output ? 1 : 4;
+      unsigned j;
 
       for (j = 0; j < numTextureNames; ++j) {
          struct gl_texture_object *tex = surf->textures[j];




More information about the mesa-commit mailing list