/[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 1886 by ksteube, Thu Sep 25 23:11:13 2008 UTC revision 1887 by ksteube, Wed Oct 15 03:26:25 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; }
27    
28  #include <string.h>  #include <string.h>
29  #include <ctype.h>  #include <ctype.h>
30    
# Line 88  int mm_read_unsymmetric_sparse(const cha Line 90  int mm_read_unsymmetric_sparse(const cha
90    
91      for (i=0; i<nz; i++)      for (i=0; i<nz; i++)
92      {      {
93          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");
95          Ip[i]--;  /* adjust from 1-based to 0-based */          Ip[i]--;  /* adjust from 1-based to 0-based */
96          Jp[i]--;          Jp[i]--;
97      }      }

Legend:
Removed from v.1886  
changed lines
  Added in v.1887

  ViewVC Help
Powered by ViewVC 1.1.26