Diff for /np2/statsave.c between versions 1.15 and 1.16

version 1.15, 2003/11/08 21:43:00 version 1.16, 2003/11/14 07:37:28
Line 29 Line 29
 #include        "keydisp.h"  #include        "keydisp.h"
   
   
   #if defined(MACOS)
   #define CRLITERAL       "\r"
   #define CRCONST         str_cr
   #elif defined(WIN32) || defined(X11) || defined(SLZAURUS)
   #define CRLITERAL       "\n"
   #define CRCONST         str_lf
   #else
   #define CRLITERAL       "\r\n"
   #define CRCONST         str_crlf
   #endif
   
   
 typedef struct {  typedef struct {
         char    name[16];          char    name[16];
         char    vername[28];          char    vername[28];
Line 90  typedef struct { Line 102  typedef struct {
   
 static void err_append(ERR_BUF *e, char *buf) {  static void err_append(ERR_BUF *e, char *buf) {
   
           int             len;
   
         if ((e) && (buf)) {          if ((e) && (buf)) {
                 if (e->buf) {                  if (e->buf) {
                         int len;  
                         len = strlen(buf);                          len = strlen(buf);
                         if (e->remain >= len) {                          if (e->remain >= len) {
                                 CopyMemory(e->buf, buf, len);                                  CopyMemory(e->buf, buf, len);
Line 945  typedef struct { Line 958  typedef struct {
         DOSTIME time;          DOSTIME time;
 } STATDISK;  } STATDISK;
   
   static const char str_fddx[] = "FDD%u";
   static const char str_sasix[] = "SASI%u";
   static const char str_scsix[] = "SCSI%u";
   static const char str_updated[] = "%s: updated" CRLITERAL;
   static const char str_notfound[] = "%s: not found" CRLITERAL;
   
 static int disksave(NP2FFILE f, const char *path, int readonly) {  static int disksave(NP2FFILE f, const char *path, int readonly) {
   
         STATDISK        st;          STATDISK        st;
Line 1003  static int diskcheck(NP2FFILE f, const c Line 1022  static int diskcheck(NP2FFILE f, const c
                         if ((memcmp(&st.date, &date, sizeof(date))) ||                          if ((memcmp(&st.date, &date, sizeof(date))) ||
                                 (memcmp(&st.time, &time, sizeof(time)))) {                                  (memcmp(&st.time, &time, sizeof(time)))) {
                                 ret |= NP2FLAG_DISKCHG;                                  ret |= NP2FLAG_DISKCHG;
                                 SPRINTF(buf, "%s: updated\n", name);                                  SPRINTF(buf, str_updated, name);
                                 err_append(e, buf);                                  err_append(e, buf);
                         }                          }
                 }                  }
                 else {                  else {
                         ret |= NP2FLAG_DISKCHG;                          ret |= NP2FLAG_DISKCHG;
                         SPRINTF(buf, "%s: not found\n", name);                          SPRINTF(buf, str_notfound, name);
                         err_append(e, buf);                          err_append(e, buf);
                 }                  }
         }          }
Line 1024  static int flagcheck_disk(NP2FFILE f, co Line 1043  static int flagcheck_disk(NP2FFILE f, co
   
         ret = 0;          ret = 0;
         for (i=0; i<4; i++) {          for (i=0; i<4; i++) {
                 SPRINTF(buf, "FDD%d", i+1);                  SPRINTF(buf, str_fddx, i+1);
                 ret |= diskcheck(f, buf, e);                  ret |= diskcheck(f, buf, e);
         }          }
         sxsi_flash();          sxsi_flash();
         for (i=0; i<2; i++) {          for (i=0; i<2; i++) {
                 SPRINTF(buf, "SASI%u", i+1);                  SPRINTF(buf, str_sasix, i+1);
                 ret |= diskcheck(f, buf, e);                  ret |= diskcheck(f, buf, e);
         }          }
         for (i=0; i<2; i++) {          for (i=0; i<2; i++) {
                 SPRINTF(buf, "SCSI%d", i+1);                  SPRINTF(buf, str_scsix, i+1);
                 ret |= diskcheck(f, buf, e);                  ret |= diskcheck(f, buf, e);
         }          }
         (void)t;          (void)t;

Removed from v.1.15  
changed lines
  Added in v.1.16


RetroPC.NET-CVS <cvs@retropc.net>