## Diff of /blitz/array/eval.cc[d421cd] .. [2b666a]  Maximize  Restore

### Switch to side-by-side view

```--- a/blitz/array/eval.cc
+++ b/blitz/array/eval.cc
@@ -241,7 +241,7 @@
&& expr.isUnitStride(firstRank);

#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE
-    int commonStride = expr.suggestStride(firstRank);
+    diffType commonStride = expr.suggestStride(firstRank);
if (iter.suggestStride(firstRank) > commonStride)
commonStride = iter.suggestStride(firstRank);
bool useCommonStride = iter.isStride(firstRank,commonStride)
@@ -253,7 +253,7 @@
<< useCommonStride);
#endif
#else
-    int commonStride = 1;
+    diffType commonStride = 1;
bool useCommonStride = false;
#endif

@@ -267,7 +267,7 @@
#ifdef BZ_DEBUG_TRAVERSE
#endif
-        int ubound = length(firstRank) * commonStride;
+        diffType ubound = length(firstRank) * commonStride;
T_numtype* restrict data = const_cast<T_numtype*>(iter.data());

if (commonStride == 1)
@@ -276,8 +276,8 @@
for (int i=0; i < ubound; ++i)
#else
-            int n1 = ubound & 3;
-            int i = 0;
+            diffType n1 = ubound & 3;
+            diffType i = 0;
for (; i < n1; ++i)

@@ -289,9 +289,9 @@
#else
-                const int t1 = i+1;
-                const int t2 = i+2;
-                const int t3 = i+3;
+                const diffType t1 = i+1;
+                const diffType t2 = i+2;
+                const diffType t3 = i+3;

_bz_typename T_expr::T_numtype tmp1, tmp2, tmp3, tmp4;

@@ -313,24 +313,24 @@
else {

#ifndef BZ_ARRAY_STACK_TRAVERSAL_UNROLL
-            for (int i=0; i != ubound; i += commonStride)
+            for (diffType i=0; i != ubound; i += commonStride)
#else
-            int n1 = (length(firstRank) & 3) * commonStride;
-
-            int i = 0;
+            diffType n1 = (length(firstRank) & 3) * commonStride;
+
+            diffType i = 0;
for (; i != n1; i += commonStride)

-            int strideInc = 4 * commonStride;
+            diffType strideInc = 4 * commonStride;
for (; i != ubound; i += strideInc)
{
-                int i2 = i + commonStride;
+                diffType i2 = i + commonStride;
-                int i3 = i + 2 * commonStride;
+                diffType i3 = i + 2 * commonStride;
-                int i4 = i + 3 * commonStride;
+                diffType i4 = i + 3 * commonStride;
}
#endif  // BZ_ARRAY_STACK_TRAVERSAL_UNROLL
@@ -437,7 +437,7 @@
* if this optimization has been enabled).
*/
#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE
-    int commonStride = expr.suggestStride(maxRank);
+    diffType commonStride = expr.suggestStride(maxRank);
if (iter.suggestStride(maxRank) > commonStride)
commonStride = iter.suggestStride(maxRank);
bool useCommonStride = iter.isStride(maxRank,commonStride)
@@ -450,7 +450,7 @@
#endif

#else
-    int commonStride = 1;
+    diffType commonStride = 1;
bool useCommonStride = false;
#endif

@@ -537,7 +537,7 @@
*/

// Calculate the end of the innermost loop
-            int ubound = lastLength * commonStride;
+            diffType ubound = lastLength * commonStride;

/*
* This is a real kludge.  I didn't want to have to write
@@ -554,12 +554,12 @@
*/
if (commonStride == 1)
{
-                for (int i=0; i < ubound; ++i)
+                for (diffType i=0; i < ubound; ++i)
}
#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE
else {
-                for (int i=0; i != ubound; i += commonStride)
+                for (diffType i=0; i != ubound; i += commonStride)
}
#endif
@@ -791,13 +791,13 @@
&& expr.isUnitStride(maxRank);

#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE
-    int commonStride = expr.suggestStride(maxRank);
+    diffType commonStride = expr.suggestStride(maxRank);
if (iter.suggestStride(maxRank) > commonStride)
commonStride = iter.suggestStride(maxRank);
bool useCommonStride = iter.isStride(maxRank,commonStride)
&& expr.isStride(maxRank,commonStride);
#else
-    int commonStride = 1;
+    diffType commonStride = 1;
bool useCommonStride = false;
#endif

@@ -830,17 +830,17 @@
if ((useUnitStride) || (useCommonStride))
{
-            int ubound = lastLength * commonStride;
+            diffType ubound = lastLength * commonStride;
T_numtype* restrict data = const_cast<T_numtype*>(iter.data());

if (commonStride == 1)
{
#ifndef BZ_ARRAY_FAST_TRAVERSAL_UNROLL
-                for (int i=0; i < ubound; ++i)
+                for (diffType i=0; i < ubound; ++i)
#else
-                int n1 = ubound & 3;
-                int i=0;
+                diffType n1 = ubound & 3;
+                diffType i=0;
for (; i < n1; ++i)

@@ -855,7 +855,7 @@
}
#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE
else {
-                for (int i=0; i < ubound; i += commonStride)
+                for (diffType i=0; i < ubound; i += commonStride)
}
#endif // BZ_ARRAY_EXPR_USE_COMMON_STRIDE
@@ -920,18 +920,18 @@
&& expr.isUnitStride(minorRank);

#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE
-    int commonStride = expr.suggestStride(minorRank);
+    diffType commonStride = expr.suggestStride(minorRank);
if (iter.suggestStride(minorRank) > commonStride)
commonStride = iter.suggestStride(minorRank);
bool useCommonStride = iter.isStride(minorRank,commonStride)
&& expr.isStride(minorRank,commonStride);
#else
-    int commonStride = 1;
+    diffType commonStride = 1;
bool useCommonStride = false;
#endif

// Determine if a common major stride exists
-    int commonMajorStride = expr.suggestStride(majorRank);
+    diffType commonMajorStride = expr.suggestStride(majorRank);
if (iter.suggestStride(majorRank) > commonMajorStride)
commonMajorStride = iter.suggestStride(majorRank);
bool haveCommonMajorStride = iter.isStride(majorRank,commonMajorStride)
@@ -982,7 +982,7 @@

if ((useUnitStride) && (haveCommonMajorStride))
{
-                    int offset = 0;
+                    diffType offset = 0;
T_numtype* restrict data = const_cast<T_numtype*>
(iter.data());

@@ -992,8 +992,8 @@

// Common subexpression elimination -- compilers
// won't necessarily do this on their own.
-                        int t1 = offset+1;
-                        int t2 = offset+2;
+                        diffType t1 = offset+1;
+                        diffType t2 = offset+2;

@@ -1117,13 +1117,13 @@
&& expr.isUnitStride(minorRank);

#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE
-    int commonStride = expr.suggestStride(minorRank);
+    diffType commonStride = expr.suggestStride(minorRank);
if (iter.suggestStride(minorRank) > commonStride)
commonStride = iter.suggestStride(minorRank);
bool useCommonStride = iter.isStride(minorRank,commonStride)
&& expr.isStride(minorRank,commonStride);
#else
-    int commonStride = 1;
+    diffType commonStride = 1;
bool useCommonStride = false;
#endif

```