2008-12-11 Craig Howland <howland@LGSInnovations.com>

* libc/include/sys/lock.h:  Add void cast to avoid "statement has no
        effect" warnings from gcc.
        * libc/include/sys/stdio.h:  Ditto.
        * libc/include/sys/time.h:  Correct gettimeofday() prototype.
        * libc/stdlib/__exp10.c:  Add #include "std.h" for function prototype.
        * libc/stdlib/__ten_mu.c:  Ditto.
        * libc/stdlib/std.h:  Correct __exp10's ANSI prototype.
        * libc/stdlib/ldtoa.c:  Change eiisinf definition to ANSI form.  (Are
        already others in file without _ansi method, so did not bother.)
        * libc/stdlib/system.c:  Use _ansi forms for function prototypes and
        definitions.
        * libc/time/mktime.c:  Ditto.
        * libc/misc/__dprintf.c:  Ditto.
        * libc/include/stdio.h:  Add function prototypes for _fgetc_r,
        _fgetpos_r, _fsetpos_r, _freopen_r, _rewind_r, freopen64, _freopen64_r,
        _funopen_r, and _fopencookie_r.
        * libc/include/reent.h:  Add function prototype for _stat64_r, align
        _execve_r prototype with POSIX definition for execve.
        * libc/reent/execr.c:  Align function prototype with POSIX definition.
        * libc/stdio/asniprintf.c:  Add #include "local.h".
        * libc/stdio/vasniprintf.c:  Ditto.
        * libc/stdio/fread.c:  Remove unused variable newcount.
        * libc/stdio/local.h:  Add function prototype for __sccl.
        * libc/stdio/open_memstream.c:  Remove unused variable flags.
        * libc/stdio/vfscanf.c:  Proper prototyping for ccfn, remove prototype
        for __sccl since now in local.h.
        * libc/string/memcpy.c:  Add #include <string.h> (for real and for
        traditional synopsis), remove extraneous stddef.h and limits.h.
        * libc/syscalls/sysclose.c:  Add #include <unistd.h>.
        * libc/syscalls/sysfork.c:  Ditto.
        * libc/syscalls/sysgetpid.c:  Ditto.
        * libc/syscalls/sysexecve.c:  Add #include <unistd.h>, align function
        prototype with POSIX definition.
        * libc/syscalls/sysfstat.c:  Add #include <sys/stat.h>.
        * libc/syscalls/sysgettod.c:  Correct sys/times.h to sys/time.h.
        * libc/syscalls/syskill.c:  Add #include <signal.h>.
        * libc/syscalls/syslink.c:  Add #include <unistd.h>, fix prototype.
        * libc/syscalls/sysunlink.c:  Ditto.
        * libc/syscalls/sysstat.c:  Add #include <sys/stat.h>, fix prototype.
        * libc/syscalls/syswait.c:  Add #include <sys/wait.h>, fix prototype.
This commit is contained in:
Jeff Johnston 2008-12-11 17:27:56 +00:00
parent 2549caeff1
commit 7dd0c33097
32 changed files with 163 additions and 82 deletions

View File

