qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix compiler warning on parsing the -usbdevice parameter
@ 2010-03-07 20:27 Niels de Vos
  2010-03-07 20:42 ` [Qemu-devel] " Niels de Vos
  0 siblings, 1 reply; 3+ messages in thread
From: Niels de Vos @ 2010-03-07 20:27 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

With the added checks on the parameter for -usbdevice, the following
warning got introduced:

hw/usb-bus.c: In function ‘usbdevice_create’:
hw/usb-bus.c:278: error: assignment discards qualifiers from pointer target type

It is okay to drop the qualifier (const) from the empty string here.

Signed-off-by: Niels de Vos <nixpanic@users.sourceforge.net>

diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 89e2ea6..d058e14 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -275,7 +275,7 @@ USBDevice *usbdevice_create(const char *cmdline)
             len = sizeof(driver);
         pstrcpy(driver, len, cmdline);
     } else {
-        params = "";
+        params = (char*) "";
         pstrcpy(driver, sizeof(driver), cmdline);
     }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] Fix compiler warning on parsing the -usbdevice parameter
  2010-03-07 20:27 [Qemu-devel] [PATCH] Fix compiler warning on parsing the -usbdevice parameter Niels de Vos
@ 2010-03-07 20:42 ` Niels de Vos
  2010-03-08  7:58   ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Niels de Vos @ 2010-03-07 20:42 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

Ah, just noticed this warning is only in Jans git... For those who
were wondering :)

Cheers,
Niels

On 3/7/10, Niels de Vos <nixpanic@users.sourceforge.net> wrote:
> With the added checks on the parameter for -usbdevice, the following
> warning got introduced:
>
> hw/usb-bus.c: In function ‘usbdevice_create’:
> hw/usb-bus.c:278: error: assignment discards qualifiers from pointer target
> type
>
> It is okay to drop the qualifier (const) from the empty string here.
>
> Signed-off-by: Niels de Vos <nixpanic@users.sourceforge.net>
>
> diff --git a/hw/usb-bus.c b/hw/usb-bus.c
> index 89e2ea6..d058e14 100644
> --- a/hw/usb-bus.c
> +++ b/hw/usb-bus.c
> @@ -275,7 +275,7 @@ USBDevice *usbdevice_create(const char *cmdline)
>              len = sizeof(driver);
>          pstrcpy(driver, len, cmdline);
>      } else {
> -        params = "";
> +        params = (char*) "";
>          pstrcpy(driver, sizeof(driver), cmdline);
>      }
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] Fix compiler warning on parsing the -usbdevice parameter
  2010-03-07 20:42 ` [Qemu-devel] " Niels de Vos
@ 2010-03-08  7:58   ` Jan Kiszka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2010-03-08  7:58 UTC (permalink / raw)
  To: Niels de Vos; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]

Niels de Vos wrote:
> Ah, just noticed this warning is only in Jans git... For those who
> were wondering :)

Yes, and I forgot to push my fixup. Thanks nevertheless.

Jan

> 
> Cheers,
> Niels
> 
> On 3/7/10, Niels de Vos <nixpanic@users.sourceforge.net> wrote:
>> With the added checks on the parameter for -usbdevice, the following
>> warning got introduced:
>>
>> hw/usb-bus.c: In function ‘usbdevice_create’:
>> hw/usb-bus.c:278: error: assignment discards qualifiers from pointer target
>> type
>>
>> It is okay to drop the qualifier (const) from the empty string here.
>>
>> Signed-off-by: Niels de Vos <nixpanic@users.sourceforge.net>
>>
>> diff --git a/hw/usb-bus.c b/hw/usb-bus.c
>> index 89e2ea6..d058e14 100644
>> --- a/hw/usb-bus.c
>> +++ b/hw/usb-bus.c
>> @@ -275,7 +275,7 @@ USBDevice *usbdevice_create(const char *cmdline)
>>              len = sizeof(driver);
>>          pstrcpy(driver, len, cmdline);
>>      } else {
>> -        params = "";
>> +        params = (char*) "";
>>          pstrcpy(driver, sizeof(driver), cmdline);
>>      }
>>



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-08  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-07 20:27 [Qemu-devel] [PATCH] Fix compiler warning on parsing the -usbdevice parameter Niels de Vos
2010-03-07 20:42 ` [Qemu-devel] " Niels de Vos
2010-03-08  7:58   ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).