changes to zdump.c and zic.c invocations of is.* macros
Arthur David Olson
olsona at lecserver.nci.nih.gov
Tue Dec 6 18:35:15 UTC 2005
Below are proposed changes to zic.c and zdump.c to avoid compiler warnings
about invocations of the is.* macros, to meet standard requirements for calling
the macros, and to make the invocations consistent.
I plan to deal with gettext issues in the next round of changes.
--ado
------- zic.c -------
*** /tmp/geta6691 Tue Dec 6 11:01:47 2005
--- /tmp/getb6691 Tue Dec 6 11:01:47 2005
***************
*** 1,4 ****
! static char elsieid[] = "@(#)zic.c 7.124";
/*
** Regardless of the type of time_t, we do our work using this type.
--- 1,4 ----
! static char elsieid[] = "@(#)zic.c 7.125";
/*
** Regardless of the type of time_t, we do our work using this type.
***************
*** 2046,2053 ****
emalloc((int) ((strlen(cp) + 1) * sizeof *array));
nsubs = 0;
for ( ; ; ) {
! while (isascii(*cp) && isspace((unsigned char) *cp))
! ++cp;
if (*cp == '\0' || *cp == '#')
break;
array[nsubs++] = dp = cp;
--- 2046,2054 ----
emalloc((int) ((strlen(cp) + 1) * sizeof *array));
nsubs = 0;
for ( ; ; ) {
! while (isascii((unsigned char) *cp) &&
! isspace((unsigned char) *cp))
! ++cp;
if (*cp == '\0' || *cp == '#')
break;
array[nsubs++] = dp = cp;
***************
*** 2210,2217 ****
*/
cp = string;
wp = NULL;
! while (isascii(*cp) && isalpha(*cp))
! ++cp;
if (cp - string == 0)
wp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string > 3)
--- 2211,2219 ----
*/
cp = string;
wp = NULL;
! while (isascii((unsigned char) *cp) &&
! isalpha((unsigned char) *cp))
! ++cp;
if (cp - string == 0)
wp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string > 3)
***************
*** 2220,2228 ****
wp = _("time zone abbreviation has too many alphabetics");
if (wp == NULL && (*cp == '+' || *cp == '-')) {
++cp;
! if (isascii(*cp) && isdigit(*cp))
! if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
! ++cp;
}
if (*cp != '\0')
wp = _("time zone abbreviation differs from POSIX standard");
--- 2222,2232 ----
wp = _("time zone abbreviation has too many alphabetics");
if (wp == NULL && (*cp == '+' || *cp == '-')) {
++cp;
! if (isascii((unsigned char) *cp) &&
! isdigit((unsigned char) *cp))
! if (*cp++ == '1' &&
! *cp >= '0' && *cp <= '4')
! ++cp;
}
if (*cp != '\0')
wp = _("time zone abbreviation differs from POSIX standard");
------- zdump.c -------
*** /tmp/geta6709 Tue Dec 6 11:01:48 2005
--- /tmp/getb6709 Tue Dec 6 11:01:48 2005
***************
*** 1,4 ****
! static char elsieid[] = "@(#)zdump.c 7.70";
/*
** This code has been made independent of the rest of the time
--- 1,4 ----
! static char elsieid[] = "@(#)zdump.c 7.71";
/*
** This code has been made independent of the rest of the time
***************
*** 209,215 ****
return;
cp = abbrp;
wp = NULL;
! while (isascii(*cp) && isalpha(*cp))
++cp;
if (cp - abbrp == 0)
wp = _("lacks alphabetic at start");
--- 209,215 ----
return;
cp = abbrp;
wp = NULL;
! while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp))
++cp;
if (cp - abbrp == 0)
wp = _("lacks alphabetic at start");
***************
*** 219,227 ****
wp = _("has more than 6 alphabetics");
if (wp == NULL && (*cp == '+' || *cp == '-')) {
++cp;
! if (isascii(*cp) && isdigit(*cp))
! if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
! ++cp;
}
if (*cp != '\0')
wp = _("differs from POSIX standard");
--- 219,228 ----
wp = _("has more than 6 alphabetics");
if (wp == NULL && (*cp == '+' || *cp == '-')) {
++cp;
! if (isascii((unsigned char) *cp) &&
! isdigit((unsigned char) *cp))
! if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
! ++cp;
}
if (*cp != '\0')
wp = _("differs from POSIX standard");
More information about the tz
mailing list