summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-12-12 16:49:33 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-12-12 17:03:08 -0800
commit2ddae8f0bd2a9ce0cd15bf3848393af29e615acf (patch)
tree98bf0ad72f09e0968bc6e8ef451dd2ce086d2d98 /include
parent424dbde891486ad6a6c00c61a334031ff18f5556 (diff)
constify strings in resource name registry
LookupResourceName already returned a const char *, so just needed to change the variable we're storing the list in to be a const char ** and then add const to the name argument to RegisterResourceName (which just stores name in the array) and CreateNewResourceType (which just passes name to RegisterResourceName). Clears a bunch of gcc warnings of the form: registry.c:319:5: warning: passing argument 2 of 'RegisterResourceName' discards qualifiers from pointer target type registry.c:200:1: note: expected 'char *' but argument is of type 'const char *' and from all the extensions: damageext.c: In function 'DamageExtensionInit': damageext.c:490:5: warning: passing argument 2 of 'CreateNewResourceType' discards qualifiers from pointer target type ../include/resource.h:159:26: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include')
-rw-r--r--include/registry.h2
-rw-r--r--include/resource.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/registry.h b/include/registry.h
index 325f76515..44f79259e 100644
--- a/include/registry.h
+++ b/include/registry.h
@@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Registration functions. The name string is not copied, so it must
* not be a stack variable.
*/
-extern _X_EXPORT void RegisterResourceName(RESTYPE type, char *name);
+extern _X_EXPORT void RegisterResourceName(RESTYPE type, const char *name);
extern _X_EXPORT void RegisterExtensionNames(ExtensionEntry *ext);
/*
diff --git a/include/resource.h b/include/resource.h
index 772b7b877..5da281913 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -157,7 +157,7 @@ typedef Bool (*FindComplexResType)(
pointer /*cdata*/);
extern _X_EXPORT RESTYPE CreateNewResourceType(
- DeleteType /*deleteFunc*/, char * /*name*/);
+ DeleteType /*deleteFunc*/, const char * /*name*/);
extern _X_EXPORT void SetResourceTypeErrorValue(
RESTYPE /*type*/, int /*errorValue*/);