Blob Blame History Raw
--- src/C/cholmod.c.orig	2020-04-17 00:40:51.000000000 -0600
+++ src/C/cholmod.c	2020-12-24 11:39:50.637202340 -0700
@@ -475,7 +475,8 @@ static PyObject* solve(PyObject *self, P
 {
     matrix *B;
     PyObject *F;
-    int i, n, oB=0, ldB=0, nrhs=-1, sys=0;
+    int i, oB=0, ldB=0, nrhs=-1, sys=0;
+    size_t n;
 #if PY_MAJOR_VERSION >= 3
     const char *descr;
 #else
@@ -522,9 +523,9 @@ static PyObject* solve(PyObject *self, P
     if (nrhs < 0) nrhs = MAT_NCOLS(B);
     if (n == 0 || nrhs == 0) return Py_BuildValue("");
     if (ldB == 0) ldB = MAX(1,MAT_NROWS(B));
-    if (ldB < MAX(1,n)) err_ld("ldB");
+    if (ldB < MAX(1,(int)n)) err_ld("ldB");
     if (oB < 0) err_nn_int("offsetB");
-    if (oB + (nrhs-1)*ldB + n > MAT_LGT(B)) err_buf_len("B");
+    if (oB + (nrhs-1)*ldB + (int)n > MAT_LGT(B)) err_buf_len("B");
 
     cholmod_dense *x;
     cholmod_dense *b = CHOL(allocate_dense)(n, 1, n,
@@ -581,7 +582,8 @@ static PyObject* spsolve(PyObject *self,
     cholmod_sparse *Bc=NULL, *Xc=NULL;
     PyObject *F;
     cholmod_factor *L;
-    int n, sys=0;
+    size_t n;
+    int sys=0;
 #if PY_MAJOR_VERSION >= 3
     const char *descr;
 #else
@@ -623,7 +625,7 @@ static PyObject* spsolve(PyObject *self,
         (SP_ID(B) == COMPLEX && L->xtype == CHOLMOD_REAL))
             PY_ERR_TYPE("B must a sparse matrix of the same "
                 "numerical type as F");
-    if (SP_NROWS(B) != n)
+    if (SP_NROWS(B) != (int)n)
         PY_ERR(PyExc_ValueError, "incompatible dimensions for B");
 
     if (!(Bc = create_matrix(B))) return PyErr_NoMemory();
@@ -777,7 +779,7 @@ static PyObject* linsolve(PyObject *self
             PyErr_Warn(PyExc_UserWarning, "");
     }
 
-    if (L->minor<n) {
+    if (L->minor<(size_t)n) {
         CHOL(free_factor)(&L, &Common);
         PY_ERR(PyExc_ArithmeticError, "singular matrix");
     }
@@ -909,7 +911,7 @@ static PyObject* splinsolve(PyObject *se
             PyErr_Warn(PyExc_UserWarning, "");
     }
 
-    if (L->minor<n) {
+    if (L->minor<(size_t)n) {
         CHOL(free_factor)(&L, &Common);
         PY_ERR(PyExc_ArithmeticError, "singular matrix");
     }
@@ -970,7 +972,8 @@ static PyObject* diag(PyObject *self, Py
 #else
     char *descr;
 #endif
-    int k, strt, incx=1, incy, nrows, ncols;
+    size_t k;
+    int strt, incx=1, incy, nrows, ncols;
 
     if (!set_options()) return NULL;
     if (!PyArg_ParseTuple(args, "O", &F)) return NULL;