emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102405: Convert definitions to stand


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102405: Convert definitions to standard C.
Date: Mon, 15 Nov 2010 22:44:51 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102405
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Mon 2010-11-15 22:44:51 -0800
message:
  Convert definitions to standard C.
  
  * src/strftime.c (LOCALE_PARAM_DECL): Update for standard C.
  (LOCALE_PARAM, LOCALE_PARAM_PROTO): Remove, unused.
  (memcpy_lowcase, so_week_days, extra_args_spec, emacs_strftimeu):
  Convert definitions to standard C.
  * src/regex.c: Do not include <stdlib.h>, config.h does it.
  Include unistd.h.
  (xrealloc, init_syntax_once, re_match, regcomp, regexec)
  (regerror, regfree): Convert definitions to standard C.
  * src/mktime.c (my_mktime_localtime_r, ydhms_tm_diff, ranged_convert)
  (__mktime_internal): Convert definitions to standard C.
modified:
  src/ChangeLog
  src/mktime.c
  src/regex.c
  src/strftime.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-11-15 17:21:18 +0000
+++ b/src/ChangeLog     2010-11-16 06:44:51 +0000
@@ -1,3 +1,16 @@
+2010-11-16  Dan Nicolaescu  <address@hidden>
+
+       * strftime.c (LOCALE_PARAM_DECL): Update for standard C.
+       (LOCALE_PARAM, LOCALE_PARAM_PROTO): Remove, unused.
+       (memcpy_lowcase, so_week_days, extra_args_spec, emacs_strftimeu):
+       Convert definitions to standard C.
+       * regex.c: Do not include <stdlib.h>, config.h does it.
+       Include unistd.h.
+       (xrealloc, init_syntax_once, re_match, regcomp, regexec)
+       (regerror, regfree): Convert definitions to standard C.
+       * mktime.c (my_mktime_localtime_r, ydhms_tm_diff, ranged_convert)
+       (__mktime_internal): Convert definitions to standard C.
+
 2010-11-15  Dan Nicolaescu  <address@hidden>
 
        * w32proc.c:

=== modified file 'src/mktime.c'
--- a/src/mktime.c      2010-07-02 12:55:51 +0000
+++ b/src/mktime.c      2010-11-16 06:44:51 +0000
@@ -110,9 +110,7 @@
    localtime to localtime_r, since many localtime_r implementations
    are buggy.  */
 static struct tm *
