[PATCH:libX11] Mark atom names argument to XInternAtoms as const

Alan Coopersmith alan.coopersmith at oracle.com
Mon Nov 22 00:04:04 PST 2010


Updates code & docs for XInternAtoms.

The single atom name argument to XInternAtom was already const char *
in the code, but not the docs, so updated it in the docs too.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 include/X11/Xlib.h    |    2 +-
 man/XInternAtom.man   |    8 ++++----
 specs/libX11/CH04.xml |    4 ++--
 src/IntAtom.c         |    4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/X11/Xlib.h b/include/X11/Xlib.h
index 5c6c770..b0d7d4d 100644
--- a/include/X11/Xlib.h
+++ b/include/X11/Xlib.h
@@ -1548,7 +1548,7 @@ extern Atom XInternAtom(
 );
 extern Status XInternAtoms(
     Display*		/* dpy */,
-    char**		/* names */,
+    _Xconst char**	/* names */,
     int			/* count */,
     Bool		/* onlyIfExists */,
     Atom*		/* atoms_return */
diff --git a/man/XInternAtom.man b/man/XInternAtom.man
index 237ed91..44aa68a 100644
--- a/man/XInternAtom.man
+++ b/man/XInternAtom.man
@@ -144,11 +144,11 @@
 XInternAtom, XInternAtoms, XGetAtomName, XGetAtomNames \- create or return atom names
 .SH SYNTAX
 .HP
-Atom XInternAtom\^(\^Display *\fIdisplay\fP\^, char *\fIatom_name\fP\^, Bool
-\fIonly_if_exists\fP\^); 
+Atom XInternAtom\^(\^Display *\fIdisplay\fP\^, const char *\fIatom_name\fP\^,
+Bool \fIonly_if_exists\fP\^);
 .HP
-Status XInternAtoms\^(\^Display *\fIdisplay\fP\^, char **\fInames\fP\^, int
-\fIcount\fP\^, Bool \fIonly_if_exists\fP\^, Atom *\fIatoms_return\fP\^); 
+Status XInternAtoms\^(\^Display *\fIdisplay\fP\^, const char **\fInames\fP\^,
+int \fIcount\fP\^, Bool \fIonly_if_exists\fP\^, Atom *\fIatoms_return\fP\^);
 .HP
 char *XGetAtomName\^(\^Display *\fIdisplay\fP\^, Atom \fIatom\fP\^); 
 .HP
diff --git a/specs/libX11/CH04.xml b/specs/libX11/CH04.xml
index 8a3e8c5..e2bca72 100644
--- a/specs/libX11/CH04.xml
+++ b/specs/libX11/CH04.xml
@@ -1054,7 +1054,7 @@ To return an atom for a given name, use
 <funcprototype>
   <funcdef>Atom <function>XInternAtom</function></funcdef>
   <paramdef>Display<parameter> *display</parameter></paramdef>
-  <paramdef>char<parameter> *atom_name</parameter></paramdef>
+  <paramdef>const char<parameter> *atom_name</parameter></paramdef>
   <paramdef>Bool<parameter> only_if_exists</parameter></paramdef>
 </funcprototype>
 </funcsynopsis>
@@ -1136,7 +1136,7 @@ To return atoms for an array of names, use
 <funcprototype>
   <funcdef>Status <function>XInternAtoms</function></funcdef>
   <paramdef>Display<parameter> *display</parameter></paramdef>
-  <paramdef>char<parameter> **names</parameter></paramdef>
+  <paramdef>const char<parameter> **names</parameter></paramdef>
   <paramdef>int<parameter> count</parameter></paramdef>
   <paramdef>Bool<parameter> only_if_exists</parameter></paramdef>
   <paramdef>Atom<parameter> *atoms_return</parameter></paramdef>
diff --git a/src/IntAtom.c b/src/IntAtom.c
index 7a56258..80d78c0 100644
--- a/src/IntAtom.c
+++ b/src/IntAtom.c
@@ -190,7 +190,7 @@ XInternAtom (
 typedef struct {
     unsigned long start_seq;
     unsigned long stop_seq;
-    char **names;
+    const char **names;
     Atom *atoms;
     int count;
     Status status;
@@ -239,7 +239,7 @@ Bool _XIntAtomHandler(
 Status
 XInternAtoms (
     Display *dpy,
-    char **names,
+    const char **names,
     int count,
     Bool onlyIfExists,
     Atom *atoms_return)
-- 
1.7.3.2



More information about the xorg-devel mailing list