fixed pointer arithmetic error in glCopyPixels
[mesa.git] / src / mesa / main / colortab.c
index 61f93be2aadaad6fd986212503b2e9eeed107c25..d9b796c1e7462931fa5cef9317de0c454c19f99f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: colortab.c,v 1.39 2001/04/10 15:25:45 brianp Exp $ */
+/* $Id: colortab.c,v 1.42 2001/09/15 18:02:49 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -127,7 +127,6 @@ _mesa_free_colortable_data( struct gl_color_table *p )
 static void
 set_component_sizes( struct gl_color_table *table )
 {
-   /* XXX what about GLfloat tables? */
    switch (table->Format) {
       case GL_ALPHA:
          table->RedSize = 0;
@@ -812,7 +811,7 @@ _mesa_GetColorTable( GLenum target, GLenum format,
          return;
    }
 
-   _mesa_pack_rgba_span(ctx, table->Size, (const GLchan (*)[]) rgba,
+   _mesa_pack_rgba_span(ctx, table->Size, (const GLchan (*)[4]) rgba,
                         format, type, data, &ctx->Pack, GL_FALSE);
 }
 
@@ -1010,10 +1009,10 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
 
    switch (pname) {
       case GL_COLOR_TABLE_FORMAT:
-         *params = table->IntFormat;
+         *params = (GLfloat) table->IntFormat;
          break;
       case GL_COLOR_TABLE_WIDTH:
-         *params = table->Size;
+         *params = (GLfloat) table->Size;
          break;
       case GL_COLOR_TABLE_RED_SIZE:
          *params = table->RedSize;