diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-19 00:26:29 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-22 19:46:45 -0800 |
commit | caf9e3393d5d517ea129392d001a2c46a7c1f325 (patch) | |
tree | eaed1d830f1985817fcaa2c3315acc0079711694 | |
parent | 59c1555dff34804c78c7e7443ad13f27300927eb (diff) |
Constify protocol, vendor & release string args to IceRegisterForProtocol*
Needed to resolve gcc -Wwrite-strings warnings in callers.
These functions only pass the strings to strcmp before calling
strdup to make their own private copy for storing away.
While fixing the API docs to match, also fix them to match the existing
function prototypes, where there were several errors before (including
just plain missing most of the args to IceRegisterForProtocolReply).
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | doc/ICElib.xml | 26 | ||||
-rw-r--r-- | include/X11/ICE/ICElib.h | 12 | ||||
-rw-r--r-- | src/register.c | 12 |
3 files changed, 30 insertions, 20 deletions
diff --git a/doc/ICElib.xml b/doc/ICElib.xml index 60d9dbe..dfa4c8b 100644 --- a/doc/ICElib.xml +++ b/doc/ICElib.xml @@ -208,16 +208,15 @@ function should be called for the client that initiates a <funcsynopsis id='IceRegisterForProtocolSetup'> <funcprototype> <funcdef>int <function>IceRegisterForProtocolSetup</function></funcdef> - <paramdef>char<parameter> *protocol_name</parameter></paramdef> - <paramdef>char<parameter> *vendor</parameter></paramdef> - <paramdef>char<parameter> *release</parameter></paramdef> - <paramdef>int<parameter> *version_count</parameter></paramdef> - <paramdef>int<parameter> *version_count</parameter></paramdef> + <paramdef>const char<parameter> *protocol_name</parameter></paramdef> + <paramdef>const char<parameter> *vendor</parameter></paramdef> + <paramdef>const char<parameter> *release</parameter></paramdef> + <paramdef>int<parameter> version_count</parameter></paramdef> <paramdef>IcePoVersionRec<parameter> *version_recs</parameter></paramdef> - <paramdef>int<parameter> auth_names</parameter></paramdef> + <paramdef>int<parameter> auth_count</parameter></paramdef> <paramdef>char<parameter> **auth_names</parameter></paramdef> <paramdef>IcePoAuthProc<parameter> *auth_procs</parameter></paramdef> - <paramdef>IceIOErrorProc<parameter> *io_error_proc</parameter></paramdef> + <paramdef>IceIOErrorProc<parameter> io_error_proc</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -351,7 +350,18 @@ with a <funcsynopsis id='IceRegisterForProtocolReply'> <funcprototype> <funcdef>Bool <function>IceRegisterForProtocolReply</function></funcdef> - <paramdef>char<parameter> *host_name</parameter></paramdef> + <paramdef>const char<parameter> *protocol_name</parameter></paramdef> + <paramdef>const char<parameter> *vendor</parameter></paramdef> + <paramdef>const char<parameter> *release</parameter></paramdef> + <paramdef>int<parameter> version_count</parameter></paramdef> + <paramdef>IcePoVersionRec<parameter> *version_recs</parameter></paramdef> + <paramdef>int<parameter> auth_count</parameter></paramdef> + <paramdef>const char<parameter> **auth_names</parameter></paramdef> + <paramdef>IcePoAuthProc<parameter> *auth_procs</parameter></paramdef> + <paramdef>IceHostBasedAuthProc<parameter> host_based_auth_proc</parameter></paramdef> + <paramdef>IceProtocolSetupProc<parameter> protocol_setup_proc</parameter></paramdef> + <paramdef>IceProtocolActivateProc<parameter> protocol_activate_proc</parameter></paramdef> + <paramdef>IceIOErrorProc<parameter> io_error_proc</parameter></paramdef> </funcprototype> </funcsynopsis> diff --git a/include/X11/ICE/ICElib.h b/include/X11/ICE/ICElib.h index ba42119..402cbc8 100644 --- a/include/X11/ICE/ICElib.h +++ b/include/X11/ICE/ICElib.h @@ -206,9 +206,9 @@ typedef void (*IceIOErrorHandler) ( _XFUNCPROTOBEGIN extern int IceRegisterForProtocolSetup ( - char * /* protocolName */, - char * /* vendor */, - char * /* release */, + const char * /* protocolName */, + const char * /* vendor */, + const char * /* release */, int /* versionCount */, IcePoVersionRec * /* versionRecs */, int /* authCount */, @@ -218,9 +218,9 @@ extern int IceRegisterForProtocolSetup ( ); extern int IceRegisterForProtocolReply ( - char * /* protocolName */, - char * /* vendor */, - char * /* release */, + const char * /* protocolName */, + const char * /* vendor */, + const char * /* release */, int /* versionCount */, IcePaVersionRec * /* versionRecs */, int /* authCount */, diff --git a/src/register.c b/src/register.c index f1b76fb..20a6ad0 100644 --- a/src/register.c +++ b/src/register.c @@ -34,9 +34,9 @@ Author: Ralph Mor, X Consortium int IceRegisterForProtocolSetup ( - char *protocolName, - char *vendor, - char *release, + const char *protocolName, + const char *vendor, + const char *release, int versionCount, IcePoVersionRec *versionRecs, int authCount, @@ -131,9 +131,9 @@ IceRegisterForProtocolSetup ( int IceRegisterForProtocolReply ( - char *protocolName, - char *vendor, - char *release, + const char *protocolName, + const char *vendor, + const char *release, int versionCount, IcePaVersionRec *versionRecs, int authCount, |