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

Julien Cristau jcristau at debian.org
Fri May 14 06:12:04 PDT 2010


On Fri, May 14, 2010 at 06:08:00 -0700, Dan Nicholson wrote:

> On Wed, May 12, 2010 at 09:38:05PM +0200, Julien Cristau wrote:
> > diff --git a/include/input.h b/include/input.h
> > index 63f981e..aadcdf1 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;
> > +    char        * const *tags; /* null-terminated */
> 
> I guess I would prefer this as "const char **", a pointer to a pointer
> to an immutable string, instead of "char * const *", a pointer to an
> immutable pointer to a string. Better would be "const char * const *",
> but maybe that's getting pathological.
> 
> Did you choose this because it required no explicit casts?
> 
Yes, I tried for a while to use const char * const *, and then my head
hurt, so I gave up :)

Cheers,
Julien


More information about the xorg-devel mailing list