mesa: Include macros.h in files that use symbols from macros.h.
[mesa.git] / src / mesa / main / histogram.c
index 87816d313296d6fdea0ef0aed66bacd4d32b3bd1..4e482bcd54bca6d83a5def82e1b79df6a209d114 100644 (file)
@@ -29,7 +29,8 @@
 #include "context.h"
 #include "image.h"
 #include "histogram.h"
-#include "glapi/dispatch.h"
+#include "macros.h"
+#include "main/dispatch.h"
 
 
 #if FEATURE_histogram
@@ -189,16 +190,17 @@ pack_histogram( GLcontext *ctx,
          {
             /* temporarily store as GLuints */
             GLuint temp[4*HISTOGRAM_TABLE_SIZE];
-            GLhalfARB *dst = (GLhalfARB *) destination;
+            GLuint *dst = temp;
+            GLhalfARB *half = (GLhalfARB *) destination;
             GLuint i;
             /* get GLuint values */
             PACK_MACRO(GLuint);
             /* convert to GLhalf */
             for (i = 0; i < n * comps; i++) {
-               dst[i] = _mesa_float_to_half((GLfloat) temp[i]);
+               half[i] = _mesa_float_to_half((GLfloat) temp[i]);
             }
             if (packing->SwapBytes) {
-               _mesa_swap2((GLushort *) dst, n * comps);
+               _mesa_swap2((GLushort *) half, n * comps);
             }
          }
          break;