[PATCH 1/7] Fix a couple of compiler warnings

Dan Nicholson dbn.lists at gmail.com
Thu May 13 13:17:41 PDT 2010


2010/5/13 Kristian Høgsberg <krh at bitplanet.net>:
> On Wed, May 12, 2010 at 5:45 PM, Keith Packard <keithp at keithp.com> wrote:
>> Signed-off-by: Keith Packard <keithp at keithp.com>
>> ---
>>  config/udev.c             |    6 +++---
>>  hw/dmx/dmxgc.c            |    2 ++
>>  hw/dmx/glxProxy/glxcmds.c |    2 +-
>>  3 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/config/udev.c b/config/udev.c
>> index 5e8d8da..d706a77 100644
>> --- a/config/udev.c
>> +++ b/config/udev.c
>> @@ -81,12 +81,12 @@ device_added(struct udev_device *udev_device)
>>     if (!name)
>>         name = "(unnamed)";
>>     else
>> -        attrs.product = name;
>> +        attrs.product = (char *) name;
>>     add_option(&options, "name", name);
>>
>>     add_option(&options, "path", path);
>>     add_option(&options, "device", path);
>> -    attrs.device = path;
>> +    attrs.device = (char *) path;
>>     attrs.tags = xstrtokenize(udev_device_get_property_value(udev_device, "ID_INPUT.tags"), ",");
>
> This works for me and seems like a better way to fix those warnings:
>
> diff --git a/include/input.h b/include/input.h
> index 63f981e..eba4292 100644
> --- a/include/input.h
> +++ b/include/input.h
> @@ -212,10 +212,10 @@ typedef struct _InputOption {
>  } InputOption;
>
>  typedef struct _InputAttributes {
> -    char                *product;
> -    char                *vendor;
> -    char                *device;
> -    char                **tags; /* null-terminated */
> +    const char         *product;
> +    const char         *vendor;
> +    const char         *device;
> +    const char        **tags; /* null-terminated */
>     uint32_t            flags;
>  } InputAttributes;

Yeah, Julien and I have patches that do essentially this, but also fix
it for config/hal. See the previous thread:

http://lists.freedesktop.org/archives/xorg-devel/2010-May/008239.html

--
Dan


More information about the xorg-devel mailing list