Index: trunk/psLib/src/math/psSparse.c
===================================================================
--- trunk/psLib/src/math/psSparse.c	(revision 7380)
+++ trunk/psLib/src/math/psSparse.c	(revision 7550)
@@ -29,5 +29,5 @@
 
 // allocate a sparse matrix container for Nrows, with Nelem slots allocated
-psSparse *psSparseAlloc(long Nrows, long Nelem)
+psSparse *psSparseAlloc(int Nrows, int Nelem)
 {
     psSparse *sparse = (psSparse *)psAlloc(sizeof(psSparse));
@@ -54,5 +54,5 @@
 
 // user should only add elements above the diagonal, but we don't check this
-bool psSparseMatrixElement(psSparse *sparse, long i, long j, float value)
+bool psSparseMatrixElement(psSparse *sparse, int i, int j, float value)
 {
     PS_ASSERT_PTR_NON_NULL(sparse, false);
@@ -62,5 +62,5 @@
     if (i < j) {
         psLogMsg(__func__, PS_LOG_WARN, "i=%ld, j=%ld refers to a sub-diagonal element; values switched.\n");
-        long temp = i;
+        int temp = i;
         i = j;
         j = temp;
@@ -78,5 +78,5 @@
         }
 
-        long k = sparse->Nelem;         // Index at which to add
+        int k = sparse->Nelem;         // Index at which to add
         sparse->Aij->data.F32[k] = value;
         sparse->Si->data.S32[k]  = i;
@@ -95,5 +95,5 @@
         }
 
-        long k = sparse->Nelem;         // Index at which to add
+        int k = sparse->Nelem;         // Index at which to add
         sparse->Aij->data.F32[k] = value;
         sparse->Si->data.S32[k]  = i;
@@ -114,5 +114,5 @@
 }
 
-void inline psSparseVectorElement(psSparse *sparse, long i, float value)
+void inline psSparseVectorElement(psSparse *sparse, int i, float value)
 {
 
@@ -129,9 +129,9 @@
     output = psVectorRecycle(output, vector->n, PS_TYPE_F32);
 
-    long Nelem = 0;                     // Number of elements
-    for (long j = 0; j < vector->n; j++) {
+    int Nelem = 0;                     // Number of elements
+    for (int j = 0; j < vector->n; j++) {
         double F = 0;                    // Running total
         while (matrix->Sj->data.S32[Nelem] == j) {
-            long i = matrix->Si->data.S32[Nelem];
+            int i = matrix->Si->data.S32[Nelem];
             F += vector->data.F32[i] * matrix->Aij->data.F32[Nelem];
             Nelem++;
@@ -158,7 +158,7 @@
     dQ->n = output->n;
 
-    for (long j = 0; j < Niter; j++) {
+    for (int j = 0; j < Niter; j++) {
         dQ = psSparseMatrixTimesVector(dQ, sparse, output);
-        for (long i = 0; i < dQ->n; i++) {
+        for (int i = 0; i < dQ->n; i++) {
             psF32 dG = (dQ->data.F32[i] - Bfj->data.F32[i]) / Qii->data.F32[i];
             if (fabs (dG) > constraint.paramDelta) {
@@ -181,5 +181,5 @@
 bool psSparseResort(psSparse *sparse)
 {
-    long Nelem = sparse->Nelem;
+    int Nelem = sparse->Nelem;
 
     psVector *index = psVectorSortIndex(NULL, sparse->Sj); // Index key for sorting
@@ -198,6 +198,6 @@
     tAij->n = tSi->n = tSj->n = Nelem;
 
-    for (long i = 0; i < Nelem; i++) {
-        long j = index->data.U32[i];
+    for (int i = 0; i < Nelem; i++) {
+        int j = index->data.U32[i];
         tAij->data.F32[i] = Aij->data.F32[j];
         tSi->data.S32[i]  = Si->data.S32[j];
