|
@@ -146,7 +146,6 @@
|
|
|
#include <bits/uClibc_uintmaxtostr.h>
|
|
|
#include <bits/uClibc_mutex.h>
|
|
|
|
|
|
-
|
|
|
#ifdef __UCLIBC_HAS_WCHAR__
|
|
|
#include <wchar.h>
|
|
|
#endif
|
|
@@ -154,39 +153,6 @@
|
|
|
#include <xlocale.h>
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-#ifdef __UCLIBC_HAS_XLOCALE__
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
|
|
|
-
|
|
|
-#endif
|
|
|
|
|
|
#ifndef __isleap
|
|
|
#define __isleap(y) ( !((y) % 4) && ( ((y) % 100) || !((y) % 400) ) )
|
|
@@ -406,16 +372,16 @@ char *asctime_r(register const struct tm *__restrict ptm,
|
|
|
if (((unsigned int) tmp) >= 100) {
|
|
|
buffer[-1] = *buffer = '?';
|
|
|
} else
|
|
|
-#else
|
|
|
+#else
|
|
|
assert(((unsigned int) tmp) < 100);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
{
|
|
|
*buffer = '0' + (tmp % 10);
|
|
|
#ifdef __BCC__
|
|
|
buffer[-1] = '0' + (tmp/10);
|
|
|
-#else
|
|
|
+#else
|
|
|
buffer[-1] += (tmp/10);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
} while ((buffer -= 2)[-2] == '0');
|
|
|
|
|
@@ -433,8 +399,6 @@ libc_hidden_def(asctime_r)
|
|
|
|
|
|
#include <sys/times.h>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
#ifndef __BCC__
|
|
|
#if CLOCKS_PER_SEC != 1000000L
|
|
|
#error unexpected value for CLOCKS_PER_SEC!
|
|
@@ -814,10 +778,6 @@ time_t timegm(struct tm *timeptr)
|
|
|
|
|
|
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
size_t strftime(char *__restrict s, size_t maxsize,
|
|
|
const char *__restrict format,
|
|
|
const struct tm *__restrict timeptr)
|
|
@@ -1100,18 +1060,18 @@ LOOP:
|
|
|
#ifdef ENABLE_ERA_CODE
|
|
|
if ((mod & NO_E_MOD)
|
|
|
&& (*(o = __XL_NPP(nl_langinfo)(_NL_ITEM(LC_TIME,
|
|
|
- (int)(((unsigned char *)p)[4]))
|
|
|
- __LOCALE_ARG
|
|
|
- )))
|
|
|
+ (int)(((unsigned char *)p)[4]))
|
|
|
+ __LOCALE_ARG
|
|
|
+ )))
|
|
|
) {
|
|
|
p = o;
|
|
|
goto LOOP;
|
|
|
}
|
|
|
#endif
|
|
|
p = __XL_NPP(nl_langinfo)(_NL_ITEM(LC_TIME,
|
|
|
- (int)(*((unsigned char *)p)))
|
|
|
- __LOCALE_ARG
|
|
|
- );
|
|
|
+ (int)(*((unsigned char *)p)))
|
|
|
+ __LOCALE_ARG
|
|
|
+ );
|
|
|
goto LOOP;
|
|
|
}
|
|
|
|
|
@@ -1185,7 +1145,7 @@ LOOP:
|
|
|
* tm_gmtoff value. What we'll do instead is treat the
|
|
|
* timezone name as unknown/invalid and return "???". */
|
|
|
if (!o) {
|
|
|
- o = "???";
|
|
|
+ o = "???";
|
|
|
}
|
|
|
#endif
|
|
|
assert(o != NULL);
|
|
@@ -1239,7 +1199,7 @@ LOOP:
|
|
|
--field_val;
|
|
|
}
|
|
|
} else {
|
|
|
- ISO_LOOP:
|
|
|
+ISO_LOOP:
|
|
|
isofm = (((x[1] - x[0]) + 11) % 7) - 3;
|
|
|
|
|
|
if (x[1] < isofm) {
|
|
@@ -1250,7 +1210,7 @@ LOOP:
|
|
|
|
|
|
field_val = ((x[1] - isofm) / 7) + 1;
|
|
|
days = 365 + __isleap(x[2]);
|
|
|
- isofm = ((isofm + 7*53 + 3 - days)) %7 + days - 3;
|
|
|
+ isofm = ((isofm + 7*53 + 3 - days)) % 7 + days - 3;
|
|
|
if (x[1] >= isofm) {
|
|
|
x[1] -= days;
|
|
|
++x[2];
|
|
@@ -1269,7 +1229,7 @@ LOOP:
|
|
|
}
|
|
|
} else {
|
|
|
i = TP_OFFSETS + (code & 0x1f);
|
|
|
- if ((field_val = load_field(spec[i],timeptr)) < 0) {
|
|
|
+ if ((field_val = load_field(spec[i], timeptr)) < 0) {
|
|
|
goto OUTPUT;
|
|
|
}
|
|
|
|
|
@@ -1281,7 +1241,7 @@ LOOP:
|
|
|
}
|
|
|
if (i & 32) {
|
|
|
field_val %= j;
|
|
|
- if (((i&128) + field_val) == 0) {
|
|
|
+ if (((i & 128) + field_val) == 0) {
|
|
|
field_val = j;
|
|
|
}
|
|
|
}
|
|
@@ -1294,7 +1254,7 @@ LOOP:
|
|
|
if ((code & MASK_SPEC) == STRING_SPEC) {
|
|
|
o_count = SIZE_MAX;
|
|
|
field_val += spec[STRINGS_NL_ITEM_START + (code & 0xf)];
|
|
|
- o = __XL_NPP(nl_langinfo)(_NL_ITEM(LC_TIME, field_val) __LOCALE_ARG );
|
|
|
+ o = __XL_NPP(nl_langinfo)(_NL_ITEM(LC_TIME, field_val) __LOCALE_ARG);
|
|
|
} else {
|
|
|
o_count = ((i >> 1) & 3) + 1;
|
|
|
o = buf + o_count;
|
|
@@ -1335,10 +1295,6 @@ libc_hidden_def(__XL_NPP(strftime))
|
|
|
|
|
|
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
char *strptime(const char *__restrict buf, const char *__restrict format,
|
|
|
struct tm *__restrict tm)
|
|
|
{
|
|
@@ -1560,17 +1516,18 @@ LOOP:
|
|
|
#ifdef ENABLE_ERA_CODE
|
|
|
if ((mod & NO_E_MOD)
|
|
|
&& (*(o = __XL_NPP(nl_langinfo)(_NL_ITEM(LC_TIME,
|
|
|
- (int)(((unsigned char *)p)[4]))
|
|
|
- __LOCALE_ARG
|
|
|
- )))
|
|
|
+ (int)(((unsigned char *)p)[4]))
|
|
|
+ __LOCALE_ARG
|
|
|
+ )))
|
|
|
) {
|
|
|
p = o;
|
|
|
goto LOOP;
|
|
|
}
|
|
|
#endif
|
|
|
p = __XL_NPP(nl_langinfo)(_NL_ITEM(LC_TIME,
|
|
|
- (int)(*((unsigned char *)p)))
|
|
|
- __LOCALE_ARG );
|
|
|
+ (int)(*((unsigned char *)p)))
|
|
|
+ __LOCALE_ARG
|
|
|
+ );
|
|
|
goto LOOP;
|
|
|
}
|
|
|
|
|
@@ -1584,7 +1541,7 @@ LOOP:
|
|
|
do {
|
|
|
--j;
|
|
|
o = __XL_NPP(nl_langinfo)(i+j __LOCALE_ARG);
|
|
|
- if (!__XL_NPP(strncasecmp)(buf,o,strlen(o) __LOCALE_ARG) && *o) {
|
|
|
+ if (!__XL_NPP(strncasecmp)(buf, o, strlen(o) __LOCALE_ARG) && *o) {
|
|
|
do {
|
|
|
++buf;
|
|
|
} while (*++o);
|
|
@@ -1674,7 +1631,7 @@ LOOP:
|
|
|
|
|
|
fields[(*x) >> 3] = i;
|
|
|
|
|
|
- if (((unsigned char)(*x - (10<< 3) + 0 + 0)) <= 8) {
|
|
|
+ if (((unsigned char)(*x - (10 << 3) + 0 + 0)) <= 8) {
|
|
|
if ((j = fields[10]) < 0) {
|
|
|
if (i <= 68) {
|
|
|
i += 100;
|
|
@@ -1830,7 +1787,7 @@ static const char *getnumber(register const char *e, int *pn)
|
|
|
|
|
|
#ifndef __UCLIBC_HAS_TZ_FILE_READ_MANY__
|
|
|
static smallint TZ_file_read;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
static char *read_TZ_file(char *buf)
|
|
|
{
|
|
@@ -1883,13 +1840,9 @@ ERROR:
|
|
|
|
|
|
#endif
|
|
|
|
|
|
-#ifndef __UCLIBC_HAS_CTYPE_TABLES__
|
|
|
-
|
|
|
-#endif
|
|
|
-
|
|
|
void tzset(void)
|
|
|
{
|
|
|
- _time_tzset((time(NULL)) < new_rule_starts);
|
|
|
+ _time_tzset((time(NULL)) < new_rule_starts);
|
|
|
}
|
|
|
|
|
|
void _time_tzset(int use_old_rules)
|
|
@@ -1903,10 +1856,10 @@ void _time_tzset(int use_old_rules)
|
|
|
char c;
|
|
|
#ifdef __UCLIBC_HAS_TZ_FILE__
|
|
|
char buf[TZ_BUFLEN];
|
|
|
-#endif
|
|
|
+#endif
|
|
|
#ifdef __UCLIBC_HAS_TZ_CACHING__
|
|
|
static char oldval[TZ_BUFLEN];
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
__UCLIBC_MUTEX_LOCK(_time_tzlock);
|
|
|
|
|
@@ -1931,12 +1884,12 @@ void _time_tzset(int use_old_rules)
|
|
|
if ((!e
|
|
|
#ifdef __UCLIBC_HAS_TZ_FILE__
|
|
|
&& !(e = read_TZ_file(buf))
|
|
|
-#endif
|
|
|
+#endif
|
|
|
) || !*e) {
|
|
|
ILLEGAL:
|
|
|
#ifdef __UCLIBC_HAS_TZ_CACHING__
|
|
|
*oldval = 0;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
memset(_time_tzinfo, 0, 2*sizeof(rule_struct));
|
|
|
strcpy(_time_tzinfo[0].tzname, UTC);
|
|
|
goto DONE;
|
|
@@ -1954,7 +1907,7 @@ ILLEGAL:
|
|
|
* it is too long, but it that case it will be illegal and will be reset
|
|
|
* to the empty string anyway. */
|
|
|
strncpy(oldval, e, TZ_BUFLEN);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
count = 0;
|
|
|
new_rules[1].tzname[0] = 0;
|
|
@@ -2016,15 +1969,15 @@ SKIP_OFFSET:
|
|
|
} else {
|
|
|
count = 0;
|
|
|
if (!*e) {
|
|
|
- e = use_old_rules ? DEFAULT_RULES : DEFAULT_2007_RULES;
|
|
|
+ e = use_old_rules ? DEFAULT_RULES : DEFAULT_2007_RULES;
|
|
|
#ifdef DEBUG_TZSET
|
|
|
if (e == DEFAULT_RULES)
|
|
|
- printf("tzset: Using old rules.\n");
|
|
|
+ printf("tzset: Using old rules.\n");
|
|
|
else if (e == DEFAULT_2007_RULES)
|
|
|
- printf("tzset: Using new rules\n");
|
|
|
+ printf("tzset: Using new rules\n");
|
|
|
else
|
|
|
- printf("tzset: Using undefined rules\n");
|
|
|
-#endif
|
|
|
+ printf("tzset: Using undefined rules\n");
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
do {
|
|
@@ -2228,7 +2181,6 @@ struct tm attribute_hidden *_time_t2tm(const time_t *__restrict timer,
|
|
|
t = 365;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
*p += ((int) t);
|
|
|
|
|
|
p -= 2;
|
|
@@ -2404,7 +2356,7 @@ DST_CORRECT:
|
|
|
__time_localtime_tzi(&t, (struct tm *)p, tzi);
|
|
|
|
|
|
if (t == ((time_t)(-1))) {
|
|
|
- goto DONE;
|
|
|
+ goto DONE;
|
|
|
}
|
|
|
|
|
|
if ((d < 0) && (((struct tm *)p)->tm_isdst != default_dst)) {
|
|
@@ -2432,10 +2384,6 @@ DONE:
|
|
|
|
|
|
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
size_t wcsftime(wchar_t *__restrict s, size_t maxsize,
|
|
|
const wchar_t *__restrict format,
|
|
|
const struct tm *__restrict timeptr)
|