]> Git Repo - qemu.git/commitdiff
vl: Use size_t for sizes in get_boot_devices_list()
authorMarkus Armbruster <[email protected]>
Wed, 16 Jan 2013 13:50:29 +0000 (14:50 +0100)
committerBlue Swirl <[email protected]>
Sat, 19 Jan 2013 10:22:48 +0000 (10:22 +0000)
Code mixes uint32_t, int and size_t.  Very unlikely to go wrong in
practice, but clean it up anyway.

Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
hw/fw_cfg.c
include/sysemu/sysemu.h
vl.c

index 699383c87a9bd6c9ced9fc5e20e47d12b9847baa..3b31d77f3fd3f7c5a4b67d4acc4f4c16b924963d 100644 (file)
@@ -471,7 +471,7 @@ void fw_cfg_add_file(FWCfgState *s,  const char *filename,
 
 static void fw_cfg_machine_ready(struct Notifier *n, void *data)
 {
-    uint32_t len;
+    size_t len;
     FWCfgState *s = container_of(n, FWCfgState, machine_ready);
     char *bootindex = get_boot_devices_list(&len);
 
index cd12f0931bfd8e7f38bc15e69f75f61a5847e238..6599617def4b7b32437bac176564c592b19c8667 100644 (file)
@@ -179,7 +179,7 @@ void register_devices(void);
 
 void add_boot_device_path(int32_t bootindex, DeviceState *dev,
                           const char *suffix);
-char *get_boot_devices_list(uint32_t *size);
+char *get_boot_devices_list(size_t *size);
 
 bool usb_enabled(bool default_usb);
 
diff --git a/vl.c b/vl.c
index f4cf7e8a85b74cbd137a607289baab1160f87bab..4ee130259593c9ab67edcd606c35df9b7215e663 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1198,15 +1198,15 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
  * memory pointed by "size" is assigned total length of the array in bytes
  *
  */
-char *get_boot_devices_list(uint32_t *size)
+char *get_boot_devices_list(size_t *size)
 {
     FWBootEntry *i;
-    uint32_t total = 0;
+    size_t total = 0;
     char *list = NULL;
 
     QTAILQ_FOREACH(i, &fw_boot_order, link) {
         char *devpath = NULL, *bootpath;
-        int len;
+        size_t len;
 
         if (i->dev) {
             devpath = qdev_get_fw_dev_path(i->dev);
This page took 0.035491 seconds and 4 git commands to generate.