From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVhp3-0001ZY-LN for qemu-devel@nongnu.org; Tue, 16 Feb 2016 10:45:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVhp2-00031A-Ng for qemu-devel@nongnu.org; Tue, 16 Feb 2016 10:45:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVhp2-00030S-6V for qemu-devel@nongnu.org; Tue, 16 Feb 2016 10:45:52 -0500 From: "Daniel P. Berrange" Date: Tue, 16 Feb 2016 15:45:18 +0000 Message-Id: <1455637518-16643-4-git-send-email-berrange@redhat.com> In-Reply-To: <1455637518-16643-1-git-send-email-berrange@redhat.com> References: <1455637518-16643-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PULL v1 3/3] io: convert QIOChannelBuffer to use uint8_t instead of char List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell 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 --- include/io/channel-buffer.h | 2 +- io/channel-buffer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/io/channel-buffer.h b/include/io/channel-buffer.h index 91a52b3..65c498b 100644 --- a/include/io/channel-buffer.h +++ b/include/io/channel-buffer.h @@ -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; }; diff --git a/io/channel-buffer.c b/io/channel-buffer.c index 0f7c567..3e5117b 100644 --- a/io/channel-buffer.c +++ b/io/channel-buffer.c @@ -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; } -- 2.5.0