@ -1,3 +1,46 @@
2008-12-11 Craig Howland <howland@LGSInnovations.com>
* libc/include/sys/lock.h: Add void cast to avoid "statement has no
effect" warnings from gcc.
* libc/include/sys/stdio.h: Ditto.
* libc/include/sys/time.h: Correct gettimeofday() prototype.
* libc/stdlib/__exp10.c: Add #include "std.h" for function prototype.
* libc/stdlib/__ten_mu.c: Ditto.
* libc/stdlib/std.h: Correct __exp10's ANSI prototype.
* libc/stdlib/ldtoa.c: Change eiisinf definition to ANSI form. (Are
already others in file without _ansi method, so did not bother.)
* libc/stdlib/system.c: Use _ansi forms for function prototypes and
definitions.
* libc/time/mktime.c: Ditto.
* libc/misc/__dprintf.c: Ditto.
* libc/include/stdio.h: Add function prototypes for _fgetc_r,
_fgetpos_r, _fsetpos_r, _freopen_r, _rewind_r, freopen64, _freopen64_r,
_funopen_r, and _fopencookie_r.
* libc/include/reent.h: Add function prototype for _stat64_r, align
_execve_r prototype with POSIX definition for execve.
* libc/reent/execr.c: Align function prototype with POSIX definition.
* libc/stdio/asniprintf.c: Add #include "local.h".
* libc/stdio/vasniprintf.c: Ditto.
* libc/stdio/fread.c: Remove unused variable newcount.
* libc/stdio/local.h: Add function prototype for __sccl.
* libc/stdio/open_memstream.c: Remove unused variable flags.
* libc/stdio/vfscanf.c: Proper prototyping for ccfn, remove prototype
for __sccl since now in local.h.
* libc/string/memcpy.c: Add #include <string.h> (for real and for
traditional synopsis), remove extraneous stddef.h and limits.h.
* libc/syscalls/sysclose.c: Add #include <unistd.h>.
* libc/syscalls/sysfork.c: Ditto.
* libc/syscalls/sysgetpid.c: Ditto.
* libc/syscalls/sysexecve.c: Add #include <unistd.h>, align function
prototype with POSIX definition.
* libc/syscalls/sysfstat.c: Add #include <sys/stat.h>.
* libc/syscalls/sysgettod.c: Correct sys/times.h to sys/time.h.
* libc/syscalls/syskill.c: Add #include <signal.h>.
* libc/syscalls/syslink.c: Add #include <unistd.h>, fix prototype.
* libc/syscalls/sysunlink.c: Ditto.
* libc/syscalls/sysstat.c: Add #include <sys/stat.h>, fix prototype.
* libc/syscalls/syswait.c: Add #include <sys/wait.h>, fix prototype.
2008-12-10 Corinna Vinschen <corinna@vinschen.de> 2008-12-10 Corinna Vinschen <corinna@vinschen.de>
Implement basic wide char stdio functionality, based on FreeBSD. Implement basic wide char stdio functionality, based on FreeBSD.

View File

@ -137,7 +137,7 @@ struct timezone;
/* Reentrant versions of system calls. */ /* Reentrant versions of system calls. */
extern int _close_r _PARAMS ((struct _reent *, int)); extern int _close_r _PARAMS ((struct _reent *, int));
extern int _execve_r _PARAMS ((struct _reent *, char *, char **, char **)); extern int _execve_r _PARAMS ((struct _reent *, const char *, char *const *, char *const *));
extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int)); extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int));
extern int _fork_r _PARAMS ((struct _reent *)); extern int _fork_r _PARAMS ((struct _reent *));
extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *)); extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *));
@ -170,6 +170,7 @@ struct stat64;
extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int)); extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int));
extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *)); extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *));
extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int)); extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int));
extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *));
#endif #endif
#endif #endif

View File

