bammi@dsrgsun.ces.cwru.edu (Jwahar R. Bammi) (11/28/88)
#!/bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #!/bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# lib-update1.diff
# This archive created: Thu Oct 27 21:59:59 1988
# By: Jwahar R. Bammi(Case Western Reserve University)
# Uucp: {decvax,sun,att}!cwjcc!dsrgsun!bammi
# Csnet: bammi@dsrgsun.ces.CWRU.edu
# Arpa: bammi@dsrgsun.ces.CWRU.edu
#
export PATH; PATH=/bin:$PATH
echo shar: extracting "'lib-update1.diff'" '(22499 characters)'
if test -f 'lib-update1.diff'
then
echo shar: over-writing existing file "'lib-update1.diff'"
fi
sed 's/^X//' << \SHAR_EOF > 'lib-update1.diff'
Xdiff -rc5 tmp/Makefile.16 gnulib/Makefile.16
X*** tmp/Makefile.16 Sun Nov 27 15:51:15 1988
X--- gnulib/Makefile.16 Sat Nov 26 03:12:18 1988
X***************
X*** 1,20 ****
X .SUFFIXES: .s .cpp
X
X- .cpp.s:
X- /lib/cpp -P -D__GNUC__ -D__MSHORT__ $*.cpp > $*.s
X-
X CROSSDIR = /dsrg/bammi/cross-minix
X CROSSLIB = $(CROSSDIR)/lib
X
X AR = /dsrg/bammi/cross-gcc/bin/car
X CC = /dsrg/bammi/cross-minix/bin/mgcc
X CFLAGS = -O -mshort -DATARI_ST
X AS = $(CC) $(CFLAGS) -c
X
X SFILES = stbrksz.s stcatch.s stcrtso.s sthead.s stsetjmp.s stsndrec.s
X
X O1 = gtty.o stty.o termcap.o \
X ctime.o popen.o puts.o qsort.o system.o \
X access.o atol.o chmod.o \
X chown.o cleanup.o crypt.o ctype.o dup.o dup2.o \
X exec.o exit.o fgets.o fork.o fprintf.o fputs.o fread.o \
X--- 1,21 ----
X .SUFFIXES: .s .cpp
X
X CROSSDIR = /dsrg/bammi/cross-minix
X CROSSLIB = $(CROSSDIR)/lib
X
X AR = /dsrg/bammi/cross-gcc/bin/car
X CC = /dsrg/bammi/cross-minix/bin/mgcc
X+ CPP = /lib/cpp
X CFLAGS = -O -mshort -DATARI_ST
X AS = $(CC) $(CFLAGS) -c
X
X SFILES = stbrksz.s stcatch.s stcrtso.s sthead.s stsetjmp.s stsndrec.s
X
X+ .cpp.s:
X+ $(CPP) -P -D__GNUC__ -D__MSHORT__ $*.cpp > $*.s
X+
X O1 = gtty.o stty.o termcap.o \
X ctime.o popen.o puts.o qsort.o system.o \
X access.o atol.o chmod.o \
X chown.o cleanup.o crypt.o ctype.o dup.o dup2.o \
X exec.o exit.o fgets.o fork.o fprintf.o fputs.o fread.o \
X***************
X*** 34,44 ****
X unlink.o utime.o wait.o write.o call.o message.o stbrksz.o \
X stsndrec.o stsetjmp.o
X
X O5 = getopt.o alloca.o getwd.o ldexp.o atof.o eprintf.o
X
X! GNUSTUFF = fixnum.o flonum.o
X
X ALL = head.o crtso.o libc.a
X
X all: install
X
X--- 35,45 ----
X unlink.o utime.o wait.o write.o call.o message.o stbrksz.o \
X stsndrec.o stsetjmp.o
X
X O5 = getopt.o alloca.o getwd.o ldexp.o atof.o eprintf.o
X
X! GNUSTUFF = fixnum.o sflonum.o dflonum.o
X
X ALL = head.o crtso.o libc.a
X
X all: install
X
X***************
X*** 71,75 ****
X--- 72,83 ----
X stcatch.s : stcatch.cpp
X stcrtso.s : stcrtso.cpp
X sthead.s : sthead.cpp
X stsetjmp.s : stsetjmp.cpp
X stsndrec.s : stsndrec.cpp
X+
X+ #
X+ # Note: dflonum.c *must* be compiled with 32 bit ints
X+ # (no -mshort flag to gcc)
X+ #
X+ dflonum.o : dflonum.c flonum.h
X+ $(CC) -O -DATARI_ST -c dflonum.c
Xdiff -rc5 tmp/Makefile.32 gnulib/Makefile.32
X*** tmp/Makefile.32 Sun Nov 27 15:51:15 1988
X--- gnulib/Makefile.32 Sat Nov 26 03:12:05 1988
X***************
X*** 1,20 ****
X .SUFFIXES: .s .cpp
X
X- .cpp.s:
X- /lib/cpp -P -D__GNUC__ $*.cpp > $*.s
X-
X CROSSDIR = /dsrg/bammi/cross-minix
X CROSSLIB = $(CROSSDIR)/lib
X
X AR = /dsrg/bammi/cross-gcc/bin/car
X CC = /dsrg/bammi/cross-minix/bin/mgcc
X CFLAGS = -O -DATARI_ST
X AS = $(CC) $(CFLAGS) -c
X
X SFILES = stbrksz.s stcatch.s stcrtso.s sthead.s stsetjmp.s stsndrec.s
X
X O1 = gtty.o stty.o termcap.o \
X ctime.o popen.o puts.o qsort.o system.o \
X access.o atol.o chmod.o \
X chown.o cleanup.o crypt.o ctype.o dup.o dup2.o \
X exec.o exit.o fgets.o fork.o fprintf.o fputs.o fread.o \
X--- 1,22 ----
X .SUFFIXES: .s .cpp
X
X CROSSDIR = /dsrg/bammi/cross-minix
X CROSSLIB = $(CROSSDIR)/lib
X
X AR = /dsrg/bammi/cross-gcc/bin/car
X CC = /dsrg/bammi/cross-minix/bin/mgcc
X+ CPP = /lib/cpp
X CFLAGS = -O -DATARI_ST
X AS = $(CC) $(CFLAGS) -c
X
X SFILES = stbrksz.s stcatch.s stcrtso.s sthead.s stsetjmp.s stsndrec.s
X
X+ .cpp.s:
X+ $(CPP) -P -D__GNUC__ $*.cpp > $*.s
X+
X+
X O1 = gtty.o stty.o termcap.o \
X ctime.o popen.o puts.o qsort.o system.o \
X access.o atol.o chmod.o \
X chown.o cleanup.o crypt.o ctype.o dup.o dup2.o \
X exec.o exit.o fgets.o fork.o fprintf.o fputs.o fread.o \
X***************
X*** 35,45 ****
X unlink.o utime.o wait.o write.o call.o message.o stbrksz.o \
X stsndrec.o stsetjmp.o
X
X O5 = getopt.o alloca.o getwd.o ldexp.o atof.o eprintf.o
X
X! GNUSTUFF = fixnum.o flonum.o
X
X ALL = head32.o crtso32.o libc32.a
X
X all: install
X
X--- 37,47 ----
X unlink.o utime.o wait.o write.o call.o message.o stbrksz.o \
X stsndrec.o stsetjmp.o
X
X O5 = getopt.o alloca.o getwd.o ldexp.o atof.o eprintf.o
X
X! GNUSTUFF = fixnum.o sflonum.o dflonum.o
X
X ALL = head32.o crtso32.o libc32.a
X
X all: install
X
X***************
X*** 72,76 ****
X--- 74,81 ----
X stcatch.s : stcatch.cpp
X stcrtso.s : stcrtso.cpp
X sthead.s : sthead.cpp
X stsetjmp.s : stsetjmp.cpp
X stsndrec.s : stsndrec.cpp
X+
X+ dflonum.o : dflonum.c flonum.h
X+ $(CC) -O -DATARI_ST -c dflonum.c
Xdiff -rc5 tmp/ctime.c gnulib/ctime.c
X*** tmp/ctime.c Sun Nov 27 15:51:37 1988
X--- gnulib/ctime.c Sat Nov 19 19:38:48 1988
X***************
X*** 1,5 ****
X--- 1,12 ----
X+ /* to do:
X+ * somehow compensate for TZ in localtime
X+ * tm.tm_isdst?? related to above
X+ *
X+ * ++jrb
X+ */
X+
X #include <time.h>
X
X static int days_per_month[] = {
X 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
X };
X***************
X*** 6,66 ****
X static char *months[] = {
X "Jan", "Feb", "Mar", "Apr", "May", "Jun",
X "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
X };
X static char *days[] = {
X! "Thu", "Fri", "Sat", "Sun", "Mon", "Tue", "Wed"
X };
X
X! #define MIN 60L
X! #define HOUR (60 * MIN)
X! #define DAY (24 * HOUR)
X! #define YEAR (365 * DAY)
X
X static struct tm tm;
X
X! char *
X! ctime(pt)
X long *pt;
X {
X! static char buf[26];
X register long t = *pt;
X
X tm.tm_year = 0;
X tm.tm_mon = 0;
X tm.tm_mday = 1;
X tm.tm_hour = 0;
X tm.tm_min = 0;
X tm.tm_sec = 0;
X! while (t >= YEAR) {
X! if ((tm.tm_year % 4) == 2)
X! t -= DAY;
X tm.tm_year += 1;
X! t -= YEAR;
X }
X tm.tm_year += 1970;
X days_per_month[1] = 28;
X! if ((tm.tm_year % 4) == 0)
X days_per_month[1]++;
X while (t >= (days_per_month[tm.tm_mon] * DAY))
X t -= days_per_month[tm.tm_mon++] * DAY;
X while (t >= DAY) {
X t -= DAY;
X tm.tm_mday++;
X }
X while (t >= HOUR) {
X t -= HOUR;
X tm.tm_hour++;
X }
X while (t >= MIN) {
X t -= MIN;
X tm.tm_min++;
X }
X tm.tm_sec = (int) t;
X sprintf(buf, "%s %s %2d %02d:%02d:%02d %d\n",
X! days[(t / DAY) % 7], months[tm.tm_mon],
X! tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year);
X return buf;
X }
X
X struct tm *localtime(pt)
X long *pt;
X--- 13,93 ----
X static char *months[] = {
X "Jan", "Feb", "Mar", "Apr", "May", "Jun",
X "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
X };
X static char *days[] = {
X! "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
X };
X
X! #define MIN 60L /* # seconds in a minute */
X! #define HOUR (60 * MIN) /* # seconds in an hour */
X! #define DAY (24 * HOUR) /* # seconds in a day */
X! #define YEAR (365 * DAY) /* # seconds in a year */
X
X static struct tm tm;
X
X! char *ctime(pt)
X long *pt;
X {
X! static char buf[26];
X register long t = *pt;
X
X+ long year;
X+
X tm.tm_year = 0;
X tm.tm_mon = 0;
X tm.tm_mday = 1;
X tm.tm_hour = 0;
X tm.tm_min = 0;
X tm.tm_sec = 0;
X!
X! /* t is elapsed time in seconds since Jan 1, 1970. */
X! tm.tm_wday = (int) (t/DAY + 4L) % 7; /* Jan 1, 1970 is 4th wday */
X! while (t >= (year=((tm.tm_year%4)==2) ? YEAR+DAY : YEAR)) {
X tm.tm_year += 1;
X! t -= year;
X }
X tm.tm_year += 1970;
X+
X+ /* t is now the offset into the current year, in seconds. */
X+ tm.tm_yday = (t/DAY); /* day # of the year, Jan 1 = 0 */
X+
X days_per_month[1] = 28;
X! if ((tm.tm_year % 4) == 0) /* check for leap year */
X days_per_month[1]++;
X+
X+ /* Compute month. */
X while (t >= (days_per_month[tm.tm_mon] * DAY))
X t -= days_per_month[tm.tm_mon++] * DAY;
X+
X+ /* Month established, now compute day of the month */
X while (t >= DAY) {
X t -= DAY;
X tm.tm_mday++;
X }
X+
X+ /* Day established, now do hour. */
X while (t >= HOUR) {
X t -= HOUR;
X tm.tm_hour++;
X }
X+
X+ /* Hour established, now do minute. */
X while (t >= MIN) {
X t -= MIN;
X tm.tm_min++;
X }
X+
X+ /* Residual time is # seconds. */
X tm.tm_sec = (int) t;
X+
X+ tm.tm_year -= 1900; /* make year relative to 1900 */
X+
X+ /* Generate output in ASCII in buf. */
X sprintf(buf, "%s %s %2d %02d:%02d:%02d %d\n",
X! days[tm.tm_wday], months[tm.tm_mon],
X! tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year+1900);
X return buf;
X }
X
X struct tm *localtime(pt)
X long *pt;
Xdiff -rc5 tmp/doprintf.c gnulib/doprintf.c
X*** tmp/doprintf.c Sun Nov 27 15:51:39 1988
X--- gnulib/doprintf.c Sun Nov 27 00:22:42 1988
X***************
X*** 87,127 ****
X
X typedef enum { EFORMAT, FFORMAT, GFORMAT } FORMAT_TYPE;
X static void _flofmt();
X extern char *itoa();
X
X static char *_cvt(buf, val, precision, fmt)
X char *buf;
X double val;
X int precision;
X FORMAT_TYPE fmt;
X {
X char mybuf[MAXWIDTH+1];
X int pow;
X int sign;
X!
X /* make val +ve record sign */
X if(val < 0)
X {
X sign = 1;
X val = -val;
X }
X else sign = 0;
X
X! /* convert val to 0.nnn form */
X pow = 0;
X while(val >= 1.0)
X {
X val /= 10.0;
X pow++;
X }
X
X if((precision + pow) > MAXWIDTH)
X precision -= ((precision + pow) - MAXWIDTH);
X
X _flofmt(mybuf, val, precision+pow);
X
X switch(fmt)
X {
X case EFORMAT:
X efmt:
X {
X--- 87,171 ----
X
X typedef enum { EFORMAT, FFORMAT, GFORMAT } FORMAT_TYPE;
X static void _flofmt();
X extern char *itoa();
X
X+ /* #define KLUDGEDIV no longer needed div fixed 11/23/88 */
X static char *_cvt(buf, val, precision, fmt)
X char *buf;
X double val;
X int precision;
X FORMAT_TYPE fmt;
X {
X char mybuf[MAXWIDTH+1];
X int pow;
X int sign;
X! #ifdef KLUDGEDIV
X! long l;
X! int i;
X! #endif
X!
X! #ifdef DDD
X! printf("_cvt called\n");
X! #endif
X /* make val +ve record sign */
X if(val < 0)
X {
X sign = 1;
X val = -val;
X }
X else sign = 0;
X+
X+ #ifdef DDD
X+ printf("sign %d\n", sign);
X+ #endif
X
X! /* convert val to 0.nnn form -- record pow */
X pow = 0;
X+ #ifdef KLUDGEDIV
X+ /* we are going to klude this until i can figure out what the heck */
X+ /* is wrong with _divdf3() in gnulib.c - it goes into an inf. loop */
X+ /* 11/23/88 -- this is fixed now, do *not* #define KLUDGEDIV */
X+ l = val;
X+ while(l > 0)
X+ {
X+ l /= 10;
X+ pow++;
X+ }
X+ if((i = pow) > 0)
X+ {
X+ l = val;
X+ sprintf(mybuf, "%ld", l);
X+ val = val - l;
X+ }
X+
X+ #else
X+ /* the real thing */
X while(val >= 1.0)
X {
X val /= 10.0;
X pow++;
X }
X+ #endif /* KLUDGEDIV */
X
X+ #ifdef DDD
X+ printf("pow %d precision+pow %d\n", pow, precision+pow);
X+ #endif
X+
X if((precision + pow) > MAXWIDTH)
X precision -= ((precision + pow) - MAXWIDTH);
X
X+ #ifdef KLUDGEDIV
X+ _flofmt(&mybuf[i], val, precision);
X+ #else
X _flofmt(mybuf, val, precision+pow);
X+ #endif
X
X+ #ifdef DDD
X+ printf("back from flofmt mybuf :%s:\n", mybuf);
X+ #endif
X+
X switch(fmt)
X {
X case EFORMAT:
X efmt:
X {
X***************
X*** 191,227 ****
X static void _flofmt(buf, val, precision)
X char * buf;
X double val;
X int precision;
X {
X! int int_part;
X int i, ndigits;
X- int ten = 10;
X char digit[MAXWIDTH+2];
X
X for (i = 0 ; i < MAXWIDTH ; i++)
X digit[i] = 0;
X for (i = 0, ndigits = 0 ;
X ((val > 0) && (ndigits < precision) && (i < MAXWIDTH)); i++)
X {
X! val = val * ten;
X int_part = val;
X val = val - int_part;
X digit[i] = int_part;
X /* kludge till we get doubles accurate... */
X if ((digit[i] > 9) || (digit[i] < 0))
X digit[i] = 0;
X if (int_part > 0) ndigits = i + 1;
X }
X if(ndigits < precision)
X ndigits = precision; /* we have already zero'ed the rest */
X
X if (ndigits > 0) /* were there any? */
X {
X for (i = 0 ; i < ndigits ; i++)
X {
X! *buf++ = digit[i] + 48;
X }
X }
X *buf = '\0';
X }
X
X--- 235,284 ----
X static void _flofmt(buf, val, precision)
X char * buf;
X double val;
X int precision;
X {
X! long int_part;
X int i, ndigits;
X char digit[MAXWIDTH+2];
X+
X+ #ifdef DDD
X+ printf("\t_flofmt\n");
X+ #endif
X
X for (i = 0 ; i < MAXWIDTH ; i++)
X digit[i] = 0;
X for (i = 0, ndigits = 0 ;
X ((val > 0) && (ndigits < precision) && (i < MAXWIDTH)); i++)
X {
X! val = val * 10.0;
X int_part = val;
X+ #ifdef DDD
X+ printf("\ti %d int_part %ld\n", i, int_part);
X+ #endif
X val = val - int_part;
X digit[i] = int_part;
X+ #ifdef DDD
X+ printf("\tdigit[i] %d\n", digit[i]);
X+ #endif
X /* kludge till we get doubles accurate... */
X+ /* -- probably not needed now */
X if ((digit[i] > 9) || (digit[i] < 0))
X digit[i] = 0;
X if (int_part > 0) ndigits = i + 1;
X }
X+ #ifdef DDD
X+ printf("\t_loop done ndigits %d precision %d\n", ndigits, precision);
X+ #endif
X if(ndigits < precision)
X ndigits = precision; /* we have already zero'ed the rest */
X
X if (ndigits > 0) /* were there any? */
X {
X for (i = 0 ; i < ndigits ; i++)
X {
X! *buf++ = digit[i] + '0';
X }
X }
X *buf = '\0';
X }
X
X***************
X*** 349,359 ****
X #endif
X #ifdef __GNUC__
X p = _itoa(p, (int)(GETARG(long)), c);
X #else
X p = _itoa(p, GETARG(int), c);
X-
X #endif /* __GNUC__ */
X break;
X case 'D':
X #ifndef NO_LONGD
X lflag++;
X--- 406,415 ----
X***************
X*** 421,431 ****
X if (ndfnd == 0)
X ndigit = 6;
X p = _gcvt(p, GETARG(double), ndigit);
X break;
X #endif /* __GNUC__ */
X! #endif
X case 'c':
X zfill = ' ';
X #ifdef __GNUC__
X *p++ = (int)(GETARG(long));
X #else
X--- 477,488 ----
X if (ndfnd == 0)
X ndigit = 6;
X p = _gcvt(p, GETARG(double), ndigit);
X break;
X #endif /* __GNUC__ */
X! #endif /* NO_FLOAT */
X!
X case 'c':
X zfill = ' ';
X #ifdef __GNUC__
X *p++ = (int)(GETARG(long));
X #else
Xdiff -rc5 tmp/freopen.c gnulib/freopen.c
X*** tmp/freopen.c Sun Nov 27 15:51:41 1988
X--- gnulib/freopen.c Sun Nov 20 10:52:52 1988
X***************
X*** 20,30 ****
X buffering method. ANSI C does not explicitly specify this.
X */
X
X #include <stdio.h>
X
X! #define PMODE 0644
X
X FILE *freopen(name, mode,fp)
X char *name , *mode;
X FILE *fp;
X {
X--- 20,30 ----
X buffering method. ANSI C does not explicitly specify this.
X */
X
X #include <stdio.h>
X
X! #define PMODE 0666
X
X FILE *freopen(name, mode,fp)
X char *name , *mode;
X FILE *fp;
X {
X***************
X*** 36,46 ****
X break;
X }
X if (i >= NFILES)
X return((FILE *)EOF);
X flags = fp->_flags;
X! flags = flags & !WRITEMODE & !READMODE;
X fflush(fp);
X close(fp->_fd);
X
X switch(*mode){
X
X--- 36,47 ----
X break;
X }
X if (i >= NFILES)
X return((FILE *)EOF);
X flags = fp->_flags;
X! flags &= ~(WRITEMODE | READMODE);
X! /* flags = flags & !WRITEMODE & !READMODE; */
X fflush(fp);
X close(fp->_fd);
X
X switch(*mode){
X
X***************
X*** 50,61 ****
X return((FILE *)NULL);
X break;
X
X case 'a':
X flags |= WRITEMODE;
X! if (( fd = open(name,1)) < 0 )
X! return((FILE *)NULL);
X lseek(fd,0L,2);
X break;
X
X case 'r':
X flags |= READMODE;
X--- 51,63 ----
X return((FILE *)NULL);
X break;
X
X case 'a':
X flags |= WRITEMODE;
X! if ((fd = open(name, 1)) < 0 && (fd = creat(name, PMODE)) < 0)
X! return ((FILE *) NULL);
X!
X lseek(fd,0L,2);
X break;
X
X case 'r':
X flags |= READMODE;
Xdiff -rc5 tmp/itoa.c gnulib/itoa.c
X*** tmp/itoa.c Sun Nov 27 15:51:42 1988
X--- gnulib/itoa.c Sun Nov 27 00:12:14 1988
X***************
X*** 21,36 ****
X /* bug fix - did'nt handle -32768 correctly
X * ++jrb bammi@dsrgsun.ces.cwru.edu
X */
X #ifdef __GNUC__
X #ifdef __MSHORT__
X! if(n == -32768) {
X strcpy(qbuf, "-32768");
X return qbuf;
X }
X #else
X! if(n == -2147483648L) {
X strcpy(qbuf, "-2147483648");
X return qbuf;
X }
X #endif
X #else
X--- 21,39 ----
X /* bug fix - did'nt handle -32768 correctly
X * ++jrb bammi@dsrgsun.ces.cwru.edu
X */
X #ifdef __GNUC__
X #ifdef __MSHORT__
X! if(n == -32768) { /* ACK C Users WATCH OUT, ITS BRAINDAMAGED, and the
X! explaination forthcoming for this on the net
X! from the people at V..U was even worse ,
X! Gnu C does this correctly */
X strcpy(qbuf, "-32768");
X return qbuf;
X }
X #else
X! if(n == -2147483648L) { /* ACK C barfs here */
X strcpy(qbuf, "-2147483648");
X return qbuf;
X }
X #endif
X #else
X***************
X*** 46,56 ****
X--- 49,68 ----
X n = -n;
X }
X if (n == 0) {
X qbuf[next++] = '0';
X } else {
X+
X+ #ifdef __GNUC__
X+ #ifdef __MSHORT__
X k = 10000;
X+ #else
X+ k = 1000000000;
X+ #endif
X+ #else
X+ k = 10000;
X+ #endif
X while (k > 0) {
X r = n/k;
X if (flag || r > 0) {
X qbuf[next++] = '0' + r;
X flag = 1;
Xdiff -rc5 tmp/printk.c gnulib/printk.c
X*** tmp/printk.c Sun Nov 27 15:51:45 1988
X--- gnulib/printk.c Sun Nov 27 00:06:08 1988
X***************
X*** 121,131 ****
X else if (c == '*')
X #ifdef __GNUC__
X { c = (int)(GETARG(long)); }
X #else
X c = GETARG(int);
X! #endif /* __GNUC__ */
X else
X break;
X width *= 10;
X width += c;
X }
X--- 121,131 ----
X else if (c == '*')
X #ifdef __GNUC__
X { c = (int)(GETARG(long)); }
X #else
X c = GETARG(int);
X! #endif
X else
X break;
X width *= 10;
X width += c;
X }
X***************
X*** 137,149 ****
X if (c >= '0' && c <= '9')
X c -= '0';
X else if (c == '*')
X #ifdef __GNUC__
X { c = (int)(GETARG(long)); }
X #else
X c = GETARG(int);
X! #endif /* __GNUC__ */
X else
X break;
X ndigit *= 10;
X ndigit += c;
X ndfnd++;
X--- 137,150 ----
X if (c >= '0' && c <= '9')
X c -= '0';
X else if (c == '*')
X #ifdef __GNUC__
X { c = (int)(GETARG(long)); }
X+
X #else
X c = GETARG(int);
X! #endif
X else
X break;
X ndigit *= 10;
X ndigit += c;
X ndfnd++;
X***************
X*** 189,200 ****
X #endif
X #ifdef __GNUC__
X p = _itoa(p, (int)(GETARG(long)), c);
X #else
X p = _itoa(p, GETARG(int), c);
X!
X! #endif /* __GNUC__ */
X break;
X case 'D':
X #ifndef NO_LONGD
X lflag++;
X #endif
X--- 190,200 ----
X #endif
X #ifdef __GNUC__
X p = _itoa(p, (int)(GETARG(long)), c);
X #else
X p = _itoa(p, GETARG(int), c);
X! #endif
X break;
X case 'D':
X #ifndef NO_LONGD
X lflag++;
X #endif
X***************
X*** 211,221 ****
X #endif
X #ifdef __GNUC__
X if ((i = (int)(GETARG(long))) < 0) {
X #else
X if ((i = GETARG(int)) < 0) {
X! #endif /* __GNUC__ */
X *p++ = '-';
X i = -i;
X }
X p = _itoa(p, i, 10);
X break;
X--- 211,221 ----
X #endif
X #ifdef __GNUC__
X if ((i = (int)(GETARG(long))) < 0) {
X #else
X if ((i = GETARG(int)) < 0) {
X! #endif
X *p++ = '-';
X i = -i;
X }
X p = _itoa(p, i, 10);
X break;
X***************
X*** 248,258 ****
X zfill = ' ';
X #ifdef __GNUC__
X *p++ = (int)(GETARG(long));
X #else
X *p++ = GETARG(int);
X! #endif /* __GNUC__ */
X break;
X case 's':
X zfill = ' ';
X if ((s = GETARG(char *)) == 0)
X s = "(null)";
X--- 248,258 ----
X zfill = ' ';
X #ifdef __GNUC__
X *p++ = (int)(GETARG(long));
X #else
X *p++ = GETARG(int);
X! #endif
X break;
X case 's':
X zfill = ' ';
X if ((s = GETARG(char *)) == 0)
X s = "(null)";
Xdiff -rc5 tmp/prints.c gnulib/prints.c
X*** tmp/prints.c Sun Nov 27 15:51:45 1988
X--- gnulib/prints.c Sat Nov 26 23:59:26 1988
X***************
X*** 3,38 ****
X * advantage of not requiring the runtime code for converting binary numbers
X * to ASCII, which saves 1K bytes in the object program. Since many of the
X * small utilities do not need numeric printing, they all use prints.
X */
X
X static put();
X
X #define TRUNC_SIZE 128
X! char Buf[TRUNC_SIZE], *Bufp;
X
X #define OUT 1
X
X prints(s, arglist)
X register char *s;
X! int *arglist;
X {
X register w;
X- #ifdef __GNUC__
X int k, r;
X! long *valp;
X! #else
X! int k, r, *valp;
X! #endif /* __GNUC__ */
X char *p, *p1, c;
X
X Bufp = Buf;
X! #ifdef __GNUC__
X! valp = (long *) &arglist;
X! #else
X! valp = (int *) &arglist;
X! #endif /* __GNUC__ */
X while (*s != '\0') {
X if (*s != '%') {
X put(*s++);
X continue;
X }
X--- 3,35 ----
X * advantage of not requiring the runtime code for converting binary numbers
X * to ASCII, which saves 1K bytes in the object program. Since many of the
X * small utilities do not need numeric printing, they all use prints.
X */
X
X+ /* Cleanup ++jrb bammi@dsrgsun.ces.cwru.edu */
X+
X+ #define GETARG(typ) *((typ *)valp)++
X+
X static put();
X
X #define TRUNC_SIZE 128
X! static char Buf[TRUNC_SIZE], *Bufp;
X
X #define OUT 1
X
X prints(s, arglist)
X register char *s;
X! char *arglist;
X {
X register w;
X int k, r;
X! char *valp;
X char *p, *p1, c;
X
X Bufp = Buf;
X! valp = (char *) &arglist;
X!
X while (*s != '\0') {
X if (*s != '%') {
X put(*s++);
X continue;
X }
X***************
X*** 44,56 ****
X s++;
X }
X
X
X switch(*s) {
X! case 'c': k = *valp++; put(k); s++; continue;
X! case 's': p = *((char **)valp);
X! valp += sizeof(char *) / sizeof(int);
X p1 = p;
X while(c = *p++) put(c); s++;
X if ( (k = w - ((int)(p-p1)-1)) > 0) while (k--) put(' ');
X continue;
X default: put('%'); put(*s++); continue;
X--- 41,63 ----
X s++;
X }
X
X
X switch(*s) {
X! /* case 'c': k = *valp++; put(k); s++; continue; */
X! #ifdef __GNUC__
X! case 'c': k = (int)(GETARG(long)); put(k); s++; continue;
X! #else
X! case 'c': k = GETARG(int); put(k); s++; continue;
X! #endif /* __GNUC__ */
X!
X! case 's':
X! /* p = *((char **)valp); */
X! /* valp += sizeof(char *) / sizeof(int); */
X!
X! p = (GETARG(char *));
X!
X p1 = p;
X while(c = *p++) put(c); s++;
X if ( (k = w - ((int)(p-p1)-1)) > 0) while (k--) put(' ');
X continue;
X default: put('%'); put(*s++); continue;
Xdiff -rc5 tmp/rand.c gnulib/rand.c
X*** tmp/rand.c Sun Nov 27 15:50:30 1988
X--- gnulib/rand.c Sun Nov 27 03:15:57 1988
X***************
X*** 3,7 ****
X--- 3,13 ----
X int rand()
X {
X seed = (1103515245L * seed + 12345) & 0x7FFFFFFF;
X return((int) (seed & 077777));
X }
X+
X+ int srand(val)
X+ long val;
X+ {
X+ seed = val;
X+ }
Xdiff -rc5 tmp/stcrtso.cpp gnulib/stcrtso.cpp
X*** tmp/stcrtso.cpp Sun Nov 27 15:51:17 1988
X--- gnulib/stcrtso.cpp Sun Nov 27 00:29:28 1988
X***************
X*** 46,56 ****
X #else
X movw d0,sp@- | push argc
X #endif
X jsr _main
X #ifdef __GNUC__
X! addl #14,sp
X #else
X addl #10,sp
X #endif
X #ifdef ACK
X EXIT:
X--- 46,56 ----
X #else
X movw d0,sp@- | push argc
X #endif
X jsr _main
X #ifdef __GNUC__
X! addl #12,sp
X #else
X addl #10,sp
X #endif
X #ifdef ACK
X EXIT:
SHAR_EOF
if test 22499 -ne "`wc -c 'lib-update1.diff'`"
then
echo shar: error transmitting "'lib-update1.diff'" '(should have been 22499 characters)'
fi
# End of shell archive
exit 0
usenet: {decvax,sun}!cwjcc!dsrgsun!bammi jwahar r. bammi
csnet: bammi@dsrgsun.ces.CWRU.edu
arpa: bammi@dsrgsun.ces.CWRU.edu
compuServe: 71515,155