projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge with 3.8.4b
[gnulib.git]
/
lib
/
strftime.c
diff --git
a/lib/strftime.c
b/lib/strftime.c
index
cc4953e
..
cfd41ad
100644
(file)
--- a/
lib/strftime.c
+++ b/
lib/strftime.c
@@
-84,22
+84,18
@@
extern char *tzname[2];
#endif
extern char *tzname[2];
#endif
-#if !__STDC__
-#define const
-#endif
-
/* Types of padding for numbers in date and time. */
enum padding
{
none, blank, zero
};
/* Types of padding for numbers in date and time. */
enum padding
{
none, blank, zero
};
-static char
*
days[] =
+static char
const* const
days[] =
{
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
{
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
-static char
*
months[] =
+static char
const * const
months[] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
@@
-108,7
+104,13
@@
static char *months[] =
/* Add character C to STRING and increment LENGTH,
unless LENGTH would exceed MAX. */
/* Add character C to STRING and increment LENGTH,
unless LENGTH would exceed MAX. */
-#define add_char(c) (length + 1 <= max) && (string[length++] = (c))
+#define add_char(c) \
+ do \
+ { \
+ if (length + 1 <= max) \
+ string[length++] = (c); \
+ } \
+ while (0)
/* Add a 2 digit number to STRING, padding if specified.
Return the number of characters added, up to MAX. */
/* Add a 2 digit number to STRING, padding if specified.
Return the number of characters added, up to MAX. */