From 29f79bedf2c80241ba4b482db6ead08a5709a982 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 21 Dec 2017 18:54:37 -0800 Subject: [PATCH] randr: Declare incoming property values const 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. Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- 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;