/[escript]/trunk/paso/src/mmio.c
ViewVC logotype

Diff of /trunk/paso/src/mmio.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2143 by ksteube, Wed Oct 15 03:26:25 2008 UTC revision 2144 by artak, Wed Dec 10 00:31:03 2008 UTC
# Line 23  Line 23 
23  #include "Common.h"  #include "Common.h"
24  #include "mmio.h"  #include "mmio.h"
25    
26  #define FSCANF_CHECK(scan_ret, reason) { if (scan_ret == EOF) perror(reason); return -1; }  #define FSCANF_CHECK(scan_ret, reason) { if (scan_ret == EOF) { perror(reason); return -1;} }
27    
28  #include <string.h>  #include <string.h>
29  #include <ctype.h>  #include <ctype.h>
# Line 91  int mm_read_unsymmetric_sparse(const cha Line 91  int mm_read_unsymmetric_sparse(const cha
91      for (i=0; i<nz; i++)      for (i=0; i<nz; i++)
92      {      {
93      int scan_ret = fscanf(f, "%d %d %lg\n", &Ip[i], &Jp[i], &val[i]);      int scan_ret = fscanf(f, "%d %d %lg\n", &Ip[i], &Jp[i], &val[i]);
94      FSCANF_CHECK(scan_ret, "fscanf: mm_read_unsymmetric_sparse");      if (scan_ret!=3)
95        {
96                MEMFREE(Ip);
97                MEMFREE(Jp);
98                MEMFREE(val);
99            fclose(f);
100            return -1;
101        }
102        /*FSCANF_CHECK(scan_ret, "fscanf: mm_read_unsymmetric_sparse");*/
103          Ip[i]--;  /* adjust from 1-based to 0-based */          Ip[i]--;  /* adjust from 1-based to 0-based */
104          Jp[i]--;          Jp[i]--;
105      }      }

Legend:
Removed from v.2143  
changed lines
  Added in v.2144

  ViewVC Help
Powered by ViewVC 1.1.26