summaryrefslogtreecommitdiff
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-03-07 05:06:11 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-03-07 05:06:11 +0000
commitb51b0a847d7e7daaea69f77ab569086ef81c24a2 (patch)
tree165cf8b023e6c7b1f66dacc46a6c37110ef27ea7 /src/mesa/main/image.c
parent249aebdd357d20f6326137c967c6b3923bef6c05 (diff)
fixed a bunch of g++ warnings/errors. Compiling with g++ can help find lots of potential problems
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 89bfcc2759..8fcb5562af 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.57 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: image.c,v 1.58 2001/03/07 05:06:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -620,9 +620,9 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
width_in_bytes = CEILING( width, 8 );
dst = buffer;
for (row = 0; row < height; row++) {
- GLubyte *src = _mesa_image_address( packing, pixels, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- 0, row, 0 );
+ const GLubyte *src = (const GLubyte *)
+ _mesa_image_address(packing, pixels, width, height,
+ GL_COLOR_INDEX, GL_BITMAP, 0, row, 0);
if (!src) {
FREE(buffer);
return NULL;
@@ -640,7 +640,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
if (packing->LsbFirst) {
GLubyte srcMask = 1 << (packing->SkipPixels & 0x7);
GLubyte dstMask = 128;
- GLubyte *s = src;
+ const GLubyte *s = src;
GLubyte *d = dst;
*d = 0;
for (i = 0; i < width; i++) {
@@ -667,7 +667,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
else {
GLubyte srcMask = 128 >> (packing->SkipPixels & 0x7);
GLubyte dstMask = 128;
- GLubyte *s = src;
+ const GLubyte *s = src;
GLubyte *d = dst;
*d = 0;
for (i = 0; i < width; i++) {
@@ -715,9 +715,8 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
width_in_bytes = CEILING( width, 8 );
src = source;
for (row = 0; row < height; row++) {
- GLubyte *dst = _mesa_image_address( packing, dest, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- 0, row, 0 );
+ GLubyte *dst = (GLubyte *) _mesa_image_address( packing, dest,
+ width, height, GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
if (!dst)
return;
@@ -1725,7 +1724,7 @@ _mesa_pack_rgba_span( GLcontext *ctx,
}
else if (transferOps == 0 && dstFormat == GL_RGB && dstType == CHAN_TYPE) {
/* common simple case */
- GLint i;
+ GLuint i;
GLchan *dest = (GLchan *) dstAddr;
for (i = 0; i < n; i++) {
dest[0] = srcRgba[i][RCOMP];
@@ -3591,7 +3590,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLfloat *dest,
* Pack an array of depth values. The values are floats in [0,1].
*/
void
-_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest,
+_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest,
GLenum dstType, const GLfloat *depthSpan,
const struct gl_pixelstore_attrib *dstPacking )
{
@@ -3738,7 +3737,7 @@ _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
}
{
- GLubyte *destBuffer = MALLOC(bytesPerRow * height * depth);
+ GLubyte *destBuffer = (GLubyte *) MALLOC(bytesPerRow * height * depth);
GLubyte *dst;
GLint img, row;
if (!destBuffer)