Commit 00766a4ec9dd748dab308f6a2b00f02e964d9951

Authored by blueswir1
1 parent 61dca5aa

Make OpenBSD sparc-softmmu compile warning free

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6299 c046a42c-6fe2-441c-8c8c-71466251a162
hw/scsi-disk.c
... ... @@ -821,7 +821,7 @@ SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq,
821 821 strncpy(s->drive_serial_str, drive_get_serial(s->bdrv),
822 822 sizeof(s->drive_serial_str));
823 823 if (strlen(s->drive_serial_str) == 0)
824   - strcpy(s->drive_serial_str, "0");
  824 + pstrcpy(s->drive_serial_str, sizeof(s->drive_serial_str), "0");
825 825 d = (SCSIDevice *)qemu_mallocz(sizeof(SCSIDevice));
826 826 d->state = s;
827 827 d->destroy = scsi_destroy;
... ...
qemu-char.c
... ... @@ -2053,11 +2053,11 @@ static CharDriverState *qemu_chr_open_tcp(const char *host_str,
2053 2053 if (is_listen) {
2054 2054 chr->filename = qemu_malloc(256);
2055 2055 if (is_unix) {
2056   - strcpy(chr->filename, "unix:");
  2056 + pstrcpy(chr->filename, 256, "unix:");
2057 2057 } else if (is_telnet) {
2058   - strcpy(chr->filename, "telnet:");
  2058 + pstrcpy(chr->filename, 256, "telnet:");
2059 2059 } else {
2060   - strcpy(chr->filename, "tcp:");
  2060 + pstrcpy(chr->filename, 256, "tcp:");
2061 2061 }
2062 2062 offset = strlen(chr->filename);
2063 2063 }
... ...
sparc-dis.c
... ... @@ -224,7 +224,6 @@ typedef struct sparc_opcode
224 224 #define RS2_G0 RS2 (~0)
225 225  
226 226 static const struct sparc_opcode sparc_opcodes[];
227   -static const int sparc_num_opcodes;
228 227  
229 228 static const char *sparc_decode_asi_v8 (int);
230 229 static const char *sparc_decode_asi_v9 (int);
... ...
usb-bsd.c
... ... @@ -178,7 +178,7 @@ static int usb_host_handle_control(USBDevice *dev,
178 178 req.ucr_flags = USBD_SHORT_XFER_OK;
179 179  
180 180 ret = ioctl(s->devfd, USB_SET_TIMEOUT, &timeout);
181   -#if (__NetBSD__ || __OpenBSD__)
  181 +#if defined(__NetBSD__) || defined(__OpenBSD__)
182 182 if (ret < 0 && errno != EINVAL) {
183 183 #else
184 184 if (ret < 0) {
... ... @@ -372,7 +372,7 @@ USBDevice *usb_host_device_open(const char *devname)
372 372 "host:%s", devname);
373 373  
374 374 pstrcpy(dev->devpath, sizeof(dev->devpath), "/dev/");
375   - strcat(dev->devpath, dev_info.udi_devnames[0]);
  375 + pstrcat(dev->devpath, sizeof(dev->devpath), dev_info.udi_devnames[0]);
376 376  
377 377 /* Mark the endpoints as not yet open */
378 378 for (i = 0; i < USB_MAX_ENDPOINTS; i++)
... ... @@ -550,10 +550,10 @@ static const char *usb_class_str(uint8_t class)
550 550 return p->class_name;
551 551 }
552 552  
553   -void usb_info_device(int bus_num, int addr, int class_id,
554   - int vendor_id, int product_id,
555   - const char *product_name,
556   - int speed)
  553 +static void usb_info_device(int bus_num, int addr, int class_id,
  554 + int vendor_id, int product_id,
  555 + const char *product_name,
  556 + int speed)
557 557 {
558 558 const char *class_str, *speed_str;
559 559  
... ...