From 7a930fb9ac9f37dc3bbefcb0cda8388b35fefbd9 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Mon, 3 Jul 2017 17:50:05 +0200
Subject: [PATCH] Cleanup spm fortran wrapper

---
 spm.c    | 12 ++++++------
 spm.h    |  8 ++++----
 spm_io.c | 22 +++++++++++-----------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/spm.c b/spm.c
index 89c0518f..ec492b5b 100644
--- a/spm.c
+++ b/spm.c
@@ -1115,12 +1115,12 @@ spmExpand( const pastix_spm_t* spm )
  *
  *******************************************************************************/
 int
-spmMatVec(const pastix_trans_t trans,
-          const void          *alpha,
-          const pastix_spm_t  *spm,
-          const void          *x,
-          const void          *beta,
-                void          *y )
+spmMatVec(       pastix_trans_t trans,
+           const void          *alpha,
+           const pastix_spm_t  *spm,
+           const void          *x,
+           const void          *beta,
+                 void          *y )
 {
     pastix_spm_t *espm = (pastix_spm_t*)spm;
     int rc = PASTIX_SUCCESS;
diff --git a/spm.h b/spm.h
index f5d65259..44c214d0 100644
--- a/spm.h
+++ b/spm.h
@@ -103,7 +103,7 @@ void          spm( pastix_spm_t      *spm,
  * @{
  */
 double        spmNorm( pastix_normtype_t ntype, const pastix_spm_t *spm );
-int           spmMatVec(const pastix_trans_t trans, const void *alpha, const pastix_spm_t *spm, const void *x, const void *beta, void *y );
+int           spmMatVec( pastix_trans_t trans, const void *alpha, const pastix_spm_t *spm, const void *x, const void *beta, void *y );
 void          spmScalMatrix( const pastix_complex64_t alpha, pastix_spm_t *spm );
 void          spmScalVector( const double alpha, pastix_spm_t *spm, void *x );
 
@@ -140,8 +140,8 @@ void          spmIntSort2Asc2( void * const pbase, const pastix_int_t n );
  * @name SPM IO subroutines
  * @{
  */
-int           spmLoad( pastix_spm_t *spm, FILE *infile );
-int           spmSave( pastix_spm_t *spm, FILE *outfile );
+int           spmLoad(       pastix_spm_t *spm, FILE *infile );
+int           spmSave( const pastix_spm_t *spm, FILE *outfile );
 
 /**
  * @}
@@ -161,7 +161,7 @@ void *        spm2Dense   ( const pastix_spm_t *spm );
 void          spmPrint    ( const pastix_spm_t *spm, FILE *f );
 void          spmPrintInfo( const pastix_spm_t *spm, FILE *f );
 pastix_spm_t *spmExpand   ( const pastix_spm_t *spm );
-pastix_spm_t *spmDofExtend( const pastix_spm_t *spm, const int type, const int dof  );
+pastix_spm_t *spmDofExtend( const pastix_spm_t *spm, const int type, const int dof );
 
 /**
  * @}
diff --git a/spm_io.c b/spm_io.c
index ecd1ecb1..946cd6f1 100644
--- a/spm_io.c
+++ b/spm_io.c
@@ -637,9 +637,9 @@ spmLoad( pastix_spm_t  *spm,
  *
  *******************************************************************************/
 static inline int
-writeArrayOfComplex64( FILE               *outfile,
-                       pastix_int_t        n,
-                       pastix_complex64_t *array )
+writeArrayOfComplex64( FILE                     *outfile,
+                       pastix_int_t              n,
+                       const pastix_complex64_t *array )
 {
     pastix_int_t i;
 
@@ -678,9 +678,9 @@ writeArrayOfComplex64( FILE               *outfile,
  *
  *******************************************************************************/
 static inline int
-writeArrayOfComplex32( FILE               *outfile,
-                       pastix_int_t        n,
-                       pastix_complex32_t *array )
+writeArrayOfComplex32( FILE                     *outfile,
+                       pastix_int_t              n,
+                       const pastix_complex32_t *array )
 {
     pastix_int_t i;
 
@@ -721,7 +721,7 @@ writeArrayOfComplex32( FILE               *outfile,
 static inline int
 writeArrayOfDouble( FILE         *outfile,
                     pastix_int_t  n,
-                    double       *array )
+                    const double *array )
 {
     pastix_int_t i;
 
@@ -763,7 +763,7 @@ writeArrayOfDouble( FILE         *outfile,
 static inline int
 writeArrayOfFloat( FILE         *outfile,
                    pastix_int_t  n,
-                   float        *array )
+                   const float  *array )
 {
     pastix_int_t i;
 
@@ -788,7 +788,7 @@ writeArrayOfFloat( FILE         *outfile,
  *
  *******************************************************************************
  *
- * @param[inout] spm
+ * @param[in] spm
  *          The sparse matrix to write into the file.
  *
  * @param[in] outfile
@@ -801,8 +801,8 @@ writeArrayOfFloat( FILE         *outfile,
  *
  *******************************************************************************/
 int
-spmSave( pastix_spm_t *spm,
-         FILE         *outfile )
+spmSave( const pastix_spm_t *spm,
+         FILE               *outfile )
 {
     pastix_int_t i, colsize, rowsize;
     int local_stream = 0;
-- 
GitLab