aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-20 08:04:11 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-20 08:04:11 +0000
commit67d8cec34b1560973f5c25e14fac53b4ef5b0f6e (patch)
treee498b399e74162fc7b45d025170247f05990bcea /vl.c
parentb40d0353b0d43517ba1ab1c07eb86a1cb27f87f9 (diff)
Add signed versions of save/load functions
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5274 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/vl.c b/vl.c
index bf97b90b52..c1ce17fe9a 100644
--- a/vl.c
+++ b/vl.c
@@ -6247,9 +6247,9 @@ void qemu_fclose(QEMUFile *f)
qemu_free(f);
}
-void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)
+void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, size_t size)
{
- int l;
+ size_t l;
while (size > 0) {
l = IO_BUF_SIZE - f->buf_index;
if (l > size)
@@ -6263,16 +6263,16 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)
}
}
-void qemu_put_byte(QEMUFile *f, int v)
+void qemu_put_byte(QEMUFile *f, int8_t v)
{
f->buf[f->buf_index++] = v;
if (f->buf_index >= IO_BUF_SIZE)
qemu_fflush(f);
}
-int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1)
+size_t qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size1)
{
- int size, l;
+ size_t size, l;
size = size1;
while (size > 0) {
@@ -6293,7 +6293,7 @@ int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1)
return size1 - size;
}
-int qemu_get_byte(QEMUFile *f)
+int8_t qemu_get_byte(QEMUFile *f)
{
if (f->buf_index >= f->buf_size) {
qemu_fill_buffer(f);
@@ -6329,13 +6329,13 @@ int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence)
return pos;
}
-void qemu_put_be16(QEMUFile *f, unsigned int v)
+void qemu_put_be16(QEMUFile *f, uint16_t v)
{
qemu_put_byte(f, v >> 8);
qemu_put_byte(f, v);
}
-void qemu_put_be32(QEMUFile *f, unsigned int v)
+void qemu_put_be32(QEMUFile *f, uint32_t v)
{
qemu_put_byte(f, v >> 24);
qemu_put_byte(f, v >> 16);
@@ -6349,17 +6349,17 @@ void qemu_put_be64(QEMUFile *f, uint64_t v)
qemu_put_be32(f, v);
}
-unsigned int qemu_get_be16(QEMUFile *f)
+uint16_t qemu_get_be16(QEMUFile *f)
{
- unsigned int v;
+ uint16_t v;
v = qemu_get_byte(f) << 8;
v |= qemu_get_byte(f);
return v;
}
-unsigned int qemu_get_be32(QEMUFile *f)
+uint32_t qemu_get_be32(QEMUFile *f)
{
- unsigned int v;
+ uint32_t v;
v = qemu_get_byte(f) << 24;
v |= qemu_get_byte(f) << 16;
v |= qemu_get_byte(f) << 8;