[PATCH xserver 4/5] randr: Declare incoming property values const
Keith Packard
keithp at keithp.com
Fri Dec 8 05:56:04 UTC 2017
RRChangeOutputProperty and RRConfigureOutputProperty should not modify
their parameters, and callers may want to pass pointers to fixed data,
so declare the value pointers as const in both cases.
Signed-off-by: Keith Packard <keithp at keithp.com>
---
randr/randrstr.h | 4 ++--
randr/rrproperty.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 95979a8c6..3f218009d 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -915,13 +915,13 @@ extern _X_EXPORT int
RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len,
- void *value, Bool sendevent, Bool pending);
+ const void *value, Bool sendevent, Bool pending);
extern _X_EXPORT int
RRConfigureOutputProperty(RROutputPtr output, Atom property,
Bool pending, Bool range, Bool immutable,
- int num_values, INT32 *values);
+ int num_values, const INT32 *values);
extern _X_EXPORT int
ProcRRChangeOutputProperty(ClientPtr client);
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index e56626cd2..6ffe91a47 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -135,7 +135,7 @@ RRDeleteOutputProperty(RROutputPtr output, Atom property)
int
RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len,
- void *value, Bool sendevent, Bool pending)
+ const void *value, Bool sendevent, Bool pending)
{
RRPropertyPtr prop;
rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
@@ -324,7 +324,7 @@ RRGetOutputProperty(RROutputPtr output, Atom property, Bool pending)
int
RRConfigureOutputProperty(RROutputPtr output, Atom property,
Bool pending, Bool range, Bool immutable,
- int num_values, INT32 *values)
+ int num_values, const INT32 *values)
{
RRPropertyPtr prop = RRQueryOutputProperty(output, property);
Bool add = FALSE;
--
2.15.0.rc0
More information about the xorg-devel
mailing list