]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fb-mem.c
tableprinter: code cleanup
[libucw.git] / ucw / fb-mem.c
index 61e94dadb52ed2ace1d074a317e3d8d5b9762506..77ad43d94f09573bd53d721aee8ff969db6c7c8c 100644 (file)
@@ -7,21 +7,21 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/fastbuf.h"
+#include <ucw/lib.h>
+#include <ucw/fastbuf.h>
 
 #include <stdio.h>
 
 struct memstream {
-  unsigned blocksize;
-  unsigned uc;
+  uint blocksize;
+  uint uc;
   struct msblock *first;
 };
 
 struct msblock {
   struct msblock *next;
   ucw_off_t pos;
-  unsigned size;
+  uint size;
   byte data[0];
 };
 
@@ -30,7 +30,7 @@ struct fb_mem {
   struct memstream *stream;
   struct msblock *block;
 };
-#define FB_MEM(f) ((struct fb_mem *)(f)->is_fastbuf)
+#define FB_MEM(f) ((struct fb_mem *)(f))
 
 static int
 fbmem_refill(struct fastbuf *f)
@@ -128,7 +128,7 @@ fbmem_seek(struct fastbuf *f, ucw_off_t pos, int whence)
       FB_MEM(f)->block = NULL;
       return 1;
     }
-  bthrow(f, "fb.seek", "fbmem_seek to invalid offset");
+  bthrow(f, "seek", "fbmem_seek to an invalid offset");
 }
 
 static void
@@ -150,7 +150,7 @@ fbmem_close(struct fastbuf *f)
 }
 
 struct fastbuf *
-fbmem_create(unsigned blocksize)
+fbmem_create(uint blocksize)
 {
   struct fastbuf *f = xmalloc_zero(sizeof(struct fb_mem));
   struct memstream *s = xmalloc_zero(sizeof(struct memstream));