[svn-commits] kpfleming: branch 1.4 r798 - in /branches/1.4: libpri.h pri.c pri_q931.h q931.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 13 10:17:12 CDT 2009


Author: kpfleming
Date: Wed May 13 10:17:08 2009
New Revision: 798

URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=798
Log:
Add 'const' qualifier to character string argument to keypad facility API calls

These API calls do not modify the string supplied, and should not be allowed to modify it, so this patch adds a 'const' qualifier to that argument to allow the compiler to enforce this restriction (and allow callers of the API that already have a 'const' pointer to be able to pass it to this API).


Modified:
    branches/1.4/libpri.h
    branches/1.4/pri.c
    branches/1.4/pri_q931.h
    branches/1.4/q931.c

Modified: branches/1.4/libpri.h
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/libpri.h?view=diff&rev=798&r1=797&r2=798
==============================================================================
--- branches/1.4/libpri.h (original)
+++ branches/1.4/libpri.h Wed May 13 10:17:08 2009
@@ -573,7 +573,7 @@
 
 #define PRI_KEYPAD_FACILITY_TX
 /* Send a keypad facility string of digits */
-int pri_keypad_facility(struct pri *pri, q931_call *call, char *digits);
+int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
 
 /* Answer the incomplete(call without called number) call on the given channel.
    Set non-isdn to non-zero if you are not connecting to ISDN equipment */

Modified: branches/1.4/pri.c
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/pri.c?view=diff&rev=798&r1=797&r2=798
==============================================================================
--- branches/1.4/pri.c (original)
+++ branches/1.4/pri.c Wed May 13 10:17:08 2009
@@ -515,7 +515,7 @@
 	return q931_information(pri, call, digit);
 }
 
-int pri_keypad_facility(struct pri *pri, q931_call *call, char *digits)
+int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits)
 {
 	if (!pri || !call || !digits || !digits[0])
 		return -1;

Modified: branches/1.4/pri_q931.h
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/pri_q931.h?view=diff&rev=798&r1=797&r2=798
==============================================================================
--- branches/1.4/pri_q931.h (original)
+++ branches/1.4/pri_q931.h Wed May 13 10:17:08 2009
@@ -437,7 +437,7 @@
 
 extern int q931_information(struct pri *pri, q931_call *call, char digit);
 
-extern int q931_keypad_facility(struct pri *pri, q931_call *call, char *digits);
+extern int q931_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
 
 extern int q931_connect(struct pri *pri, q931_call *call, int channel, int nonisdn);
 

Modified: branches/1.4/q931.c
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/q931.c?view=diff&rev=798&r1=797&r2=798
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Wed May 13 10:17:08 2009
@@ -2767,7 +2767,7 @@
 
 static int keypad_facility_ies[] = { Q931_IE_KEYPAD_FACILITY, -1 };
 
-int q931_keypad_facility(struct pri *pri, q931_call *call, char *digits)
+int q931_keypad_facility(struct pri *pri, q931_call *call, const char *digits)
 {
 	libpri_copy_string(call->keypad_digits, digits, sizeof(call->keypad_digits));
 	return send_message(pri, call, Q931_INFORMATION, keypad_facility_ies);




More information about the svn-commits mailing list