]> git.proxmox.com Git - qemu.git/commitdiff
Make OpenBSD sparc-softmmu compile warning free
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 14 Jan 2009 18:08:08 +0000 (18:08 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 14 Jan 2009 18:08:08 +0000 (18:08 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6299 c046a42c-6fe2-441c-8c8c-71466251a162

hw/scsi-disk.c
qemu-char.c
sparc-dis.c
usb-bsd.c

index 4c4b921d91e4447ebff65e7d1208c8c1a9e8873e..744573e0d2e6f5262be85ed7b9c1bd366d7d5629 100644 (file)
@@ -821,7 +821,7 @@ SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq,
     strncpy(s->drive_serial_str, drive_get_serial(s->bdrv),
             sizeof(s->drive_serial_str));
     if (strlen(s->drive_serial_str) == 0)
-        strcpy(s->drive_serial_str, "0"); 
+        pstrcpy(s->drive_serial_str, sizeof(s->drive_serial_str), "0");
     d = (SCSIDevice *)qemu_mallocz(sizeof(SCSIDevice));
     d->state = s;
     d->destroy = scsi_destroy;
index 27cdd325a289b48380da0c4244c585b3708b6193..bc024e08d989bd6d722a50ef2849ef3f7e777287 100644 (file)
@@ -2053,11 +2053,11 @@ static CharDriverState *qemu_chr_open_tcp(const char *host_str,
     if (is_listen) {
         chr->filename = qemu_malloc(256);
         if (is_unix) {
-            strcpy(chr->filename, "unix:");
+            pstrcpy(chr->filename, 256, "unix:");
         } else if (is_telnet) {
-            strcpy(chr->filename, "telnet:");
+            pstrcpy(chr->filename, 256, "telnet:");
         } else {
-            strcpy(chr->filename, "tcp:");
+            pstrcpy(chr->filename, 256, "tcp:");
         }
         offset = strlen(chr->filename);
     }
index ae633f2cf9145241066b6c709d5ae55f2bb7acb6..f88efe66c7afec98cfc8fa21be898e7d4979ab2c 100644 (file)
@@ -224,7 +224,6 @@ typedef struct sparc_opcode
 #define RS2_G0  RS2 (~0)
 
 static const struct sparc_opcode sparc_opcodes[];
-static const int sparc_num_opcodes;
 
 static const char *sparc_decode_asi_v8 (int);
 static const char *sparc_decode_asi_v9 (int);
index 0e4157c58bd8ff21347d1d39e41723726f37c3b1..a8a805f064d53151d45bff181b2df3b9b1a77cc3 100644 (file)
--- a/usb-bsd.c
+++ b/usb-bsd.c
@@ -178,7 +178,7 @@ static int usb_host_handle_control(USBDevice *dev,
         req.ucr_flags = USBD_SHORT_XFER_OK;
 
         ret = ioctl(s->devfd, USB_SET_TIMEOUT, &timeout);
-#if (__NetBSD__ || __OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
         if (ret < 0 && errno != EINVAL) {
 #else
         if (ret < 0) {
@@ -372,7 +372,7 @@ USBDevice *usb_host_device_open(const char *devname)
                      "host:%s", devname);
 
         pstrcpy(dev->devpath, sizeof(dev->devpath), "/dev/");
-       strcat(dev->devpath, dev_info.udi_devnames[0]);
+        pstrcat(dev->devpath, sizeof(dev->devpath), dev_info.udi_devnames[0]);
 
         /* Mark the endpoints as not yet open */
         for (i = 0; i < USB_MAX_ENDPOINTS; i++)
@@ -550,10 +550,10 @@ static const char *usb_class_str(uint8_t class)
     return p->class_name;
 }
 
-void usb_info_device(int bus_num, int addr, int class_id,
-                     int vendor_id, int product_id,
-                     const char *product_name,
-                     int speed)
+static void usb_info_device(int bus_num, int addr, int class_id,
+                            int vendor_id, int product_id,
+                            const char *product_name,
+                            int speed)
 {
     const char *class_str, *speed_str;