Merge branch 'master' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa
authorBrian <brian@nostromo.localnet.net>
Sat, 27 Jan 2007 01:55:12 +0000 (18:55 -0700)
committerBrian <brian@nostromo.localnet.net>
Sat, 27 Jan 2007 01:55:12 +0000 (18:55 -0700)
src/mesa/main/bufferobj.c
src/mesa/swrast/s_atifragshader.c
src/mesa/swrast/s_buffers.c
src/mesa/swrast/s_context.c
src/mesa/swrast/s_stencil.c
src/mesa/swrast/s_zoom.c

index 3f9f798546525f2332d0db29907022ba9e71ba18..009055a6ab6cba19851b32c212b46e40fe5e9479 100644 (file)
@@ -119,7 +119,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target,
       _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
       return NULL;
    }
-   if ((GLuint) (offset + size) > bufObj->Size) {
+   if (offset + size > bufObj->Size) {
       _mesa_error(ctx, GL_INVALID_VALUE,
                  "%s(size + offset > buffer size)", caller);
       return NULL;
@@ -297,7 +297,7 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
    (void) ctx; (void) target;
 
    /* this should have been caught in _mesa_BufferSubData() */
-   ASSERT((GLuint) (size + offset) <= bufObj->Size);
+   ASSERT(size + offset <= bufObj->Size);
 
    if (bufObj->Data) {
       _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size );
index 75df50b0baa0a60cc4001cef8dc90d983a54fccf..467b8652d817bbddcb3dfbda86a1fa5cdecf6c76 100644 (file)
@@ -325,7 +325,8 @@ execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
    struct atifs_instruction *inst;
    struct atifs_setupinst *texinst;
    GLint optype;
-   GLint i, j, pass;
+   GLuint i;
+   GLint j, pass;
    GLint dstreg;
    GLfloat src[2][3][4];
    GLfloat zeros[4] = { 0.0, 0.0, 0.0, 0.0 };
@@ -348,7 +349,7 @@ execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
 
         /* setup the source registers for color and alpha ops */
         for (optype = 0; optype < 2; optype++) {
-           for (i = 0; i < inst->ArgCount[optype]; i++) {
+           for (i = 0; i < inst->ArgCount[optype]; i++) {
               GLint index = inst->SrcReg[optype][i].Index;
 
               if (index >= GL_REG_0_ATI && index <= GL_REG_5_ATI)
index 284ea2b517874e33e999bee3264d7b57d893c735..35f2dd64909eda10423a0b38f45d42d002301078 100644 (file)
@@ -80,7 +80,10 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
    else {
       ASSERT(span.array->ChanType == GL_FLOAT);
       for (i = 0; i < width; i++) {
-         COPY_4V(span.array->rgba[i], ctx->Color.ClearColor);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][0], ctx->Color.ClearColor[0]);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][1], ctx->Color.ClearColor[1]);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][2], ctx->Color.ClearColor[2]);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][3], ctx->Color.ClearColor[3]);
       }
    }
 
index d4b8080ddc962021538b5fb278f8df751fc69bb9..1c9a098a2d5d8465cbac90f628a9fbdb805c6a1f 100644 (file)
@@ -401,7 +401,7 @@ _swrast_validate_texture_images(GLcontext *ctx)
             GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
             GLuint face;
             for (face = 0; face < numFaces; face++) {
-               GLuint lvl;
+               GLint lvl;
                for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
                   struct gl_texture_image *texImg = texObj->Image[face][lvl];
                   if (texImg && !texImg->Data) {
@@ -439,7 +439,7 @@ _swrast_eject_texture_images(GLcontext *ctx)
             GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
             GLuint face;
             for (face = 0; face < numFaces; face++) {
-               GLuint lvl;
+               GLint lvl;
                for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
                   struct gl_texture_image *texImg = texObj->Image[face][lvl];
                   if (texImg && texImg->Data) {
index dbab6b3c20bc7c5857a92744e3f846077c1e3762..a8aa1d4b6dc26b805008d69692e85075b53988c1 100644 (file)
@@ -1062,7 +1062,8 @@ void
 _swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb,
                           GLint n, GLint x, GLint y, GLstencil stencil[])
 {
-   if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) {
+   if (y < 0 || y >= (GLint) rb->Height ||
+       x + n <= 0 || x >= (GLint) rb->Width) {
       /* span is completely outside framebuffer */
       return; /* undefined values OK */
    }
@@ -1073,7 +1074,7 @@ _swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb,
       n -= dx;
       stencil += dx;
    }
-   if (x + n > rb->Width) {
+   if (x + n > (GLint) rb->Width) {
       GLint dx = x + n - rb->Width;
       n -= dx;
    }
@@ -1103,7 +1104,8 @@ _swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y,
    const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1;
    const GLuint stencilMask = ctx->Stencil.WriteMask[0];
 
-   if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) {
+   if (y < 0 || y >= (GLint) rb->Height ||
+       x + n <= 0 || x >= (GLint) rb->Width) {
       /* span is completely outside framebuffer */
       return; /* undefined values OK */
    }
@@ -1113,7 +1115,7 @@ _swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y,
       n -= dx;
       stencil += dx;
    }
-   if (x + n > rb->Width) {
+   if (x + n > (GLint) rb->Width) {
       GLint dx = x + n - rb->Width;
       n -= dx;
    }
@@ -1191,7 +1193,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
       }
       else {
          /* no bit masking */
-         if (width == rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
+         if (width == (GLint) rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
             /* optimized case */
             /* Note: bottom-to-top raster assumed! */
             GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y);
index 29b8df41b7e42dce1f393f8e4acf8e6a984d8877..036a6084dc31692b43c541b24bbd267b0bad5d37 100644 (file)
@@ -209,7 +209,7 @@ zoom_span( GLcontext *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_4UBV(zoomed.array->color.sz1.rgba[i], rgba[j]);
          }
       }
@@ -219,7 +219,7 @@ zoom_span( GLcontext *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->color.sz2.rgba[i], rgba[j]);
          }
       }
@@ -229,7 +229,7 @@ zoom_span( GLcontext *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->color.sz4.rgba[i], rgba[j]);
          }
       }
@@ -241,7 +241,7 @@ zoom_span( GLcontext *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->color.sz1.rgba[i][0] = rgb[j][0];
             zoomed.array->color.sz1.rgba[i][1] = rgb[j][1];
             zoomed.array->color.sz1.rgba[i][2] = rgb[j][2];
@@ -254,7 +254,7 @@ zoom_span( GLcontext *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->color.sz2.rgba[i][0] = rgb[j][0];
             zoomed.array->color.sz2.rgba[i][1] = rgb[j][1];
             zoomed.array->color.sz2.rgba[i][2] = rgb[j][2];
@@ -267,7 +267,7 @@ zoom_span( GLcontext *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->color.sz4.rgba[i][0] = rgb[j][0];
             zoomed.array->color.sz4.rgba[i][1] = rgb[j][1];
             zoomed.array->color.sz4.rgba[i][2] = rgb[j][2];
@@ -281,7 +281,7 @@ zoom_span( GLcontext *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->index[i] = indexes[j];
       }
    }
@@ -291,7 +291,7 @@ zoom_span( GLcontext *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->z[i] = zValues[j];
       }
       /* Now, fall into either the RGB or COLOR_INDEX path below */