Index: trunk/psLib/src/imageops/psImageInterpolate.c
===================================================================
--- trunk/psLib/src/imageops/psImageInterpolate.c	(revision 20075)
+++ trunk/psLib/src/imageops/psImageInterpolate.c	(revision 20104)
@@ -7,6 +7,6 @@
  *  @author Paul Price, IfA
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-09-04 20:11:00 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-10-13 21:47:41 $
  *
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
@@ -682,12 +682,17 @@
                   double xSumKernel2 = 0.0; /* Sum of kernel-squared in x */ \
                   float xSumBad = 0.0; /* Sum of bad kernel-squared in x */ \
-                  for (int i = iMin, xPix = xMin; i < iMax; i++, xPix++) { \
+                  /* Dereferenced versions of inputs */ \
+                  const ps##TYPE *imageData = &image->data.TYPE[yPix][xMin]; \
+                  const ps##TYPE *varianceData = &variance->data.TYPE[yPix][xMin]; \
+                  const psMaskType *maskData = &mask->data.PS_TYPE_MASK_DATA[yPix][xMin]; \
+                  for (int i = iMin, xPix = xMin; i < iMax; \
+                           i++, xPix++, imageData++, varianceData++, maskData++) { \
                       float kernelValue = xKernel[i]; /* Value of kernel in x */ \
                       double kernelValue2 = PS_SQR(kernelValue); /* Square of kernel in x */ \
-                      if (mask->data.PS_TYPE_MASK_DATA[yPix][xPix] & maskVal) { \
+                      if (*maskData & maskVal) { \
                           xSumBad += kernelValue2; \
                       } else { \
-                          xSumImage += kernelValue * image->data.TYPE[yPix][xPix]; \
-                          xSumVariance += kernelValue2 * variance->data.TYPE[yPix][xPix]; \
+                          xSumImage += kernelValue * *imageData; \
+                          xSumVariance += kernelValue2 * *varianceData; \
                           xSumKernel += kernelValue; \
                       } \