@ -371,13 +371,22 @@ int _EXFUN(_fclose_r, (struct _reent *, FILE *));
int _EXFUN(_fcloseall_r, (struct _reent *)); int _EXFUN(_fcloseall_r, (struct _reent *));
FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *));
int _EXFUN(_fflush_r, (struct _reent *, FILE *)); int _EXFUN(_fflush_r, (struct _reent *, FILE *));
int _EXFUN(_fgetc_r, (struct _reent *, FILE *));
char * _EXFUN(_fgets_r, (struct _reent *, char *, int, FILE *)); char * _EXFUN(_fgets_r, (struct _reent *, char *, int, FILE *));
#ifdef _COMPILING_NEWLIB
int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, _fpos_t *));
int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *));
#else
int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *));
int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const fpos_t *));
#endif
int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...) int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4)))); _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...) int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...)
_ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); _ATTRIBUTE ((__format__ (__scanf__, 3, 4))));
FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *, size_t, const char *)); FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *, size_t, const char *));
FILE * _EXFUN(_fopen_r, (struct _reent *, const char *, const char *)); FILE * _EXFUN(_fopen_r, (struct _reent *, const char *, const char *));
FILE * _EXFUN(_freopen_r, (struct _reent *, const char *, const char *, FILE *));
int _EXFUN(_fprintf_r, (struct _reent *, FILE *, const char *, ...) int _EXFUN(_fprintf_r, (struct _reent *, FILE *, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4)))); _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); int _EXFUN(_fputc_r, (struct _reent *, int, FILE *));
@ -389,6 +398,7 @@ int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int));
int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int));
long _EXFUN(_ftell_r, (struct _reent *, FILE *)); long _EXFUN(_ftell_r, (struct _reent *, FILE *));
_off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); _off_t _EXFUN(_ftello_r,(struct _reent *, FILE *));
void _EXFUN(_rewind_r, (struct _reent *, FILE *));
size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR , size_t _size, size_t _n, FILE *)); size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR , size_t _size, size_t _n, FILE *));
int _EXFUN(_getc_r, (struct _reent *, FILE *)); int _EXFUN(_getc_r, (struct _reent *, FILE *));
int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *));
@ -479,6 +489,7 @@ ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));
#if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) #if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB)
FILE * _EXFUN(fdopen64, (int, const char *)); FILE * _EXFUN(fdopen64, (int, const char *));
FILE * _EXFUN(fopen64, (const char *, const char *)); FILE * _EXFUN(fopen64, (const char *, const char *));
FILE * _EXFUN(freopen64, (_CONST char *, _CONST char *, FILE *));
_off64_t _EXFUN(ftello64, (FILE *)); _off64_t _EXFUN(ftello64, (FILE *));
_off64_t _EXFUN(fseeko64, (FILE *, _off64_t, int)); _off64_t _EXFUN(fseeko64, (FILE *, _off64_t, int));
int _EXFUN(fgetpos64, (FILE *, _fpos64_t *)); int _EXFUN(fgetpos64, (FILE *, _fpos64_t *));
@ -487,6 +498,7 @@ FILE * _EXFUN(tmpfile64, (void));
FILE * _EXFUN(_fdopen64_r, (struct _reent *, int, const char *)); FILE * _EXFUN(_fdopen64_r, (struct _reent *, int, const char *));
FILE * _EXFUN(_fopen64_r, (struct _reent *,const char *, const char *)); FILE * _EXFUN(_fopen64_r, (struct _reent *,const char *, const char *));
FILE * _EXFUN(_freopen64_r, (struct _reent *, _CONST char *, _CONST char *, FILE *));
_off64_t _EXFUN(_ftello64_r, (struct _reent *, FILE *)); _off64_t _EXFUN(_ftello64_r, (struct _reent *, FILE *));
_off64_t _EXFUN(_fseeko64_r, (struct _reent *, FILE *, _off64_t, int)); _off64_t _EXFUN(_fseeko64_r, (struct _reent *, FILE *, _off64_t, int));
int _EXFUN(_fgetpos64_r, (struct _reent *, FILE *, _fpos64_t *)); int _EXFUN(_fgetpos64_r, (struct _reent *, FILE *, _fpos64_t *));
@ -513,12 +525,22 @@ FILE *_EXFUN(funopen,(const _PTR __cookie,
int (*__writefn)(_PTR __c, const char *__buf, int __n), int (*__writefn)(_PTR __c, const char *__buf, int __n),
_fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence),
int (*__closefn)(_PTR __c))); int (*__closefn)(_PTR __c)));
FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie,
int (*__readfn)(_PTR __c, char *__buf, int __n),
int (*__writefn)(_PTR __c, const char *__buf, int __n),
_fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence),
int (*__closefn)(_PTR __c)));
# else # else
FILE *_EXFUN(funopen,(const _PTR __cookie, FILE *_EXFUN(funopen,(const _PTR __cookie,
int (*__readfn)(_PTR __cookie, char *__buf, int __n), int (*__readfn)(_PTR __cookie, char *__buf, int __n),
int (*__writefn)(_PTR __cookie, const char *__buf, int __n), int (*__writefn)(_PTR __cookie, const char *__buf, int __n),
fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence),
int (*__closefn)(_PTR __cookie))); int (*__closefn)(_PTR __cookie)));
FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie,
int (*__readfn)(_PTR __cookie, char *__buf, int __n),
int (*__writefn)(_PTR __cookie, const char *__buf, int __n),
fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence),
int (*__closefn)(_PTR __cookie)));
# endif /* !__LARGE64_FILES */ # endif /* !__LARGE64_FILES */
# define fropen(__cookie, __fn) funopen(__cookie, __fn, (int (*)())0, \ # define fropen(__cookie, __fn) funopen(__cookie, __fn, (int (*)())0, \
@ -545,8 +567,10 @@ typedef struct
cookie_seek_function_t *seek; cookie_seek_function_t *seek;
cookie_close_function_t *close; cookie_close_function_t *close;
} cookie_io_functions_t; } cookie_io_functions_t;
FILE *_EXFUN(fopencookie,(void *__cookie, const char *__mode, FILE *_EXFUN(fopencookie,(void *__cookie,
cookie_io_functions_t __functions)); const char *__mode, cookie_io_functions_t __functions));
FILE *_EXFUN(_fopencookie_r,(struct _reent *, void *__cookie,
const char *__mode, cookie_io_functions_t __functions));
#endif /* ! __STRICT_ANSI__ */ #endif /* ! __STRICT_ANSI__ */
#ifndef __CUSTOM_FILE_IO__ #ifndef __CUSTOM_FILE_IO__

