]> mj.ucw.cz Git - libucw.git/commitdiff
lib/fastbuf.h no longer includes <stdio.h>.
authorMartin Mares <mj@ucw.cz>
Sat, 10 Mar 2007 19:44:43 +0000 (20:44 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 10 Mar 2007 19:44:43 +0000 (20:44 +0100)
Added zillions of missing includes and fixed handling of EOF.
Mentioned in doc/changes.

lib/fastbuf.c
lib/fastbuf.h
lib/fb-buffer.c
lib/fb-file.c
lib/fb-grow.c
lib/fb-mem.c
lib/fb-temp.c
lib/ff-printf.c
lib/qache.c

index 79229d4e1d372bf981a92cd4c5adea28b3802b7c..4817bab3779095a4ce63bd05a0a00279a2bbe56a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Fast Buffered I/O
  *
- *     (c) 1997--2006 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2007 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -10,6 +10,7 @@
 #include "lib/lib.h"
 #include "lib/fastbuf.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 void bclose(struct fastbuf *f)
@@ -66,7 +67,7 @@ int bgetc_slow(struct fastbuf *f)
   if (f->bptr < f->bstop)
     return *f->bptr++;
   if (!f->refill(f))
-    return EOF;
+    return -1;
   return *f->bptr++;
 }
 
@@ -75,7 +76,7 @@ int bpeekc_slow(struct fastbuf *f)
   if (f->bptr < f->bstop)
     return *f->bptr;
   if (!f->refill(f))
-    return EOF;
+    return -1;
   return *f->bptr;
 }
 
index 12bb5da2be3282a4ddee460b002ac85a1917b9d1..6961fd2c80152dd30897e4b9b03859a7d58ec367 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Fast Buffered I/O
  *
- *     (c) 1997--2004 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2007 Martin Mares <mj@ucw.cz>
  *     (c) 2004 Robert Spalek <robert@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
 #ifndef _UCW_FASTBUF_H
 #define _UCW_FASTBUF_H
 
-#ifndef EOF
-#include <stdio.h>
-#endif
-
 #include <string.h>
 #include <alloca.h>
 
index 9ad248a289db329ecabec693c29f103c78e47965..d8094eb027e2c880c69da1f0fda4550362deaeeb 100644 (file)
@@ -10,6 +10,7 @@
 #include "lib/lib.h"
 #include "lib/fastbuf.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 static int
index c45432775ca2ba2349a05f4a2a7ffa4143e84cfd..bd0f4d1ef41800fd9a6b06210c79e94f3811d090 100644 (file)
@@ -11,6 +11,7 @@
 #include "lib/fastbuf.h"
 #include "lib/lfs.h"
 
+#include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
index 1a10a50172cdb83e81ac40f671df80f17cc229dd..a5ed4d685a0c7c5adf1a43d0ba0c40942545ea73 100644 (file)
@@ -10,6 +10,7 @@
 #include "lib/lib.h"
 #include "lib/fastbuf.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 struct fb_gbuf {
index c3f104f13d47732403ef57cf96cf04dca624783b..c304e16db0b988b73aaf630ecb0af0fe335fdebf 100644 (file)
@@ -10,6 +10,8 @@
 #include "lib/lib.h"
 #include "lib/fastbuf.h"
 
+#include <stdio.h>
+
 struct memstream {
   unsigned blocksize;
   unsigned uc;
index 7162fd2e4825c985034796f732b9ff501c58e28f..4bcced6c4ecd56c5d3bac1064845807a09cd5917 100644 (file)
@@ -12,6 +12,7 @@
 #include "lib/fastbuf.h"
 #include "lib/threads.h"
 
+#include <stdio.h>
 #include <unistd.h>
 #include <sys/fcntl.h>
 
index 769f830e1cd5423e7db5e80831bc090ba67e98b0..8825a2880437dff93a19e29b5e947d68b294a64b 100644 (file)
@@ -10,6 +10,7 @@
 #include "lib/lib.h"
 #include "lib/fastbuf.h"
 
+#include <stdio.h>
 #include <alloca.h>
 
 int
index 5a832bb76d19063fad33bc7c26a0a354b2b34ad9..c1a5024a114d3cc84606da7ed299bd673a82a8c5 100644 (file)
@@ -11,6 +11,7 @@
 #include "lib/fastbuf.h"
 #include "lib/qache.h"
 
+#include <stdio.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>