aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2010-11-18 08:49:30 -0800
committerDan Nicolaescu2010-11-18 08:49:30 -0800
commit654ef137a33c238befb60a27e0df1d3855fb025e (patch)
treedadaa6bd3ca7f3a984dc178b22c078b13ff2fbec
parentd30987508cffaccb1988b974b714f0ba9079160b (diff)
downloademacs-654ef137a33c238befb60a27e0df1d3855fb025e.tar.gz
emacs-654ef137a33c238befb60a27e0df1d3855fb025e.zip
Convert definitions to standard C.
* src/strftime.c (my_strftime_gmtime_r, my_strftime_localtime_r) (tm_diff): Convert definitions to standard C. (extra_args_spec_iso): Remove, unused.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/strftime.c27
2 files changed, 11 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 70e646e343d..8753246c92b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12010-11-18 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * strftime.c (my_strftime_gmtime_r, my_strftime_localtime_r)
4 (tm_diff): Convert definitions to standard C.
5 (extra_args_spec_iso): Remove, unused.
6
12010-11-18 Jan Djärv <jan.h.d@swipnet.se> 72010-11-18 Jan Djärv <jan.h.d@swipnet.se>
2 8
3 * xsettings.c (init_gconf): Check HAVE_G_TYPE_INIT. 9 * xsettings.c (init_gconf): Check HAVE_G_TYPE_INIT.
diff --git a/src/strftime.c b/src/strftime.c
index 56c2a2c0fb0..e372e86ec8d 100644
--- a/src/strftime.c
+++ b/src/strftime.c
@@ -179,11 +179,8 @@ extern char *tzname[];
179 Similarly for localtime_r. */ 179 Similarly for localtime_r. */
180 180
181# if ! HAVE_TM_GMTOFF 181# if ! HAVE_TM_GMTOFF
182static struct tm *my_strftime_gmtime_r (const time_t *, struct tm *);
183static struct tm * 182static struct tm *
184my_strftime_gmtime_r (t, tp) 183my_strftime_gmtime_r (const time_t *t, struct tm *tp)
185 const time_t *t;
186 struct tm *tp;
187{ 184{
188 struct tm *l = gmtime (t); 185 struct tm *l = gmtime (t);
189 if (! l) 186 if (! l)
@@ -192,11 +189,8 @@ my_strftime_gmtime_r (t, tp)
192 return tp; 189 return tp;
193} 190}
194 191
195static struct tm *my_strftime_localtime_r (const time_t *, struct tm *);
196static struct tm * 192static struct tm *
197my_strftime_localtime_r (t, tp) 193my_strftime_localtime_r (const time_t *t, struct tm *tp)
198 const time_t *t;
199 struct tm *tp;
200{ 194{
201 struct tm *l = localtime (t); 195 struct tm *l = localtime (t);
202 if (! l) 196 if (! l)
@@ -380,11 +374,8 @@ memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_DECL)
380/* Yield the difference between *A and *B, 374/* Yield the difference between *A and *B,
381 measured in seconds, ignoring leap seconds. */ 375 measured in seconds, ignoring leap seconds. */
382# define tm_diff ftime_tm_diff 376# define tm_diff ftime_tm_diff
383static int tm_diff (const struct tm *, const struct tm *);
384static int 377static int
385tm_diff (a, b) 378tm_diff (const struct tm *a, const struct tm *b)
386 const struct tm *a;
387 const struct tm *b;
388{ 379{
389 /* Compute intervening leap days correctly even if year is negative. 380 /* Compute intervening leap days correctly even if year is negative.
390 Take care to avoid int overflow in leap day calculations, 381 Take care to avoid int overflow in leap day calculations,
@@ -451,7 +442,6 @@ static CHAR_T const month_name[][10] =
451#ifdef my_strftime 442#ifdef my_strftime
452# define extra_args , ut, ns 443# define extra_args , ut, ns
453# define extra_args_spec , int ut, int ns 444# define extra_args_spec , int ut, int ns
454# define extra_args_spec_iso , int ut, int ns
455#else 445#else
456# ifdef COMPILE_WIDE 446# ifdef COMPILE_WIDE
457# define my_strftime wcsftime 447# define my_strftime wcsftime
@@ -462,7 +452,6 @@ static CHAR_T const month_name[][10] =
462# endif 452# endif
463# define extra_args 453# define extra_args
464# define extra_args_spec 454# define extra_args_spec
465# define extra_args_spec_iso
466/* We don't have this information in general. */ 455/* We don't have this information in general. */
467# define ut 0 456# define ut 0
468# define ns 0 457# define ns 0
@@ -471,15 +460,9 @@ static CHAR_T const month_name[][10] =
471#if !defined _LIBC && !defined(WINDOWSNT) && HAVE_TZNAME && HAVE_TZSET 460#if !defined _LIBC && !defined(WINDOWSNT) && HAVE_TZNAME && HAVE_TZSET
472 /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime. 461 /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
473 Work around this bug by copying *tp before it might be munged. */ 462 Work around this bug by copying *tp before it might be munged. */
474 size_t _strftime_copytm (char *, size_t, const char *,
475 const struct tm * extra_args_spec_iso);
476 size_t 463 size_t
477 my_strftime (s, maxsize, format, tp extra_args) 464 my_strftime (CHAR_T *s, size_t maxsize, const CHAR_T *format,
478 CHAR_T *s; 465 const struct tm *tp extra_args_spec)
479 size_t maxsize;
480 const CHAR_T *format;
481 const struct tm *tp;
482 extra_args_spec
483 { 466 {
484 struct tm tmcopy; 467 struct tm tmcopy;
485 tmcopy = *tp; 468 tmcopy = *tp;