[PATCH] Make XIGetKnownProperty take a const char * argument

Peter Hutterer peter.hutterer at who-t.net
Wed Nov 2 15:24:21 PDT 2011


On Wed, Nov 02, 2011 at 03:18:15PM -0700, Alan Coopersmith wrote:
> Now that MakeAtom takes const char *, so can XIGetKnownProperty.
> Clears 71 warnings from gcc -Wwrite-strings of the form:
> devices.c:145:5: warning: passing argument 1 of 'XIGetKnownProperty' discards qualifiers from pointer target type
> ../include/exevents.h:128:23: note: expected 'char *' but argument is of type 'const char *'
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter

> ---
>  Xi/xiproperty.c    |    2 +-
>  include/exevents.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
> index 14f1491..f726030 100644
> --- a/Xi/xiproperty.c
> +++ b/Xi/xiproperty.c
> @@ -386,7 +386,7 @@ change_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
>   * If name is NULL, None is returned.
>   */
>  Atom
> -XIGetKnownProperty(char *name)
> +XIGetKnownProperty(const char *name)
>  {
>      int i;
>  
> diff --git a/include/exevents.h b/include/exevents.h
> index 720fb2e..12ea378 100644
> --- a/include/exevents.h
> +++ b/include/exevents.h
> @@ -126,7 +126,7 @@ extern _X_EXPORT void XIUnregisterPropertyHandler(
>  );
>  
>  extern _X_EXPORT Atom XIGetKnownProperty(
> -        char*                 name
> +        const char*           name
>  );
>  
>  extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
> -- 
> 1.7.3.2
> 


More information about the xorg-devel mailing list