From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PULL v1 3/3] io: convert QIOChannelBuffer to use uint8_t instead of char
Date: Tue, 16 Feb 2016 15:45:18 +0000 [thread overview]
Message-ID: <1455637518-16643-4-git-send-email-berrange@redhat.com> (raw)
In-Reply-To: <1455637518-16643-1-git-send-email-berrange@redhat.com>
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 | 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
next prev parent reply other threads:[~2016-02-16 15:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 15:45 [Qemu-devel] [PULL v1 0/3] Misc I/O fixes Daniel P. Berrange
2016-02-16 15:45 ` [Qemu-devel] [PULL v1 1/3] io: improve docs for QIOChannelSocket async functions Daniel P. Berrange
2016-02-16 15:45 ` [Qemu-devel] [PULL v1 2/3] io: introduce helper for creating channels from file descriptors Daniel P. Berrange
2016-02-16 15:45 ` Daniel P. Berrange [this message]
2016-02-16 17:31 ` [Qemu-devel] [PULL v1 0/3] Misc I/O fixes Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455637518-16643-4-git-send-email-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).