From: Nick Downing Date: Thu, 2 Feb 2017 12:30:32 +0000 (+1100) Subject: Remove the sed fixup of va_arg() after xification, as it's not needed for VAX X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a4951f6c8e727a80cefc1da7e7f4bb5df1948f4d;p=43bsd.git Remove the sed fixup of va_arg() after xification, as it's not needed for VAX --- diff --git a/bin/csh/doprnt.c b/bin/csh/doprnt.c index b53b2c4..70a8b78 100644 --- a/bin/csh/doprnt.c +++ b/bin/csh/doprnt.c @@ -62,7 +62,7 @@ static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; #define ARG() \ _ulong = flags&LONGINT ? va_arg(argp, long) : \ - flags&SHORTINT ? va_arg(argp, short) : va_arg(argp, int); + /*flags&SHORTINT ? va_arg(argp, short) :*/ va_arg(argp, int); #define todigit(c) ((c) - '0') #define tochar(n) ((n) + '0') diff --git a/lib/libc/stdio/doprnt.c b/lib/libc/stdio/doprnt.c index 29a1eff..177b96d 100644 --- a/lib/libc/stdio/doprnt.c +++ b/lib/libc/stdio/doprnt.c @@ -58,7 +58,7 @@ static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; #define ARG() \ _ulong = flags&LONGINT ? va_arg(argp, long) : \ - flags&SHORTINT ? va_arg(argp, short) : va_arg(argp, int); + /*flags&SHORTINT ? va_arg(argp, short) :*/ va_arg(argp, int); #define todigit(c) ((c) - '0') #define tochar(n) ((n) + '0') diff --git a/xify/cc.sh b/xify/cc.sh index 69c38c8..05827bc 100755 --- a/xify/cc.sh +++ b/xify/cc.sh @@ -240,31 +240,51 @@ then continue fi +# j= +# if test -z "$xflag" +# then +## a bit horrible because we cannot redirect sed output to $tmp.c conditionally +# if test -n "$debug" +# then +# echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\\\(unsigned_\\\\)\\\\?\\\\(short\\\\|int\\\\|long\\\\))/_va_arg_\\\\1\\\\2(x_argp)/g'" ">"$tmp.c +# fi +# if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g' >$tmp.c +# then +# cflag=1 +# eflag=1 +# continue +# fi +# else +# if test -n "$debug" +# then +# echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\(unsigned_\\)\\?\\(short\\|int\\|long\\))/_va_arg_\\1\\2(x_argp)/g'" +# fi +# if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g' +# then +# cflag=1 +# eflag=1 +# continue +# fi +# cflag=1 +# continue +# fi j= if test -z "$xflag" then -# a bit horrible because we cannot redirect sed output to $tmp.c conditionally - if test -n "$debug" - then - echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\\\(unsigned_\\\\)\\\\?\\\\(short\\\\|int\\\\|long\\\\))/_va_arg_\\\\1\\\\2(x_argp)/g'" ">"$tmp.c - fi - if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g' >$tmp.c - then - cflag=1 - eflag=1 - continue - fi - else - if test -n "$debug" - then - echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\(unsigned_\\)\\?\\(short\\|int\\|long\\))/_va_arg_\\1\\2(x_argp)/g'" - fi - if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g' - then - cflag=1 - eflag=1 - continue - fi + j=" $tmp.c" + fi + if test -n "$debug" + then + echo $xify $tmp_i$j + fi + if ! $xify $tmp_i$j + then + cflag=1 + eflag=1 + continue + fi + if test -n "$xflag" + then cflag=1 continue fi diff --git a/xify/xify.c b/xify/xify.c index 925b66f..b41d6c8 100644 --- a/xify/xify.c +++ b/xify/xify.c @@ -91,19 +91,14 @@ int main(argc, argv) int argc; char **argv; { else if ((fout = fopen(argv[2], "w")) == 0) abort(); - fputs("#include \n\ + fputs("\ +#include \n\ typedef int16_t x_short;\n\ typedef int32_t x_int;\n\ typedef int32_t x_long;\n\ typedef uint16_t x_unsigned_short;\n\ typedef uint32_t x_unsigned_int;\n\ -typedef uint32_t x_unsigned_long;\n\ -#define _va_arg_short(argp) va_arg(argp, int)\n\ -#define _va_arg_int(argp) va_arg(argp, int)\n\ -#define _va_arg_long(argp) va_arg(argp, int)\n\ -#define _va_arg_unsigned_short(argp) va_arg(argp, unsigned int)\n\ -#define _va_arg_unsigned_int(argp) va_arg(argp, unsigned int)\n\ -#define _va_arg_unsigned_long(argp) va_arg(argp, unsigned int)\n", fout); +typedef uint32_t x_unsigned_long;\n", fout); while (fgets(buf, sizeof(buf), fin)) { p = buf; @@ -435,9 +430,11 @@ typedef uint32_t x_unsigned_long;\n\ if (p[l] == ';') { ++l; if (typedef_state == 3) { +#if 0 fwrite("typedef: ", 9, 1, stderr); fwrite(typedef_str_data, typedef_str_len, 1, stderr); putc('\n', stderr); +#endif if ((q = malloc(typedef_str_len)) == 0) abort(); memcpy(q, typedef_str_data, typedef_str_len);