View File

@ -5,18 +5,20 @@
typedef int _LOCK_T; typedef int _LOCK_T;
typedef int _LOCK_RECURSIVE_T; typedef int _LOCK_RECURSIVE_T;
#include <_ansi.h>
#define __LOCK_INIT(class,lock) static int lock = 0; #define __LOCK_INIT(class,lock) static int lock = 0;
#define __LOCK_INIT_RECURSIVE(class,lock) static int lock = 0; #define __LOCK_INIT_RECURSIVE(class,lock) static int lock = 0;
#define __lock_init(lock) (0) #define __lock_init(lock) (_CAST_VOID 0)
#define __lock_init_recursive(lock) (0) #define __lock_init_recursive(lock) (_CAST_VOID 0)
#define __lock_close(lock) (0) #define __lock_close(lock) (_CAST_VOID 0)
#define __lock_close_recursive(lock) (0) #define __lock_close_recursive(lock) (_CAST_VOID 0)
#define __lock_acquire(lock) (0) #define __lock_acquire(lock) (_CAST_VOID 0)
#define __lock_acquire_recursive(lock) (0) #define __lock_acquire_recursive(lock) (_CAST_VOID 0)
#define __lock_try_acquire(lock) (0) #define __lock_try_acquire(lock) (_CAST_VOID 0)
#define __lock_try_acquire_recursive(lock) (0) #define __lock_try_acquire_recursive(lock) (_CAST_VOID 0)
#define __lock_release(lock) (0) #define __lock_release(lock) (_CAST_VOID 0)
#define __lock_release_recursive(lock) (0) #define __lock_release_recursive(lock) (_CAST_VOID 0)
#endif /* __SYS_LOCK_H__ */ #endif /* __SYS_LOCK_H__ */

View File

@ -12,7 +12,7 @@
#ifndef __SINGLE_THREAD__ #ifndef __SINGLE_THREAD__
# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) # define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
#else #else
# define _flockfile(fp) # define _flockfile(fp) (_CASTVOID 0)
#endif #endif
#endif #endif
@ -20,7 +20,7 @@
#ifndef __SINGLE_THREAD__ #ifndef __SINGLE_THREAD__
# define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) # define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock))
#else #else
# define _funlockfile(fp) # define _funlockfile(fp) (_CASTVOID 0)
#endif #endif
#endif #endif

View File

@ -70,7 +70,7 @@ struct itimerval {
} while (0) } while (0)
#endif /* defined (__rtems__) || defined (__CYGWIN__) */ #endif /* defined (__rtems__) || defined (__CYGWIN__) */
int _EXFUN(gettimeofday, (struct timeval *__p, void *__tz)); int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__tz));
int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));
int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp)); int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp));
int _EXFUN(getitimer, (int __which, struct itimerval *__value)); int _EXFUN(getitimer, (int __which, struct itimerval *__value));

View File

