/[emacs]/emacs/lib-src/update-game-score.c
ViewVC logotype

Diff of /emacs/lib-src/update-game-score.c

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

revision 1.10.2.1 by miles, Fri Apr 4 06:19:55 2003 UTC revision 1.10.2.2 by miles, Tue Oct 14 23:59:14 2003 UTC
# Line 1  Line 1 
1  /* update-game-score.c --- Update a score file  /* update-game-score.c --- Update a score file
2     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3    
4  This file is part of GNU Emacs.  This file is part of GNU Emacs.
5    
# Line 68  extern int optind, opterr; Line 68  extern int optind, opterr;
68  #define P_(proto) ()  #define P_(proto) ()
69  #endif  #endif
70    
71    #ifndef HAVE_DIFFTIME
72    /* OK on POSIX (time_t is arithmetic type) modulo overflow in subtraction.  */
73    #define difftime(t1, t0) (double)((t1) - (t0))
74    #endif
75    
76  int  int
77  usage (err)  usage (err)
78       int err;       int err;
# Line 111  lose (msg) Line 116  lose (msg)
116    
117  void lose_syserr P_ ((const char *msg)) NO_RETURN;  void lose_syserr P_ ((const char *msg)) NO_RETURN;
118    
119    /* Taken from sysdep.c.  */
120    #ifndef HAVE_STRERROR
121    #ifndef WINDOWSNT
122    char *
123    strerror (errnum)
124         int errnum;
125    {
126      extern char *sys_errlist[];
127      extern int sys_nerr;
128    
129      if (errnum >= 0 && errnum < sys_nerr)
130        return sys_errlist[errnum];
131      return (char *) "Unknown error";
132    }
133    #endif /* not WINDOWSNT */
134    #endif /* ! HAVE_STRERROR */
135    
136  void  void
137  lose_syserr (msg)  lose_syserr (msg)
138       const char *msg;       const char *msg;
# Line 357  read_scores (filename, scores, count) Line 379  read_scores (filename, scores, count)
379        scorecount++;        scorecount++;
380        if (scorecount >= cursize)        if (scorecount >= cursize)
381          {          {
382            ret = (struct score_entry *) realloc (ret, cursize *= 2);            cursize *= 2;
383              ret = (struct score_entry *)
384                realloc (ret, (sizeof (struct score_entry) * cursize));
385            if (!ret)            if (!ret)
386              return -1;              return -1;
387          }          }
# Line 504  unlock_file (filename, state) Line 528  unlock_file (filename, state)
528    errno = saved_errno;    errno = saved_errno;
529    return ret;    return ret;
530  }  }
531    
532    /* arch-tag: 2bf5c52e-4beb-463a-954e-c58b9c64736b
533       (do not change this comment) */

Legend:
Removed from v.1.10.2.1  
changed lines
  Added in v.1.10.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26