|
From: | Stefan Berger |
Subject: | Re: [Qemu-devel] [PATCH 3/9] two new file wrappers |
Date: | Thu, 14 Mar 2013 06:49:50 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 |
On 03/13/2013 05:04 PM, Eric Blake wrote:
On 03/13/2013 12:56 PM, Joel Schopp wrote:Add a 3 very short file wrapper functions to make code that follows mores/a 3/3/readable. Also export an existing function that is currently static. Cc: Michael Tsirkin <address@hidden> Signed-off-by: Stefan Berger <address@hidden> Signed-off-by: Joel Schopp <address@hidden> --- include/migration/qemu-file.h | 3 +++ util/qemu-file.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) + +int qemu_peek_bytes(QEMUFile *f, uint8_t *buf, int size, size_t offset)Should we be using off_t instead of size_t for offset; and size_t instead of int for size (which implies ssize_t for return value)?
Good question. Existing functions have signatures like this: void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size) static void qemu_file_skip(QEMUFile *f, int size)static int qemu_peek_buffer(QEMUFile *f, uint8_t *buf, int size, size_t offset)
static int qemu_peek_byte(QEMUFile *f, int offset) So it's better if we line up behind them... Stefan
[Prev in Thread] | Current Thread | [Next in Thread] |