[PATCH 06/25] xres.c: Preserve constness of string returned by LookupResourceName
Alan Coopersmith
alan.coopersmith at oracle.com
Sun Dec 11 10:16:19 PST 2011
MakeAtom now accepts a const char * so we don't need to cast down to
char * anymore. Fixes gcc warning of:
xres.c: In function 'ProcXResQueryClientResources':
xres.c:155:6: warning: cast discards qualifiers from pointer target type
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
Xext/xres.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Xext/xres.c b/Xext/xres.c
index b952728..232fbab 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -147,12 +147,12 @@ ProcXResQueryClientResources (ClientPtr client)
if(num_types) {
xXResType scratch;
- char *name;
+ const char *name;
for(i = 0; i < lastResourceType; i++) {
if(!counts[i]) continue;
- name = (char *)LookupResourceName(i + 1);
+ name = LookupResourceName(i + 1);
if (strcmp(name, XREGISTRY_UNKNOWN))
scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
else {
--
1.7.3.2
More information about the xorg-devel
mailing list