Author: wmb Date: Tue Mar 27 22:00:03 2012 New Revision: 2922 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2922
Log: Client library - fixed residual problem from recent cleanup.
Modified: clients/lib/1275.h clients/lib/lib.c clients/lib/string.h clients/lib/strings.c
Modified: clients/lib/1275.h ============================================================================== --- clients/lib/1275.h Tue Mar 27 09:59:35 2012 (r2921) +++ clients/lib/1275.h Tue Mar 27 22:00:03 2012 (r2922) @@ -42,21 +42,14 @@ #include <stdlib.h>
extern int decode_int(UCHAR *); -extern void exit(int); extern void fatal(char *fmt, ...); -extern void free(void *); extern cell_t get_cell_prop(phandle, char *); extern cell_t get_cell_prop_def(phandle, char *, cell_t); extern int get_int_prop(phandle, char *); extern int get_int_prop_def(phandle, char *, int); extern char *get_str_prop(phandle, const char *, allocflag); -extern void *malloc(size_t); -extern void memcpy(void *, void *, size_t); -extern void memset(void *, int, size_t); -extern int memcmp(const void *, const void *, size_t); extern int printf(char *fmt, ...); -extern void putchar(UCHAR); -extern void *realloc(void *, size_t); +extern int putchar(int); extern void warn(char *fmt, ...); extern void *zalloc(size_t);
Modified: clients/lib/lib.c ============================================================================== --- clients/lib/lib.c Tue Mar 27 09:59:35 2012 (r2921) +++ clients/lib/lib.c Tue Mar 27 22:00:03 2012 (r2922) @@ -129,23 +129,23 @@ }
int -fputc(char c, FILE *fp) +fputc(int c, FILE *fp) { if (fp->readonly) return -1; // EOF
- if (fp == stdout && c == '\n') + if (fp == stdout && (unsigned char)c == '\n') (void) fputc('\r', fp);
- fp->buf[fp->bufc++] = c; + fp->buf[fp->bufc++] = (unsigned char)c; fp->dirty = 1;
- if ((fp->bufc == 127) || (fp == stdout && c == '\n')) { + if ((fp->bufc == 127) || (fp == stdout && (unsigned char)c == '\n')) { OFWrite(fp->id, fp->buf, fp->bufc); fp->bufc = 0; fp->dirty = 0; } - return (int)c; + return (int)(unsigned char)c; }
void @@ -216,8 +216,8 @@ return(fgetc(stdin)); }
-void -putchar(UCHAR c) +int +putchar(int c) { fputc(c, stdout); }
Modified: clients/lib/string.h ============================================================================== --- clients/lib/string.h Tue Mar 27 09:59:35 2012 (r2921) +++ clients/lib/string.h Tue Mar 27 22:00:03 2012 (r2922) @@ -14,5 +14,8 @@ char *strctok(char *s, const char sep); char *strstr(const char *haystack, const char *needle); char *strcasestr(const char *haystack, const char *needle); -const void *memchr(const void *s, int c, size_t len); +void *memchr(const void *s, int c, size_t len); +void *memcpy(void *dest, const void *src, size_t n); +int memcmp(const void *s1, const void *s2, size_t n); +void *memset(void *s, int c, size_t n); int toupper(int c);
Modified: clients/lib/strings.c ============================================================================== --- clients/lib/strings.c Tue Mar 27 09:59:35 2012 (r2921) +++ clients/lib/strings.c Tue Mar 27 22:00:03 2012 (r2922) @@ -188,7 +188,7 @@ return NULL; }
-const void *memchr(const void *s, int c, size_t len) +void *memchr(const void *s, int c, size_t len) { const unsigned char *p = s; while (len--) {
openfirmware@openfirmware.info