diff options
author | peter <peter@FreeBSD.org> | 1999-12-27 08:45:14 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-12-27 08:45:14 +0000 |
commit | 070fb078b63def28df51407cd5ea411b14e7f099 (patch) | |
tree | 94f2977f3d9218392c1e07e838f2fb7508fc1644 /lib/libstand | |
parent | 0e302599d7ce5999caeeae7b2a0fdd9c399df508 (diff) | |
download | FreeBSD-src-070fb078b63def28df51407cd5ea411b14e7f099.zip FreeBSD-src-070fb078b63def28df51407cd5ea411b14e7f099.tar.gz |
Tidy up some loose ends. nullfs_read/write were returning the wrong value.
Fix some ctype problems - isascii() caused a warning if fed an unsigned
char - it's always > 0 and libstand is compiled with -Wall.
Missing prototype/include in printf.c
Diffstat (limited to 'lib/libstand')
-rw-r--r-- | lib/libstand/nullfs.c | 5 | ||||
-rw-r--r-- | lib/libstand/printf.c | 1 | ||||
-rw-r--r-- | lib/libstand/stand.h | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/libstand/nullfs.c b/lib/libstand/nullfs.c index 4a1e6e4..96e69d2 100644 --- a/lib/libstand/nullfs.c +++ b/lib/libstand/nullfs.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* $NetBSD: nullfs.c,v 1.1 1996/01/13 22:25:39 leo Exp $ */ /*- @@ -80,13 +81,13 @@ int null_close(struct open_file *f) return 0; } -ssize_t null_read (struct open_file *f, void *buf, size_t size, size_t *resid) +int null_read (struct open_file *f, void *buf, size_t size, size_t *resid) { errno = EIO; return -1; } -ssize_t null_write (struct open_file *f, void *buf, size_t size, size_t *resid) +int null_write (struct open_file *f, void *buf, size_t size, size_t *resid) { errno = EIO; return -1; diff --git a/lib/libstand/printf.c b/lib/libstand/printf.c index 3e16b6f..6e3702e 100644 --- a/lib/libstand/printf.c +++ b/lib/libstand/printf.c @@ -44,6 +44,7 @@ */ #include <sys/types.h> +#include <string.h> #include "stand.h" /* diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 78832e7..08b1d9d 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -165,7 +165,7 @@ extern struct open_file files[]; #define isspace(c) ((c) == ' ' || ((c) >= 0x9 && (c) <= 0xd)) #define isdigit(c) ((c) >= '0' && (c) <= '9') #define isxdigit(c) (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) -#define isascii(c) ((c) >= 0 || (c <= 0x7f)) +#define isascii(c) (((unsigned char)c) <= 0x7f) #define isalpha(c) (isupper(c) || (islower(c))) static __inline int toupper(int c) @@ -307,8 +307,8 @@ extern void nullsys(void); extern int null_open(const char *path, struct open_file *f); extern int null_close(struct open_file *f); -extern ssize_t null_read(struct open_file *f, void *buf, size_t size, size_t *resid); -extern ssize_t null_write(struct open_file *f, void *buf, size_t size, size_t *resid); +extern int null_read(struct open_file *f, void *buf, size_t size, size_t *resid); +extern int null_write(struct open_file *f, void *buf, size_t size, size_t *resid); extern off_t null_seek(struct open_file *f, off_t offset, int where); extern int null_stat(struct open_file *f, struct stat *sb); |