Timezone compiler updated.

This commit is contained in:
Serge Vakulenko
2015-10-20 00:01:42 -07:00
parent 0f920ee55a
commit b134c1f84c
7 changed files with 176 additions and 190 deletions

View File

@@ -1,12 +1,12 @@
# @(#)Makefile 1.6 Makefile 1997/12/28 # @(#)Makefile 1.6 Makefile 1997/12/28
TOPSRC = $(shell cd ../../..; pwd)
DESTDIR= include $(TOPSRC)/target.mk
# If you want something other than Western United States time used on your # If you want something other than Western United States time used on your
# system, change the line below (after finding the zone you want in the # system, change the line below (after finding the zone you want in the
# time zone files, or adding it to a time zone file). # time zone files, or adding it to a time zone file).
# Alternately, if you discover you've got the wrong time zone, you can just # Alternately, if you discover you've got the wrong time zone, you can just
# install -c -m 444 /usr/share/zoneinfo/right_zone /etc/localtime # install -c -m 444 /share/zoneinfo/right_zone /etc/localtime
LOCALTIME= US/Pacific LOCALTIME= US/Pacific
@@ -21,7 +21,7 @@ LOCALTIME= US/Pacific
CFLAGS= -O CFLAGS= -O
SEPFLAG=-i SEPFLAG=-i
LINTFLAGS= -phbaxc LINTFLAGS= -phbaxc
CC= cc CC= cc -g -Wall -Werror
TZCSRCS= zic.c scheck.c ialloc.c TZCSRCS= zic.c scheck.c ialloc.c
TZCOBJS= zic.o scheck.o ialloc.o TZCOBJS= zic.o scheck.o ialloc.o
@@ -36,23 +36,23 @@ ZDUMAN= zdump.0
ZDUMANSRC= zdump.8 ZDUMANSRC= zdump.8
MAN= $(ZICMAN) $(ZDUMAN) MAN= $(ZICMAN) $(ZDUMAN)
MANSRC= $(ZICMANSRC) $(ZDUMAN) MANSRC= $(ZICMANSRC) $(ZDUMAN)
SHARDIR= ${DESTDIR}/usr/share/zoneinfo SHARDIR= ${DESTDIR}/share/zoneinfo
MANDIR= ${DESTDIR}/usr/man/cat8 MANDIR= ${DESTDIR}/man/cat8
all: zdump zic ${ZICMAN} ${ZDUMAN} all: zdump zic ${ZICMAN} ${ZDUMAN}
install: zic $(DATA) $(MAN) install: zic $(DATA) $(MAN)
(umask 22; ./zic -d ${SHARDIR} $(DATA)) (umask 22; ./zic -d ${SHARDIR} $(DATA))
install -c -m 444 -o bin -g bin ${SHARDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime install -c ${SHARDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
install -c -m 444 -o bin -g bin $(ZICMAN) ${MANDIR}/${ZICMAN} # install -c $(ZICMAN) ${MANDIR}/${ZICMAN}
install -c -m 444 -o bin -g bin $(ZDUMAN) ${MANDIR}/${ZDUMAN} # install -c $(ZDUMAN) ${MANDIR}/${ZDUMAN}
install -c -s -m 755 -o bin -g bin zic ${DESTDIR}/usr/sbin/zic # install -c -s zic ${DESTDIR}/sbin/zic
zdump.0: $(ZDUMANSRC) zdump.0: $(ZDUMANSRC)
/usr/man/manroff $(ZDUMANSRC) > $(ZDUMAN) nroff -man $(ZDUMANSRC) > $(ZDUMAN)
zic.0: $(ZICMANSRC) zic.0: $(ZICMANSRC)
/usr/man/manroff $(ZICMANSRC) > $(ZICMAN) nroff -man $(ZICMANSRC) > $(ZICMAN)
zdump: $(TZDOBJS) zdump: $(TZDOBJS)
$(CC) $(CFLAGS) $(LFLAGS) $(SEPFLAG) $(TZDOBJS) -o $@ $(CC) $(CFLAGS) $(LFLAGS) $(SEPFLAG) $(TZDOBJS) -o $@

View File

@@ -1,10 +1,9 @@
/* /*
* @(#)ialloc.c 1.1 ialloc.c 3/4/87 * @(#)ialloc.c 1.1 ialloc.c 3/4/87
*/ */
#include <stdio.h>
/*LINTLIBRARY*/ #include <stdlib.h>
#include <string.h>
#include "stdio.h"
#ifndef alloc_t #ifndef alloc_t
#define alloc_t unsigned #define alloc_t unsigned
@@ -16,11 +15,6 @@
#define NULLMAL(x) ((x) == NULL) #define NULLMAL(x) ((x) == NULL)
#endif /* !MAL */ #endif /* !MAL */
extern char * calloc();
extern char * malloc();
extern char * realloc();
extern char * strcpy();
char * char *
imalloc(n) imalloc(n)
{ {
@@ -63,7 +57,7 @@ char * old;
char * new; char * new;
{ {
register char * result; register char * result;
register oldsize, newsize; register int oldsize, newsize;
oldsize = NULLMAL(old) ? 0 : strlen(old); oldsize = NULLMAL(old) ? 0 : strlen(old);
newsize = NULLMAL(new) ? 0 : strlen(new); newsize = NULLMAL(new) ? 0 : strlen(new);
@@ -80,6 +74,7 @@ char * string;
return icatalloc((char *) NULL, string); return icatalloc((char *) NULL, string);
} }
void
ifree(p) ifree(p)
char * p; char * p;
{ {

View File

@@ -1,11 +1,10 @@
/* /*
* @(#)scheck.c 1.1 scheck.c 3/4/87 * @(#)scheck.c 1.1 scheck.c 3/4/87
*/ */
#include <stdio.h>
/*LINTLIBRARY*/ #include <stdlib.h>
#include <ctype.h>
#include "stdio.h" #include <string.h>
#include "ctype.h"
extern char * imalloc(); extern char * imalloc();

BIN
src/share/zoneinfo/zdump Executable file

Binary file not shown.

View File

@@ -1,39 +1,60 @@
/* /*
* @(#)zdump.c 1.1 zdump.c 3/4/87 * @(#)zdump.c 1.1 zdump.c 3/4/87
*/ */
#include <stdio.h>
#include "stdio.h" #include <stdlib.h>
#include <string.h>
#include "sys/types.h" #include <sys/types.h>
#include "tzfile.h" #include <tzfile.h>
#include "time.h" #include <time.h>
#include <getopt.h>
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
#endif #endif
extern char * asctime(); extern char **environ;
extern char ** environ;
extern struct tm * gmtime();
extern char * imalloc();
extern char * optarg;
extern int optind;
extern char * sprintf();
extern long time();
extern char * tzname[2];
extern void tzset();
/* extern char *imalloc(int);
** For the benefit of cyntax...
*/
static long tzdecode();
static readerr();
static show();
static int longest; static int longest;
static void
show(zone, t, v)
char * zone;
time_t t;
{
struct tm * tmp;
extern struct tm * localtime();
(void) printf("%-*s ", longest, zone);
if (v)
(void) printf("%.24s GMT = ", asctime(gmtime(&t)));
tmp = localtime(&t);
(void) printf("%.24s", asctime(tmp));
if (*tzname[tmp->tm_isdst] != '\0')
(void) printf(" %s", tzname[tmp->tm_isdst]);
if (v) {
(void) printf(" isdst=%d", tmp->tm_isdst);
(void) printf(" gmtoff=%ld", tmp->tm_gmtoff);
}
(void) printf("\n");
}
static void
readerr(fp, progname, filename)
FILE * fp;
char * progname;
char * filename;
{
(void) fprintf(stderr, "%s: Error reading ", progname);
if (ferror(fp))
perror(filename);
else (void) fprintf(stderr, "%s: Premature EOF\n", filename);
exit(1);
}
static long static long
tzdecode(codep) tzdecode(codep)
char * codep; char * codep;
@@ -47,6 +68,7 @@ char * codep;
return result; return result;
} }
int
main(argc, argv) main(argc, argv)
int argc; int argc;
char * argv[]; char * argv[];
@@ -55,7 +77,7 @@ char * argv[];
register int i, j, c; register int i, j, c;
register int vflag; register int vflag;
register char * cutoff; register char * cutoff;
register int cutyear; register int cutyear = 0;
register long cuttime; register long cuttime;
time_t now; time_t now;
time_t t; time_t t;
@@ -68,7 +90,8 @@ char * argv[];
if (c == 'v') if (c == 'v')
vflag = 1; vflag = 1;
else cutoff = optarg; else cutoff = optarg;
if (c != EOF || optind == argc - 1 && strcmp(argv[optind], "=") == 0) { if (c != EOF ||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
(void) fprintf(stderr, "%s: usage is %s [ -v ] zonename ...\n", (void) fprintf(stderr, "%s: usage is %s [ -v ] zonename ...\n",
argv[0], argv[0]); argv[0], argv[0]);
exit(1); exit(1);
@@ -172,38 +195,3 @@ char * argv[];
} }
return 0; return 0;
} }
static
show(zone, t, v)
char * zone;
time_t t;
{
struct tm * tmp;
extern struct tm * localtime();
(void) printf("%-*s ", longest, zone);
if (v)
(void) printf("%.24s GMT = ", asctime(gmtime(&t)));
tmp = localtime(&t);
(void) printf("%.24s", asctime(tmp));
if (*tzname[tmp->tm_isdst] != '\0')
(void) printf(" %s", tzname[tmp->tm_isdst]);
if (v) {
(void) printf(" isdst=%d", tmp->tm_isdst);
(void) printf(" gmtoff=%ld", tmp->tm_gmtoff);
}
(void) printf("\n");
}
static
readerr(fp, progname, filename)
FILE * fp;
char * progname;
char * filename;
{
(void) fprintf(stderr, "%s: Error reading ", progname);
if (ferror(fp))
perror(filename);
else (void) fprintf(stderr, "%s: Premature EOF\n", filename);
exit(1);
}

BIN
src/share/zoneinfo/zic Executable file

Binary file not shown.

View File

@@ -1,15 +1,16 @@
/* /*
* @(#)zic.c 1.1 zic.c 3/4/87 * @(#)zic.c 1.1 zic.c 3/4/87
*/ */
#include <stdio.h>
#include "stdio.h" #include <stdlib.h>
#include "ctype.h" #include <ctype.h>
#include "sys/types.h" #include <sys/types.h>
#include "sys/stat.h" #include <sys/stat.h>
#include "sys/file.h" #include <sys/file.h>
#include "strings.h" #include <strings.h>
#include "time.h" #include <time.h>
#include "tzfile.h" #include <tzfile.h>
#include <getopt.h>
#ifndef BUFSIZ #ifndef BUFSIZ
#define BUFSIZ 1024 #define BUFSIZ 1024
@@ -23,50 +24,47 @@
extern char * icpyalloc(); extern char * icpyalloc();
extern char * imalloc(); extern char * imalloc();
extern char * irealloc(); extern char * irealloc();
extern char * optarg;
extern int optind;
extern char * scheck(); extern char * scheck();
extern char * sprintf();
static addtt(); static void addtt();
static addtype(); static int addtype();
static associate(); static void associate();
static int charcnt; static int charcnt;
static ciequal(); static int ciequal();
static long eitol(); static long eitol();
static int errors; static int errors;
static char * filename; static char * filename;
static char ** getfields(); static char ** getfields();
static long gethms(); static long gethms();
static infile(); static void infile();
static inlink(); static void inlink();
static inrule(); static void inrule();
static inzcont(); static int inzcont();
static inzone(); static int inzone();
static inzsub(); static int inzsub();
static int linenum; static int linenum;
static lowerit(); static int lowerit();
static time_t max_time; static time_t max_time;
static int max_year; static int max_year;
static time_t min_time; static time_t min_time;
static int min_year; static int min_year;
static mkdirs(); static int mkdirs();
static newabbr(); static void newabbr();
static int noise; static int noise;
static nondunlink(); static void nondunlink();
static long oadd(); static long oadd();
static outzone(); static void outzone();
static char * progname; static char * progname;
static char * rfilename; static char * rfilename;
static int rlinenum; static int rlinenum;
static time_t rpytime(); static time_t rpytime();
static rulesub(); static void rulesub();
static setboundaries(); static void setboundaries();
static time_t tadd(); static time_t tadd();
static int timecnt; static int timecnt;
static int tt_signed; static int tt_signed;
static int typecnt; static int typecnt;
static yearistype(); static int yearistype();
/* /*
** Line codes. ** Line codes.
@@ -210,66 +208,66 @@ struct lookup {
static struct lookup * byword(); static struct lookup * byword();
static struct lookup line_codes[] = { static struct lookup line_codes[] = {
"Rule", LC_RULE, { "Rule", LC_RULE },
"Zone", LC_ZONE, { "Zone", LC_ZONE },
"Link", LC_LINK, { "Link", LC_LINK },
NULL, 0 { NULL, 0 }
}; };
static struct lookup mon_names[] = { static struct lookup mon_names[] = {
"January", TM_JANUARY, { "January", TM_JANUARY },
"February", TM_FEBRUARY, { "February", TM_FEBRUARY },
"March", TM_MARCH, { "March", TM_MARCH },
"April", TM_APRIL, { "April", TM_APRIL },
"May", TM_MAY, { "May", TM_MAY },
"June", TM_JUNE, { "June", TM_JUNE },
"July", TM_JULY, { "July", TM_JULY },
"August", TM_AUGUST, { "August", TM_AUGUST },
"September", TM_SEPTEMBER, { "September", TM_SEPTEMBER },
"October", TM_OCTOBER, { "October", TM_OCTOBER },
"November", TM_NOVEMBER, { "November", TM_NOVEMBER },
"December", TM_DECEMBER, { "December", TM_DECEMBER },
NULL, 0 { NULL, 0 }
}; };
static struct lookup wday_names[] = { static struct lookup wday_names[] = {
"Sunday", TM_SUNDAY, { "Sunday", TM_SUNDAY },
"Monday", TM_MONDAY, { "Monday", TM_MONDAY },
"Tuesday", TM_TUESDAY, { "Tuesday", TM_TUESDAY },
"Wednesday", TM_WEDNESDAY, { "Wednesday", TM_WEDNESDAY },
"Thursday", TM_THURSDAY, { "Thursday", TM_THURSDAY },
"Friday", TM_FRIDAY, { "Friday", TM_FRIDAY },
"Saturday", TM_SATURDAY, { "Saturday", TM_SATURDAY },
NULL, 0 { NULL, 0 }
}; };
static struct lookup lasts[] = { static struct lookup lasts[] = {
"last-Sunday", TM_SUNDAY, { "last-Sunday", TM_SUNDAY },
"last-Monday", TM_MONDAY, { "last-Monday", TM_MONDAY },
"last-Tuesday", TM_TUESDAY, { "last-Tuesday", TM_TUESDAY },
"last-Wednesday", TM_WEDNESDAY, { "last-Wednesday", TM_WEDNESDAY },
"last-Thursday", TM_THURSDAY, { "last-Thursday", TM_THURSDAY },
"last-Friday", TM_FRIDAY, { "last-Friday", TM_FRIDAY },
"last-Saturday", TM_SATURDAY, { "last-Saturday", TM_SATURDAY },
NULL, 0 { NULL, 0 }
}; };
static struct lookup begin_years[] = { static struct lookup begin_years[] = {
"minimum", YR_MINIMUM, { "minimum", YR_MINIMUM },
"maximum", YR_MAXIMUM, { "maximum", YR_MAXIMUM },
NULL, 0 { NULL, 0 }
}; };
static struct lookup end_years[] = { static struct lookup end_years[] = {
"minimum", YR_MINIMUM, { "minimum", YR_MINIMUM },
"maximum", YR_MAXIMUM, { "maximum", YR_MAXIMUM },
"only", YR_ONLY, { "only", YR_ONLY },
NULL, 0 { NULL, 0 }
}; };
static int len_months[2][MONS_PER_YEAR] = { static int len_months[2][MONS_PER_YEAR] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
}; };
static int len_years[2] = { static int len_years[2] = {
@@ -306,7 +304,7 @@ char * ptr;
** Error handling. ** Error handling.
*/ */
static static void
eats(name, num, rname, rnum) eats(name, num, rname, rnum)
char * name; char * name;
char * rname; char * rname;
@@ -317,14 +315,14 @@ char * rname;
rlinenum = rnum; rlinenum = rnum;
} }
static static void
eat(name, num) eat(name, num)
char * name; char * name;
{ {
eats(name, num, (char *) NULL, -1); eats(name, num, (char *) NULL, -1);
} }
static static void
error(string) error(string)
char * string; char * string;
{ {
@@ -342,7 +340,7 @@ char * string;
++errors; ++errors;
} }
static static void
usage() usage()
{ {
(void) fprintf(stderr, (void) fprintf(stderr,
@@ -354,6 +352,7 @@ usage()
static char * lcltime = NULL; static char * lcltime = NULL;
static char * directory = NULL; static char * directory = NULL;
int
main(argc, argv) main(argc, argv)
int argc; int argc;
char * argv[]; char * argv[];
@@ -445,7 +444,7 @@ char * argv[];
exit((errors == 0) ? 0 : 1); exit((errors == 0) ? 0 : 1);
} }
static static void
setboundaries() setboundaries()
{ {
register time_t bit; register time_t bit;
@@ -471,7 +470,7 @@ setboundaries()
** We get to be careful here since there's a fair chance of root running us. ** We get to be careful here since there's a fair chance of root running us.
*/ */
static static void
nondunlink(name) nondunlink(name)
char * name; char * name;
{ {
@@ -492,7 +491,7 @@ char * name;
** Sort by rule name. ** Sort by rule name.
*/ */
static static int
rcomp(cp1, cp2) rcomp(cp1, cp2)
char * cp1; char * cp1;
char * cp2; char * cp2;
@@ -501,7 +500,7 @@ char * cp2;
((struct rule *) cp2)->r_name); ((struct rule *) cp2)->r_name);
} }
static static void
associate() associate()
{ {
register struct zone * zp; register struct zone * zp;
@@ -549,7 +548,7 @@ associate()
exit(1); exit(1);
} }
static static void
infile(name) infile(name)
char * name; char * name;
{ {
@@ -674,7 +673,7 @@ char * errstring;
eitol(SECS_PER_MIN) + eitol(ss)); eitol(SECS_PER_MIN) + eitol(ss));
} }
static static void
inrule(fields, nfields) inrule(fields, nfields)
register char ** fields; register char ** fields;
{ {
@@ -700,7 +699,7 @@ register char ** fields;
rules[nrules++] = r; rules[nrules++] = r;
} }
static static int
inzone(fields, nfields) inzone(fields, nfields)
register char ** fields; register char ** fields;
{ {
@@ -732,7 +731,7 @@ register char ** fields;
return inzsub(fields, nfields, FALSE); return inzsub(fields, nfields, FALSE);
} }
static static int
inzcont(fields, nfields) inzcont(fields, nfields)
register char ** fields; register char ** fields;
{ {
@@ -743,7 +742,7 @@ register char ** fields;
return inzsub(fields, nfields, TRUE); return inzsub(fields, nfields, TRUE);
} }
static static int
inzsub(fields, nfields, iscont) inzsub(fields, nfields, iscont)
register char ** fields; register char ** fields;
{ {
@@ -813,7 +812,7 @@ error("Zone continuation line end time is not after end time of previous line");
return hasuntil; return hasuntil;
} }
static static void
inlink(fields, nfields) inlink(fields, nfields)
register char ** fields; register char ** fields;
{ {
@@ -840,7 +839,7 @@ register char ** fields;
links[nlinks++] = l; links[nlinks++] = l;
} }
static static void
rulesub(rp, loyearp, hiyearp, typep, monthp, dayp, timep) rulesub(rp, loyearp, hiyearp, typep, monthp, dayp, timep)
register struct rule * rp; register struct rule * rp;
char * loyearp; char * loyearp;
@@ -981,7 +980,7 @@ char * timep;
} }
} }
static static void
puttzcode(val, fp) puttzcode(val, fp)
long val; long val;
FILE * fp; FILE * fp;
@@ -995,7 +994,7 @@ FILE * fp;
} }
} }
static static void
writezone(name) writezone(name)
char * name; char * name;
{ {
@@ -1042,7 +1041,7 @@ char * name;
} }
} }
static static void
outzone(zpfirst, zonecount) outzone(zpfirst, zonecount)
struct zone * zpfirst; struct zone * zpfirst;
{ {
@@ -1187,7 +1186,7 @@ addtt(starttime, addtype(startoff, startbuf, startisdst));
writezone(zpfirst->z_name); writezone(zpfirst->z_name);
} }
static static void
addtt(starttime, type) addtt(starttime, type)
time_t starttime; time_t starttime;
{ {
@@ -1202,7 +1201,7 @@ time_t starttime;
++timecnt; ++timecnt;
} }
static static int
addtype(gmtoff, abbr, isdst) addtype(gmtoff, abbr, isdst)
long gmtoff; long gmtoff;
char * abbr; char * abbr;
@@ -1215,7 +1214,7 @@ char * abbr;
*/ */
for (i = 0; i < typecnt; ++i) { for (i = 0; i < typecnt; ++i) {
if (gmtoff == gmtoffs[i] && isdst == isdsts[i] && if (gmtoff == gmtoffs[i] && isdst == isdsts[i] &&
strcmp(abbr, &chars[abbrinds[i]]) == 0) strcmp(abbr, &chars[(int)abbrinds[i]]) == 0)
return i; return i;
} }
/* /*
@@ -1239,7 +1238,7 @@ char * abbr;
return i; return i;
} }
static static int
yearistype(year, type) yearistype(year, type)
char * type; char * type;
{ {
@@ -1265,13 +1264,13 @@ char * type;
exit(1); exit(1);
} }
static static int
lowerit(a) lowerit(a)
{ {
return (isascii(a) && isupper(a)) ? tolower(a) : a; return (isascii(a) && isupper(a)) ? tolower(a) : a;
} }
static static int
ciequal(ap, bp) /* case-insensitive equality */ ciequal(ap, bp) /* case-insensitive equality */
register char * ap; register char * ap;
register char * bp; register char * bp;
@@ -1282,7 +1281,7 @@ register char * bp;
return FALSE; return FALSE;
} }
static static int
isabbr(abbr, word) isabbr(abbr, word)
register char * abbr; register char * abbr;
register char * word; register char * word;
@@ -1318,10 +1317,11 @@ register struct lookup * table;
*/ */
foundlp = NULL; foundlp = NULL;
for (lp = table; lp->l_word != NULL; ++lp) for (lp = table; lp->l_word != NULL; ++lp)
if (isabbr(word, lp->l_word)) if (isabbr(word, lp->l_word)) {
if (foundlp == NULL) if (foundlp == NULL)
foundlp = lp; foundlp = lp;
else return NULL; /* multiple inexact matches */ else return NULL; /* multiple inexact matches */
}
return foundlp; return foundlp;
} }
@@ -1368,7 +1368,8 @@ long t2;
register long t; register long t;
t = t1 + t2; t = t1 + t2;
if (t2 > 0 && t <= t1 || t2 < 0 && t >= t1) { if ((t2 > 0 && t <= t1) ||
(t2 < 0 && t >= t1)) {
error("time overflow"); error("time overflow");
exit(1); exit(1);
} }
@@ -1387,7 +1388,8 @@ long t2;
if (t1 == min_time && t2 < 0) if (t1 == min_time && t2 < 0)
return min_time; return min_time;
t = t1 + t2; t = t1 + t2;
if (t2 > 0 && t <= t1 || t2 < 0 && t >= t1) { if ((t2 > 0 && t <= t1) ||
(t2 < 0 && t >= t1)) {
error("time overflow"); error("time overflow");
exit(1); exit(1);
} }
@@ -1490,7 +1492,7 @@ register int wantedy;
return tadd(t, rp->r_tod); return tadd(t, rp->r_tod);
} }
static static void
newabbr(string) newabbr(string)
char * string; char * string;
{ {
@@ -1505,7 +1507,7 @@ char * string;
charcnt += eitol(i); charcnt += eitol(i);
} }
static static int
mkdirs(name) mkdirs(name)
char * name; char * name;
{ {
@@ -1530,7 +1532,9 @@ eitol(i)
long l; long l;
l = i; l = i;
if (i < 0 && l >= 0 || i == 0 && l != 0 || i > 0 && l <= 0) { if ((i < 0 && l >= 0) ||
(i == 0 && l != 0) ||
(i > 0 && l <= 0)) {
(void) fprintf(stderr, "%s: %d did not sign extend correctly\n", (void) fprintf(stderr, "%s: %d did not sign extend correctly\n",
progname, i); progname, i);
exit(1); exit(1);