diff --git a/lang/cem/libcc/stdio/fprintf.c b/lang/cem/libcc/stdio/fprintf.c index ff580501f..2c790d853 100644 --- a/lang/cem/libcc/stdio/fprintf.c +++ b/lang/cem/libcc/stdio/fprintf.c @@ -3,17 +3,18 @@ #include fprintf(va_alist) -va_dcl + va_dcl { - FILE *file; - char *fmt; va_list ap; va_start(ap); - file = va_arg(ap, FILE *); - fmt = va_arg(ap, char *); - _doprnt (fmt, ap, file); - if ( io_testflag(file,IO_PERPRINTF) ) - fflush(file); + { + FILE *file = va_arg(ap, FILE *); + char *fmt = va_arg(ap, char *); + + _doprnt (fmt, ap, file); + if ( io_testflag(file,IO_PERPRINTF) ) + fflush(file); + } va_end(ap); } diff --git a/lang/cem/libcc/stdio/fscanf.c b/lang/cem/libcc/stdio/fscanf.c index 9813c901d..771e4c712 100644 --- a/lang/cem/libcc/stdio/fscanf.c +++ b/lang/cem/libcc/stdio/fscanf.c @@ -3,18 +3,20 @@ #include int fscanf(va_alist) -va_dcl + va_dcl { - FILE *fp; - char *format; va_list ap; int retval; va_start(ap); - fp = va_arg(ap, FILE *); - format = va_arg(ap, char *); - retval = _doscanf (fp, format, ap); + { + FILE *fp = va_arg(ap, FILE *); + char *format = va_arg(ap, char *); + + retval = _doscanf (fp, format, ap); + } va_end(ap); + return retval; } diff --git a/lang/cem/libcc/stdio/printf.c b/lang/cem/libcc/stdio/printf.c index b13de5fb6..38577e87e 100644 --- a/lang/cem/libcc/stdio/printf.c +++ b/lang/cem/libcc/stdio/printf.c @@ -3,15 +3,17 @@ #include printf(va_alist) -va_dcl + va_dcl { - char *fmt; va_list ap; va_start(ap); - fmt = va_arg(ap, char *); - _doprnt (fmt, ap, stdout); - if ( io_testflag(stdout,IO_PERPRINTF) ) - fflush(stdout); + { + char *fmt = va_arg(ap, char *); + + _doprnt (fmt, ap, stdout); + if ( io_testflag(stdout,IO_PERPRINTF) ) + fflush(stdout); + } va_end(ap); } diff --git a/lang/cem/libcc/stdio/scanf.c b/lang/cem/libcc/stdio/scanf.c index 88aedbea1..fd04fa332 100644 --- a/lang/cem/libcc/stdio/scanf.c +++ b/lang/cem/libcc/stdio/scanf.c @@ -3,16 +3,19 @@ #include int scanf(va_alist) -va_dcl + va_dcl { - char *format; va_list ap; int retval; va_start(ap); - format = va_arg(ap, char *); - retval = _doscanf (stdin, format, ap); + { + char *format = va_arg(ap, char *); + + retval = _doscanf (stdin, format, ap); + } va_end(ap); + return retval; } diff --git a/lang/cem/libcc/stdio/sprintf.c b/lang/cem/libcc/stdio/sprintf.c index 53ed3c4dd..df5a34ffd 100644 --- a/lang/cem/libcc/stdio/sprintf.c +++ b/lang/cem/libcc/stdio/sprintf.c @@ -3,24 +3,28 @@ #include char *sprintf(va_alist) -va_dcl + va_dcl { - char *buf, *format; - FILE _tempfile; va_list ap; + char *retval; va_start(ap); - buf = va_arg(ap, char *); - format = va_arg(ap, char *); - _tempfile._fd = -1; - _tempfile._flags = IO_WRITEMODE + IO_UNBUFF; - _tempfile._buf = (unsigned char *) buf; - _tempfile._ptr = (unsigned char *) buf; - _tempfile._count = 32767; + { + char *buf = va_arg(ap, char *); + char *format = va_arg(ap, char *); + FILE _tempfile; - _doprnt(format, ap, &_tempfile); - putc('\0',&_tempfile); + retval = buf; + _tempfile._fd = -1; + _tempfile._flags = IO_WRITEMODE + IO_UNBUFF; + _tempfile._buf = (unsigned char *) buf; + _tempfile._ptr = (unsigned char *) buf; + _tempfile._count = 32767; + _doprnt(format, ap, &_tempfile); + putc('\0',&_tempfile); + } va_end(ap); - return buf; + + return retval; } diff --git a/lang/cem/libcc/stdio/sscanf.c b/lang/cem/libcc/stdio/sscanf.c index 7dff0f61f..c0175e50e 100644 --- a/lang/cem/libcc/stdio/sscanf.c +++ b/lang/cem/libcc/stdio/sscanf.c @@ -3,24 +3,26 @@ #include int sscanf(va_alist) -va_dcl + va_dcl { - char *string; /* source of data */ - char *format; /* control string */ - FILE _tempfile; va_list ap; int retval; va_start(ap); - string = va_arg(ap, char *); - format = va_arg(ap, char *); - _tempfile._fd = -1; - _tempfile._flags = IO_READMODE + IO_UNBUFF; - _tempfile._buf = (unsigned char *) string; - _tempfile._ptr = (unsigned char *) string; - _tempfile._count = 32767; + { + char *string = va_arg(ap, char *); + char *format = va_arg(ap, char *); + FILE _tempfile; - retval = _doscanf (&_tempfile, format, ap); + _tempfile._fd = -1; + _tempfile._flags = IO_READMODE + IO_UNBUFF; + _tempfile._buf = (unsigned char *) string; + _tempfile._ptr = (unsigned char *) string; + _tempfile._count = 32767; + + retval = _doscanf (&_tempfile, format, ap); + } va_end(ap); + return retval; }