swrast: fix MSVC signed/unsigned warnings
[mesa.git] / src / mesa / swrast / s_zoom.c
index 3a0e0b626d17461f92443729515eb51262c4beaa..828374f68b19962f2ba1357c338c75cc4d88feaa 100644 (file)
@@ -143,14 +143,14 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
 
    if (!swrast->ZoomedArrays) {
       /* allocate on demand */
-      swrast->ZoomedArrays = (SWspanarrays *) CALLOC(sizeof(SWspanarrays));
+      swrast->ZoomedArrays = (SWspanarrays *) calloc(1, sizeof(SWspanarrays));
       if (!swrast->ZoomedArrays)
          return;
    }
 
    zoomedWidth = x1 - x0;
    ASSERT(zoomedWidth > 0);
-   ASSERT(zoomedWidth <= MAX_WIDTH);
+   ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH);
 
    /* no pixel arrays! must be horizontal spans. */
    ASSERT((span->arrayMask & SPAN_XY) == 0);
@@ -234,7 +234,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
          for (i = 0; i < zoomedWidth; i++) {
             GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
             ASSERT(j >= 0);
-            ASSERT(j < span->end);
+            ASSERT(j < (GLint) span->end);
             COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL0][i], rgba[j]);
          }
       }
@@ -272,7 +272,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
          for (i = 0; i < zoomedWidth; i++) {
             GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
             ASSERT(j >= 0);
-            ASSERT(j < span->end);
+            ASSERT(j < (GLint) span->end);
             zoomed.array->attribs[FRAG_ATTRIB_COL0][i][0] = rgb[j][0];
             zoomed.array->attribs[FRAG_ATTRIB_COL0][i][1] = rgb[j][1];
             zoomed.array->attribs[FRAG_ATTRIB_COL0][i][2] = rgb[j][2];
@@ -373,9 +373,9 @@ _swrast_write_zoomed_stencil_span(struct gl_context *ctx, GLint imgX, GLint imgY
 
    zoomedWidth = x1 - x0;
    ASSERT(zoomedWidth > 0);
-   ASSERT(zoomedWidth <= MAX_WIDTH);
+   ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH);
 
-   zoomedVals = (GLubyte *) malloc(zoomedWidth * sizeof(GLubyte));
+   zoomedVals = malloc(zoomedWidth * sizeof(GLubyte));
    if (!zoomedVals)
       return;
 
@@ -418,9 +418,9 @@ _swrast_write_zoomed_z_span(struct gl_context *ctx, GLint imgX, GLint imgY,
 
    zoomedWidth = x1 - x0;
    ASSERT(zoomedWidth > 0);
-   ASSERT(zoomedWidth <= MAX_WIDTH);
+   ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH);
 
-   zoomedVals = (GLuint *) malloc(zoomedWidth * sizeof(GLuint));
+   zoomedVals = malloc(zoomedWidth * sizeof(GLuint));
    if (!zoomedVals)
       return;