From 39f7f72d8f32763e434e4dcfbbf922cf33c23134 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Wed, 13 May 2009 15:17:08 +0000 Subject: [PATCH] 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). git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@798 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- libpri.h | 2 +- pri.c | 2 +- pri_q931.h | 2 +- q931.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libpri.h b/libpri.h index 55009fd..ecfa70c 100644 --- a/libpri.h +++ b/libpri.h @@ -573,7 +573,7 @@ int pri_information(struct pri *pri, q931_call *call, char digit); #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 */ diff --git a/pri.c b/pri.c index afc376a..cb319b7 100644 --- a/pri.c +++ b/pri.c @@ -515,7 +515,7 @@ int pri_information(struct pri *pri, q931_call *call, char digit) 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; diff --git a/pri_q931.h b/pri_q931.h index 5f38ee1..0d60a28 100644 --- a/pri_q931.h +++ b/pri_q931.h @@ -437,7 +437,7 @@ extern int q931_setup_ack(struct pri *pri, q931_call *call, int channel, int non 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); diff --git a/q931.c b/q931.c index d099438..84052a8 100644 --- a/q931.c +++ b/q931.c @@ -2767,7 +2767,7 @@ int q931_information(struct pri *pri, q931_call *c, char digit) 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);