-my_mktime_localtime_r (t, tp)
-     const time_t *t;
-     struct tm *tp;
+my_mktime_localtime_r (const time_t *t,  struct tm *tp)
 {
   struct tm *l = localtime (t);
   if (! l)
@@ -130,9 +128,7 @@
    If TP is null, return a nonzero value.
    If overflow occurs, yield the low order bits of the correct answer.  */
 static time_t
-ydhms_tm_diff (year, yday, hour, min, sec, tp)
-     int year, yday, hour, min, sec;
-     const struct tm *tp;
+ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm 
*tp)
 {
   if (!tp)
     return 1;
@@ -163,14 +159,8 @@
    If *T is out of range for conversion, adjust it so that
    it is the nearest in-range value and then convert that.  */
 static struct tm *
-ranged_convert (convert, t, tp)
-#ifdef PROTOTYPES
-     struct tm *(*convert) (const time_t *, struct tm *);
-#else
-     struct tm *(*convert)();
-#endif
-     time_t *t;
-     struct tm *tp;
+ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
+               time_t *t, struct tm *tp)
 {
   struct tm *r;
 
@@ -217,14 +207,8 @@
    compared to what the result would be for UTC without leap seconds.
    If *OFFSET's guess is correct, only one CONVERT call is needed.  */
 time_t
-__mktime_internal (tp, convert, offset)
-     struct tm *tp;
-#ifdef PROTOTYPES
-     struct tm *(*convert) (const time_t *, struct tm *);
-#else
-     struct tm *(*convert)();
-#endif
-     time_t *offset;
+__mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, 
struct tm *),
+                  time_t *offset)
 {
   time_t t, dt, t0, t1, t2;
   struct tm tm;
@@ -558,5 +542,3 @@
 End:
 */
 
-/* arch-tag: 9456752f-7ddd-47cb-8286-fa807b1355ae
-   (do not change this comment) */

=== modified file 'src/regex.c'
--- a/src/regex.c       2010-10-14 14:32:27 +0000
+++ b/src/regex.c       2010-11-16 06:44:51 +0000
@@ -196,18 +196,14 @@
    even if config.h says that we can.  */
 # undef REL_ALLOC
 
-# if defined STDC_HEADERS || defined _LIBC
-#  include <stdlib.h>
-# else
-char *malloc ();
-char *realloc ();
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
 # endif
 
 /* When used in Emacs's lib-src, we need xmalloc and xrealloc. */
 
 void *
-xmalloc (size)
-     size_t size;
+xmalloc (size_t size)
 {
   register void *val;
   val = (void *) malloc (size);
@@ -220,9 +216,7 @@
 }
 
 void *
-xrealloc (block, size)
-     void *block;
-     size_t size;
+xrealloc (void *block, size_t size)
 {
   register void *val;
   /* We must call malloc explicitly when BLOCK is 0, since some
@@ -435,7 +429,7 @@
 static char re_syntax_table[CHAR_SET_SIZE];
 
 static void
-init_syntax_once ()
+init_syntax_once (void)
 {
    register int c;
    static int done = 0;
@@ -4978,11 +4972,8 @@
 /* re_match is like re_match_2 except it takes only a single string.  */
 
 int
-re_match (bufp, string, size, pos, regs)
-     struct re_pattern_buffer *bufp;
-     const char *string;
-     int size, pos;
-     struct re_registers *regs;
+re_match (struct re_pattern_buffer *bufp, const char *string,
+         int size, int pos, struct re_registers *regs)
 {
   int result = re_match_2_internal (bufp, NULL, 0, (re_char*) string, size,
                                    pos, regs, size);
@@ -6534,10 +6525,8 @@
    the return codes and their meanings.)  */
 
 int
-regcomp (preg, pattern, cflags)
-    regex_t *__restrict preg;
-    const char *__restrict pattern;
-    int cflags;
+regcomp (regex_t *__restrict preg, const char *__restrict pattern,
+        int cflags)
 {
   reg_errcode_t ret;
   reg_syntax_t syntax
@@ -6619,12 +6608,8 @@
    We return 0 if we find a match and REG_NOMATCH if not.  */
 
 int
-regexec (preg, string, nmatch, pmatch, eflags)
-    const regex_t *__restrict preg;
-    const char *__restrict string;
-    size_t nmatch;
-    regmatch_t pmatch[__restrict_arr];
-    int eflags;
+regexec (const regex_t *__restrict preg, const char *__restrict string,
+        size_t nmatch, regmatch_t pmatch[__restrict_arr], int eflags)
 {
   int ret;
   struct re_registers regs;
@@ -6696,11 +6681,7 @@
    error with msvc8 compiler.  */
 
 size_t
-regerror (err_code, preg, errbuf, errbuf_size)
-    int err_code;
-    const regex_t *preg;
-    char *errbuf;
-    size_t errbuf_size;
+regerror (int err_code, const regex_t *preg, char *errbuf, size_t errbuf_size)
 {
   const char *msg;
   size_t msg_size;
@@ -6736,8 +6717,7 @@
 /* Free dynamically allocated space used by PREG.  */
 
 void
-regfree (preg)
-    regex_t *preg;
+regfree (regex_t *preg)
 {
   free (preg->buffer);
   preg->buffer = NULL;
@@ -6756,5 +6736,3 @@
 
 #endif /* not emacs  */
 
-/* arch-tag: 4ffd68ba-2a9e-435b-a21a-018990f9eeb2
-   (do not change this comment) */

=== modified file 'src/strftime.c'
--- a/src/strftime.c    2010-07-04 20:42:36 +0000
+++ b/src/strftime.c    2010-11-16 06:44:51 +0000
@@ -318,14 +318,10 @@
 # undef _NL_CURRENT
 # define _NL_CURRENT(category, item) \
   (current->values[_NL_ITEM_INDEX (item)].string)
-# define LOCALE_PARAM , loc
 # define LOCALE_ARG , loc
-# define LOCALE_PARAM_DECL  __locale_t loc;
-# define LOCALE_PARAM_PROTO , __locale_t loc
+# define LOCALE_PARAM_DECL , __locale_t loc
 # define HELPER_LOCALE_ARG  , current
 #else
-# define LOCALE_PARAM
-# define LOCALE_PARAM_PROTO
 # define LOCALE_ARG
 # define LOCALE_PARAM_DECL
 # ifdef _LIBC
@@ -363,30 +359,16 @@
    more reliable way to accept other sets of digits.  */
 #define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9)
 
-static CHAR_T *memcpy_lowcase (CHAR_T *dest, const CHAR_T *src,
-                               size_t len LOCALE_PARAM_PROTO);
-
 static CHAR_T *
-memcpy_lowcase (dest, src, len LOCALE_PARAM)
-     CHAR_T *dest;
-     const CHAR_T *src;
-     size_t len;
-     LOCALE_PARAM_DECL
+memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_DECL)
 {
   while (len-- > 0)
     dest[len] = TOLOWER ((UCHAR_T) src[len], loc);
   return dest;
 }
 
-static CHAR_T *memcpy_uppcase (CHAR_T *dest, const CHAR_T *src,
-                               size_t len LOCALE_PARAM_PROTO);
-
 static CHAR_T *
-memcpy_uppcase (dest, src, len LOCALE_PARAM)
-     CHAR_T *dest;
-     const CHAR_T *src;
-     size_t len;
-     LOCALE_PARAM_DECL
+memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_DECL)
 {
   while (len-- > 0)
     dest[len] = TOUPPER ((UCHAR_T) src[len], loc);
@@ -437,9 +419,7 @@
 __inline__
 #endif
 static int
-iso_week_days (yday, wday)
-     int yday;
-     int wday;
+iso_week_days (int yday, int wday)
 {
   /* Add enough to the first operand of % to make it nonnegative.  */
   int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
@@ -470,7 +450,7 @@
 
 #ifdef my_strftime
 # define extra_args , ut, ns
-# define extra_args_spec int ut; int ns;
+# define extra_args_spec , int ut, int ns
 # define extra_args_spec_iso , int ut, int ns
 #else
 # ifdef COMPILE_WIDE
@@ -517,13 +497,8 @@
    anywhere, so to determine how many characters would be
    written, use NULL for S and (size_t) UINT_MAX for MAXSIZE.  */
 size_t
-my_strftime (s, maxsize, format, tp extra_args LOCALE_PARAM)
-      CHAR_T *s;
-      size_t maxsize;
-      const CHAR_T *format;
-      const struct tm *tp;
-      extra_args_spec
-      LOCALE_PARAM_DECL
+my_strftime (CHAR_T *s, size_t maxsize, const CHAR_T *format,
+            const struct tm *tp extra_args_spec LOCALE_PARAM_DECL)
 {
 #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL
   struct locale_data *const current = loc->__locales[LC_TIME];
@@ -1474,16 +1449,10 @@
 /* For Emacs we have a separate interface which corresponds to the normal
    strftime function plus the ut argument, but without the ns argument.  */
 size_t
-emacs_strftimeu (s, maxsize, format, tp, ut)
-      char *s;
-      size_t maxsize;
-      const char *format;
-      const struct tm *tp;
-      int ut;
+emacs_strftimeu (char *s, size_t maxsize, const char *format,
+                const struct tm *tp, int ut)
 {
   return my_strftime (s, maxsize, format, tp, ut, 0);
 }
 #endif
 
-/* arch-tag: 662bc9c4-f8e2-41b6-bf96-b8346d0ce0d8
-   (do not change this comment) */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]