@ -4,6 +4,7 @@
We do assume _write_r is working. We do assume _write_r is working.
*/ */
#include <_ansi.h>
#include "ctype.h" #include "ctype.h"
#include "reent.h" #include "reent.h"
#include "string.h" #include "string.h"
@ -19,10 +20,10 @@
static char *parse_number (); static char *parse_number ();
#endif #endif
static long get_number (); static long _EXFUN(get_number, (char *, long, int));
static void print_number (); static void _EXFUN(print_number, (int, int, long));
static void write_char (); static void _EXFUN(write_char, (char c));
static void write_string (); static void _EXFUN(write_string, (_CONST char *s));
/* Non-zero for big-endian systems. */ /* Non-zero for big-endian systems. */
static int big_endian_p; static int big_endian_p;
@ -39,7 +40,7 @@ static int big_endian_p;
20 words at a certain address). A modifier of `N' says the next argument 20 words at a certain address). A modifier of `N' says the next argument
is a count, and the one after that is a pointer. is a count, and the one after that is a pointer.
Example: __dprintf (stderr, "%Nx\n", 20, p); /-* print 20 ints at `p' *-/ Example: __dprintf ("%Nx\n", 20, p); /-* print 20 ints at `p' *-/
Supported formats are: c d u x s p. Supported formats are: c d u x s p.
@ -54,7 +55,7 @@ static int big_endian_p;
void void
#ifdef __STDC__ #ifdef __STDC__
__dprintf (char *fmt, ...) __dprintf (const char *fmt, ...)
#else #else
__dprintf (fmt, va_alist) __dprintf (fmt, va_alist)
char *fmt; char *fmt;
@ -176,10 +177,10 @@ parse_number (s, p)
/* Fetch the number at S of SIZE bytes. */ /* Fetch the number at S of SIZE bytes. */
static long static long
get_number (s, size, unsigned_p) _DEFUN(get_number, (s, size, unsigned_p),
char *s; char *s _AND
long size; long size _AND
int unsigned_p; int unsigned_p)
{ {
long x; long x;
unsigned char *p = (unsigned char *) s; unsigned char *p = (unsigned char *) s;
@ -219,10 +220,10 @@ get_number (s, size, unsigned_p)
/* Print X in base BASE. */ /* Print X in base BASE. */
static void static void
print_number (base, unsigned_p, n) _DEFUN(print_number, (base, unsigned_p, n),
int base; int base _AND
int unsigned_p; int unsigned_p _AND
long n; long n)
{ {
static char chars[16] = "0123456789abcdef"; static char chars[16] = "0123456789abcdef";
char *p, buf[32]; char *p, buf[32];
@ -253,8 +254,8 @@ print_number (base, unsigned_p, n)
stdio is working. */ stdio is working. */
static void static void
write_char (c) _DEFUN(write_char, (c),
char c; char c)
{ {
_write_r (_REENT, CONSOLE_FD, &c, 1); _write_r (_REENT, CONSOLE_FD, &c, 1);
} }
@ -264,8 +265,8 @@ write_char (c)
stdio is working. */ stdio is working. */
static void static void
write_string (s) _DEFUN(write_string, (s),
char *s; _CONST char *s)
{ {
_write_r (_REENT, CONSOLE_FD, s, strlen (s)); _write_r (_REENT, CONSOLE_FD, s, strlen (s));
} }

View File

@ -35,16 +35,16 @@ INDEX
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <reent.h> #include <reent.h>
int _execve_r(struct _reent *<[ptr]>, char *<[name]>, int _execve_r(struct _reent *<[ptr]>, const char *<[name]>,
char **<[argv]>, char **<[env]>); char *const <[argv]>[], char *const <[env]>[]);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <reent.h> #include <reent.h>
int _execve_r(<[ptr]>, <[name]>, <[argv]>, <[env]>) int _execve_r(<[ptr]>, <[name]>, <[argv]>, <[env]>)
struct _reent *<[ptr]>; struct _reent *<[ptr]>;
char *<[name]>; char *<[name]>;
char **<[argv]>; char *<[argv]>[];
char **<[env]>; char *<[env]>[];
DESCRIPTION DESCRIPTION
This is a reentrant version of <<execve>>. It This is a reentrant version of <<execve>>. It
@ -55,9 +55,9 @@ DESCRIPTION
int int
_DEFUN (_execve_r, (ptr, name, argv, env), _DEFUN (_execve_r, (ptr, name, argv, env),
struct _reent *ptr _AND struct _reent *ptr _AND
char *name _AND _CONST char *name _AND
char **argv _AND char *_CONST argv[] _AND
char **env) char *_CONST env[])
{ {
int ret; int ret;

View File

@ -11,6 +11,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include "local.h"
char * char *
_DEFUN(_asniprintf_r, (ptr, buf, lenp, fmt), _DEFUN(_asniprintf_r, (ptr, buf, lenp, fmt),

View File

@ -87,7 +87,7 @@ _DEFUN(crlf_r, (ptr, fp, buf, count, eof),
size_t count _AND size_t count _AND
int eof) int eof)
{ {
int newcount = 0, r; int r;
char *s, *d, *e; char *s, *d, *e;
if (count == 0) if (count == 0)

View File

@ -33,6 +33,7 @@
#endif #endif
extern u_char *_EXFUN(__sccl, (char *, u_char *fmt));
extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
extern int _EXFUN(__ssvfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); extern int _EXFUN(__ssvfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
extern int _EXFUN(__svfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); extern int _EXFUN(__svfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));

View File

@ -254,7 +254,6 @@ _DEFUN(_open_memstream_r, (ptr, buf, size),
{ {
FILE *fp; FILE *fp;
memstream *c; memstream *c;
int flags;
if (!buf || !size) if (!buf || !size)
{ {

View File

@ -11,6 +11,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include "local.h"
char * char *
_DEFUN(_vasniprintf_r, (ptr, buf, lenp, fmt, ap), _DEFUN(_vasniprintf_r, (ptr, buf, lenp, fmt, ap),

View File

@ -250,8 +250,6 @@ static void * get_arg (int, va_list *, int *, void **);
typedef unsigned long long u_long_long; typedef unsigned long long u_long_long;
#endif #endif
/*static*/ u_char *__sccl ();
/* /*
* vfscanf * vfscanf
*/ */
@ -452,7 +450,8 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap),
size_t mbslen; /* length of converted multibyte sequence */ size_t mbslen; /* length of converted multibyte sequence */
mbstate_t state; /* value to keep track of multibyte state */ mbstate_t state; /* value to keep track of multibyte state */
u_long (*ccfn) () = 0; /* conversion function (strtol/strtoul) */ #define CCFN_PARAMS _PARAMS((struct _reent *, const char *, char **, int))
u_long (*ccfn)CCFN_PARAMS=0; /* conversion function (strtol/strtoul) */
char ccltab[256]; /* character class table for %[...] */ char ccltab[256]; /* character class table for %[...] */
char buf[BUF]; /* buffer for numeric conversions */ char buf[BUF]; /* buffer for numeric conversions */
char *lptr; /* literal pointer */ char *lptr; /* literal pointer */
@ -658,13 +657,13 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap),
/* FALLTHROUGH */ /* FALLTHROUGH */
case 'd': case 'd':
c = CT_INT; c = CT_INT;
ccfn = (u_long (*)())_strtol_r; ccfn = (u_long (*)CCFN_PARAMS)_strtol_r;
base = 10; base = 10;
break; break;
case 'i': case 'i':
c = CT_INT; c = CT_INT;
ccfn = (u_long (*)())_strtol_r; ccfn = (u_long (*)CCFN_PARAMS)_strtol_r;
base = 0; base = 0;
break; break;
@ -786,7 +785,7 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap),
if (isupper (c)) if (isupper (c))
flags |= LONG; flags |= LONG;
c = CT_INT; c = CT_INT;
ccfn = (u_long (*)())_strtol_r; ccfn = (u_long (*)CCFN_PARAMS)_strtol_r;
base = 10; base = 10;
break; break;
} }

View File

@ -3,6 +3,7 @@
*/ */
#include <_ansi.h> #include <_ansi.h>
#include "std.h"
double double
_DEFUN (__exp10, (x), _DEFUN (__exp10, (x),

View File

@ -6,6 +6,7 @@
*/ */
#include <_ansi.h> #include <_ansi.h>
#include "std.h"
int int
_DEFUN (__ten_mul, (acc, digit), _DEFUN (__ten_mul, (acc, digit),

View File

@ -719,8 +719,7 @@ return(0);
/* Return nonzero if internal format number is infinite. */ /* Return nonzero if internal format number is infinite. */
static int static int
eiisinf (x) eiisinf (unsigned short x[])
unsigned short x[];
{ {
#ifdef NANS #ifdef NANS

View File

@ -25,7 +25,7 @@
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int __ten_mul(double *acc, int digit); int __ten_mul(double *acc, int digit);
double __adjust(struct _reent *ptr, double *acc, int dexp, int sign); double __adjust(struct _reent *ptr, double *acc, int dexp, int sign);
const double __exp10(unsigned x); double __exp10(unsigned x);
#else #else
int __ten_mul(); int __ten_mul();
double __adjust(); double __adjust();

View File

@ -53,6 +53,7 @@ Supporting OS subroutines required: <<_exit>>, <<_execve>>, <<_fork_r>>,
<<_wait_r>>. <<_wait_r>>.
*/ */
#include <_ansi.h>
#include <errno.h> #include <errno.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@ -61,13 +62,13 @@ Supporting OS subroutines required: <<_exit>>, <<_execve>>, <<_fork_r>>,
#include <reent.h> #include <reent.h>
#if defined (unix) || defined (__CYGWIN__) #if defined (unix) || defined (__CYGWIN__)
static int do_system (); static int _EXFUN(do_system, (struct _reent *ptr _AND _CONST char *s));
#endif #endif
int int
_system_r (ptr, s) _DEFUN(_system_r, (ptr, s),
struct _reent *ptr; struct _reent *ptr _AND
_CONST char *s; _CONST char *s)
{ {
#if defined(HAVE_SYSTEM) #if defined(HAVE_SYSTEM)
return _system (s); return _system (s);
@ -101,8 +102,8 @@ _system_r (ptr, s)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
system (s) _DEFUN(system, (s),
_CONST char *s; _CONST char *s)
{ {
return _system_r (_REENT, s); return _system_r (_REENT, s);
} }
@ -118,9 +119,9 @@ extern char **environ;
static char ***p_environ = &environ; static char ***p_environ = &environ;
static int static int
do_system (ptr, s) _DEFUN(do_system, (ptr, s),
struct _reent *ptr; struct _reent *ptr _AND
_CONST char *s; _CONST char *s)
{ {
char *argv[4]; char *argv[4];
int pid, status; int pid, status;
@ -150,9 +151,9 @@ do_system (ptr, s)
#if defined (__CYGWIN__) #if defined (__CYGWIN__)
static int static int
do_system (ptr, s) _DEFUN(do_system, (ptr, s),
struct _reent *ptr; struct _reent *ptr _AND
_CONST char *s; _CONST char *s)
{ {
char *argv[4]; char *argv[4];
int pid, status; int pid, status;

View File

@ -7,6 +7,7 @@ ANSI_SYNOPSIS
void* memcpy(void *<[out]>, const void *<[in]>, size_t <[n]>); void* memcpy(void *<[out]>, const void *<[in]>, size_t <[n]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h>
void *memcpy(<[out]>, <[in]>, <[n]> void *memcpy(<[out]>, <[in]>, <[n]>
void *<[out]>; void *<[out]>;
void *<[in]>; void *<[in]>;
@ -33,8 +34,7 @@ QUICKREF
*/ */
#include <_ansi.h> #include <_ansi.h>
#include <stddef.h> #include <string.h>
#include <limits.h>
/* Nonzero if either X or Y is not aligned on a "long" boundary. */ /* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \ #define UNALIGNED(X, Y) \

View File

@ -1,6 +1,7 @@
/* connector for close */ /* connector for close */
#include <reent.h> #include <reent.h>
#include <unistd.h>
int int
_DEFUN (close, (fd), _DEFUN (close, (fd),

View File

@ -1,12 +1,13 @@
/* connector for execve */ /* connector for execve */
#include <reent.h> #include <reent.h>
#include <unistd.h>
int int
_DEFUN (execve, (name, argv, env), _DEFUN (execve, (name, argv, env),
char *name _AND _CONST char *name _AND
char **argv _AND char *_CONST argv[] _AND
char **env) char *_CONST env[])
{ {
return _execve_r (_REENT, name, argv, env); return _execve_r (_REENT, name, argv, env);
} }

View File

@ -5,6 +5,7 @@
#ifndef NO_FORK #ifndef NO_FORK
#include <reent.h> #include <reent.h>
#include <unistd.h>
int int
_DEFUN_VOID (fork) _DEFUN_VOID (fork)

View File

@ -1,6 +1,7 @@
/* connector for fstat */ /* connector for fstat */
#include <reent.h> #include <reent.h>
#include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
int int

View File

@ -1,6 +1,7 @@
/* connector for getpid */ /* connector for getpid */
#include <reent.h> #include <reent.h>
#include <unistd.h>
int int
_DEFUN_VOID (getpid) _DEFUN_VOID (getpid)

View File

@ -2,10 +2,7 @@
#include <reent.h> #include <reent.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/times.h> #include <sys/time.h>
struct timeval;
struct timezone;
int int
_DEFUN (gettimeofday, (ptimeval, ptimezone), _DEFUN (gettimeofday, (ptimeval, ptimezone),

View File

@ -1,6 +1,7 @@
/* connector for kill */ /* connector for kill */
#include <reent.h> #include <reent.h>
#include <signal.h>
int int
_DEFUN (kill, (pid, sig), _DEFUN (kill, (pid, sig),

View File

@ -1,11 +1,12 @@
/* connector for link */ /* connector for link */
#include <reent.h> #include <reent.h>
#include <unistd.h>
int int
_DEFUN (link, (old, new), _DEFUN (link, (old, new),
char *old _AND _CONST char *old _AND
char *new) _CONST char *new)
{ {
return _link_r (_REENT, old, new); return _link_r (_REENT, old, new);
} }

View File

@ -1,11 +1,12 @@
/* connector for stat */ /* connector for stat */
#include <reent.h> #include <reent.h>
#include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
int int
_DEFUN (stat, (file, pstat), _DEFUN (stat, (file, pstat),
char *file _AND _CONST char *file _AND
struct stat *pstat) struct stat *pstat)
{ {
return _stat_r (_REENT, file, pstat); return _stat_r (_REENT, file, pstat);

View File

@ -1,10 +1,11 @@
/* connector for unlink */ /* connector for unlink */
#include <reent.h> #include <reent.h>
#include <unistd.h>
int int
_DEFUN (unlink, (file), _DEFUN (unlink, (file),
char *file) _CONST char *file)
{ {
return _unlink_r (_REENT, file); return _unlink_r (_REENT, file);
} }

View File

@ -1,8 +1,9 @@
/* connector for wait */ /* connector for wait */
#include <reent.h> #include <reent.h>
#include <sys/wait.h>
int pid_t
_DEFUN (wait, (status), _DEFUN (wait, (status),
int *status) int *status)
{ {

View File

@ -67,8 +67,8 @@ static _CONST int _DAYS_BEFORE_MONTH[12] =
#define _DAYS_IN_YEAR(year) (_ISLEAP(year) ? 366 : 365) #define _DAYS_IN_YEAR(year) (_ISLEAP(year) ? 366 : 365)
static void static void
validate_structure (tim_p) _DEFUN(validate_structure, (tim_p),
struct tm *tim_p; struct tm *tim_p)
{ {
div_t res; div_t res;
int days_in_feb = 28; int days_in_feb = 28;
@ -154,8 +154,8 @@ validate_structure (tim_p)
} }
time_t time_t
mktime (tim_p) _DEFUN(mktime, (tim_p),
struct tm *tim_p; struct tm *tim_p)
{ {
time_t tim = 0; time_t tim = 0;
long days = 0; long days = 0;