From: Brian Paul Date: Sat, 28 Feb 2004 21:19:27 +0000 (+0000) Subject: minor clean-ups X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94f9d4c0dd2b62e01032c2b0dd9b8a25466690c2;p=mesa.git minor clean-ups --- diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 7defce8813b..ba5b4ff17ad 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1003,7 +1003,7 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, { const GLint comps = _mesa_components_in_format(dstFormat); GLfloat luminance[MAX_WIDTH]; - GLfloat (*rgba)[4]; + const GLfloat (*rgba)[4]; GLuint i; if (transferOps) { @@ -1012,10 +1012,8 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, CHECKARRAY(rgbaCopy, return); /* mac 32k limitation */ _mesa_memcpy(rgbaCopy, rgbaIn, n * 4 * sizeof(GLfloat)); - - rgba = (GLfloat (*)[4]) rgbaCopy; - - _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba); + _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgbaCopy); + rgba = (const GLfloat (*)[4]) rgbaCopy; if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) { UNDEFARRAY(rgbaCopy); /* mac 32k limitation */ @@ -1025,12 +1023,13 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, } else { /* use incoming data, not a copy */ - rgba = (GLfloat (*)[4]) rgbaIn; + rgba = (const GLfloat (*)[4]) rgbaIn; } /* XXX clamp rgba to [0,1]? */ if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { + /* compute luminance values */ for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; #if CHAN_TYPE == GL_FLOAT @@ -1984,7 +1983,7 @@ _mesa_pack_rgba_span_chan( GLcontext *ctx, assert(n <= MAX_WIDTH); /* convert color components to floating point */ - for (i=0;i