This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
[PATCH]: Fix libgloss read/write prototypes
- From: Stephane Carrez <stcarrez at nerim dot fr>
- To: newlib at sources dot redhat dot com
- Date: Wed, 17 Jul 2002 00:49:01 +0200
- Subject: [PATCH]: Fix libgloss read/write prototypes
Hi!
The following patch fixes problems with read/write definition.
A size_t is not an int and read()/write() prototypes are defined with size_t.
The implementation must follow that too. The size_t definition is provided by gcc
in <stddef.h> so that libgloss does not rely on any libc header.
Can you integrate this patch ?
Thanks,
Stephane
2002-07-16 Stephane Carrez <Stephane.Carrez@nerim.fr>
* write.c (write): Use size_t for the size of the write.
* read.c (read): Likewise.
diff -Nrup --exclude=Makefile.in --exclude=configure --exclude=CVS newlib-main/libgloss/read.c newlib-main-integrate/libgloss/read.c
--- newlib-main/libgloss/read.c Fri Mar 17 23:48:49 2000
+++ newlib-main-integrate/libgloss/read.c Sat Jul 13 15:23:34 2002
@@ -13,6 +13,7 @@
* they apply.
*/
#include "glue.h"
+#include <stddef.h>
extern char _DEFUN_VOID (inbyte);
@@ -24,7 +25,7 @@ int
_DEFUN (read, (fd, buf, nbytes),
int fd _AND
char *buf _AND
- int nbytes)
+ size_t nbytes)
{
int i = 0;
diff -Nrup --exclude=Makefile.in --exclude=configure --exclude=CVS newlib-main/libgloss/write.c newlib-main-integrate/libgloss/write.c
--- newlib-main/libgloss/write.c Fri Mar 17 23:48:49 2000
+++ newlib-main-integrate/libgloss/write.c Sat Jul 13 15:23:34 2002
@@ -13,6 +13,7 @@
* they apply.
*/
#include "glue.h"
+#include <stddef.h>
extern int _EXFUN (outbyte, (char x));
@@ -25,7 +26,7 @@ int
_DEFUN (write, (fd, buf, nbytes),
int fd _AND
char *buf _AND
- int nbytes)
+ size_t nbytes)
{
int i;