[PATCH:libXrandr] Constify a couple string arguments that are just copied, not modified
Alan Coopersmith
alan.coopersmith at oracle.com
Fri Aug 31 21:40:29 PDT 2012
Fixes compiler warnings when building app/xrandr:
xrandr.c: In function ‘crtc_set_transform’:
xrandr.c:1459:9: warning: passing argument 4 of ‘XRRSetCrtcTransform’ discards qualifiers from pointer target type
X11/extensions/Xrandr.h:419:1: note: expected ‘char *’ but argument is of type ‘const char *’
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
include/X11/extensions/Xrandr.h | 4 ++--
src/XrrCrtc.c | 2 +-
src/XrrMode.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index b1baf8a..f394864 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -341,7 +341,7 @@ XRRGetOutputProperty (Display *dpy, RROutput output,
unsigned char **prop);
XRRModeInfo *
-XRRAllocModeInfo (char *name, int nameLength);
+XRRAllocModeInfo (_Xconst char *name, int nameLength);
RRMode
XRRCreateMode (Display *dpy, Window window, XRRModeInfo *modeInfo);
@@ -419,7 +419,7 @@ void
XRRSetCrtcTransform (Display *dpy,
RRCrtc crtc,
XTransform *transform,
- char *filter,
+ _Xconst char *filter,
XFixed *params,
int nparams);
diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 0762373..04087c5 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -306,7 +306,7 @@ void
XRRSetCrtcTransform (Display *dpy,
RRCrtc crtc,
XTransform *transform,
- char *filter,
+ _Xconst char *filter,
XFixed *params,
int nparams)
{
diff --git a/src/XrrMode.c b/src/XrrMode.c
index 0b74a73..e605e8a 100644
--- a/src/XrrMode.c
+++ b/src/XrrMode.c
@@ -33,7 +33,7 @@
#include "Xrandrint.h"
XRRModeInfo *
-XRRAllocModeInfo (char *name, int nameLength)
+XRRAllocModeInfo (_Xconst char *name, int nameLength)
{
XRRModeInfo *mode_info;
--
1.7.9.2
More information about the xorg-devel
mailing list