MINOR: buffer: switch buffer sizes and offsets to size_t
Passing unsigned ints everywhere is painful, and will cause some headache
later when we'll want to integrate better with struct ist which already
uses size_t. Let's switch buffers to use size_t instead.
diff --git a/include/common/buf.h b/include/common/buf.h
index 998e31a..4c372de 100644
--- a/include/common/buf.h
+++ b/include/common/buf.h
@@ -28,13 +28,15 @@
#ifndef _COMMON_BUF_H
#define _COMMON_BUF_H
+#include <stdint.h>
+
/* Structure defining a buffer's head */
struct buffer {
char *p; /* buffer's start pointer, separates in and out data */
- unsigned int size; /* buffer size in bytes */
- unsigned int i; /* number of input bytes pending for analysis in the buffer */
- unsigned int o; /* number of out bytes the sender can consume from this buffer */
+ size_t size; /* buffer size in bytes */
+ size_t i; /* number of input bytes pending for analysis in the buffer */
+ size_t o; /* number of out bytes the sender can consume from this buffer */
char data[0]; /* <size> bytes of stored data */
};