From 070fb078b63def28df51407cd5ea411b14e7f099 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 27 Dec 1999 08:45:14 +0000 Subject: 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 --- lib/libstand/nullfs.c | 5 +++-- lib/libstand/printf.c | 1 + lib/libstand/stand.h | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/libstand') 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 +#include #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); -- cgit v1.1