io: convert QIOChannelBuffer to use uint8_t instead of char
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 12 Feb 2016 16:45:31 +0000 (16:45 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 15 Feb 2016 14:49:18 +0000 (14:49 +0000)
The QIOChannelBuffer struct uses a 'char *' for its data
buffer. It will give simpler type compatibility with the
migration APIs if it uses 'uint8_t *' instead, avoiding
several casts.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
include/io/channel-buffer.h
io/channel-buffer.c

index 91a52b3..65c498b 100644 (file)
@@ -42,7 +42,7 @@ struct QIOChannelBuffer {
     size_t capacity; /* Total allocated memory */
     size_t usage;    /* Current size of data */
     size_t offset;   /* Offset for future I/O ops */
-    char *data;
+    uint8_t *data;
 };
 
 
index 0f7c567..3e5117b 100644 (file)
@@ -32,7 +32,7 @@ qio_channel_buffer_new(size_t capacity)
     ioc = QIO_CHANNEL_BUFFER(object_new(TYPE_QIO_CHANNEL_BUFFER));
 
     if (capacity) {
-        ioc->data = g_new0(char, capacity);
+        ioc->data = g_new0(uint8_t, capacity);
         ioc->capacity = capacity;
     }