diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-21 14:37:20 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-21 14:37:20 +0000 |
commit | 02c2b2e2c1f00151ac2099ff68efda2ac89271a0 (patch) | |
tree | b76c4146efd5357b7e89db353ccebf4bdefa8e7b /pbx | |
parent | ec43deabe7d576aca83ebbda30dfc0290e38ef3c (diff) |
gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set of
changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2.
(closes issue #10774, patch from qwell)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@83432 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/ael/ael.tab.c | 8 | ||||
-rw-r--r-- | pbx/ael/ael.y | 8 | ||||
-rw-r--r-- | pbx/pbx_dundi.c | 22 |
3 files changed, 18 insertions, 20 deletions
diff --git a/pbx/ael/ael.tab.c b/pbx/ael/ael.tab.c index cca6a39be..ba66f196f 100644 --- a/pbx/ael/ael.tab.c +++ b/pbx/ael/ael.tab.c @@ -199,7 +199,7 @@ extern char *my_file; #ifdef AAL_ARGCHECK int ael_is_funcname(char *name); #endif -static char *ael_token_subst(char *mess); +static char *ael_token_subst(const char *mess); @@ -3232,11 +3232,11 @@ static char *token_equivs2[] = }; -static char *ael_token_subst(char *mess) +static char *ael_token_subst(const char *mess) { /* calc a length, malloc, fill, and return; yyerror had better free it! */ int len=0,i; - char *p; + const char *p; char *res, *s,*t; int token_equivs_entries = sizeof(token_equivs1)/sizeof(char*); @@ -3277,7 +3277,7 @@ static char *ael_token_subst(char *mess) void yyerror(YYLTYPE *locp, struct parse_io *parseio, char const *s) { - char *s2 = ael_token_subst((char *)s); + char *s2 = ael_token_subst(s); if (locp->first_line == locp->last_line) { ast_log(LOG_ERROR, "==== File: %s, Line %d, Cols: %d-%d: Error: %s\n", my_file, locp->first_line, locp->first_column, locp->last_column, s2); } else { diff --git a/pbx/ael/ael.y b/pbx/ael/ael.y index 04df00c1a..7cc758d7c 100644 --- a/pbx/ael/ael.y +++ b/pbx/ael/ael.y @@ -46,7 +46,7 @@ extern char *my_file; #ifdef AAL_ARGCHECK int ael_is_funcname(char *name); #endif -static char *ael_token_subst(char *mess); +static char *ael_token_subst(const char *mess); %} @@ -705,11 +705,11 @@ static char *token_equivs2[] = }; -static char *ael_token_subst(char *mess) +static char *ael_token_subst(const char *mess) { /* calc a length, malloc, fill, and return; yyerror had better free it! */ int len=0,i; - char *p; + const char *p; char *res, *s,*t; int token_equivs_entries = sizeof(token_equivs1)/sizeof(char*); @@ -750,7 +750,7 @@ static char *ael_token_subst(char *mess) void yyerror(YYLTYPE *locp, struct parse_io *parseio, char const *s) { - char *s2 = ael_token_subst((char *)s); + char *s2 = ael_token_subst(s); if (locp->first_line == locp->last_line) { ast_log(LOG_ERROR, "==== File: %s, Line %d, Cols: %d-%d: Error: %s\n", my_file, locp->first_line, locp->first_column, locp->last_column, s2); } else { diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 8384b4d94..ea3b91cb5 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -1277,9 +1277,9 @@ static void apply_peer(struct dundi_transaction *trans, struct dundi_peer *p) } /*! \note Called with the peers list already locked */ -static int do_register_expire(void *data) +static int do_register_expire(const void *data) { - struct dundi_peer *peer = data; + struct dundi_peer *peer = (struct dundi_peer *)data; char eid_str[20]; ast_log(LOG_DEBUG, "Register expired for '%s'\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid)); peer->registerexpire = -1; @@ -2954,12 +2954,11 @@ static void destroy_trans(struct dundi_transaction *trans, int fromtimeout) free(trans); } -static int dundi_rexmit(void *data) +static int dundi_rexmit(const void *data) { - struct dundi_packet *pack; + struct dundi_packet *pack = (struct dundi_packet *)data; int res; AST_LIST_LOCK(&peers); - pack = data; if (pack->retrans < 1) { pack->retransid = -1; if (!ast_test_flag(pack->parent, FLAG_ISQUAL)) @@ -3049,9 +3048,9 @@ static int dundi_send(struct dundi_transaction *trans, int cmdresp, int flags, i return -1; } -static int do_autokill(void *data) +static int do_autokill(const void *data) { - struct dundi_transaction *trans = data; + struct dundi_transaction *trans = (struct dundi_transaction *)data; char eid_str[20]; ast_log(LOG_NOTICE, "Transaction to '%s' took too long to ACK, destroying\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &trans->them_eid)); @@ -4023,10 +4022,10 @@ static void build_mapping(char *name, char *value) } /* \note Called with the peers list already locked */ -static int do_register(void *data) +static int do_register(const void *data) { struct dundi_ie_data ied; - struct dundi_peer *peer = data; + struct dundi_peer *peer = (struct dundi_peer *)data; char eid_str[20]; char eid_str2[20]; ast_log(LOG_DEBUG, "Register us as '%s' to '%s'\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->us_eid), dundi_eid_to_str(eid_str2, sizeof(eid_str2), &peer->eid)); @@ -4049,10 +4048,9 @@ static int do_register(void *data) return 0; } -static int do_qualify(void *data) +static int do_qualify(const void *data) { - struct dundi_peer *peer; - peer = data; + struct dundi_peer *peer = (struct dundi_peer *)data; peer->qualifyid = -1; qualify_peer(peer, 0); return 0; |