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 /main | |
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 'main')
-rw-r--r-- | main/ast_expr2.fl | 8 | ||||
-rw-r--r-- | main/ast_expr2f.c | 8 | ||||
-rw-r--r-- | main/cdr.c | 2 | ||||
-rw-r--r-- | main/channel.c | 8 | ||||
-rw-r--r-- | main/db1-ast/hash/hash.c | 6 | ||||
-rw-r--r-- | main/dnsmgr.c | 4 | ||||
-rw-r--r-- | main/file.c | 12 | ||||
-rw-r--r-- | main/rtp.c | 18 | ||||
-rw-r--r-- | main/sched.c | 6 |
9 files changed, 36 insertions, 36 deletions
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl index 5990a66ed..db09850b8 100644 --- a/main/ast_expr2.fl +++ b/main/ast_expr2.fl @@ -89,7 +89,7 @@ struct parse_io void ast_yyset_column(int column_no, yyscan_t yyscanner); int ast_yyget_column(yyscan_t yyscanner); static int curlycount = 0; -static char *expr2_token_subst(char *mess); +static char *expr2_token_subst(const char *mess); %} %option prefix="ast_yy" @@ -323,11 +323,11 @@ static char *expr2_token_equivs2[] = }; -static char *expr2_token_subst(char *mess) +static char *expr2_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 expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*); @@ -372,7 +372,7 @@ int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio ) char spacebuf[8000]; /* best safe than sorry */ char spacebuf2[8000]; /* best safe than sorry */ int i=0; - char *s2 = expr2_token_subst((char *)s); + char *s2 = expr2_token_subst(s); spacebuf[0] = 0; for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' '; /* uh... assuming yyg is defined, then I can use the yycolumn macro, diff --git a/main/ast_expr2f.c b/main/ast_expr2f.c index bebe38f2d..708ccfb87 100644 --- a/main/ast_expr2f.c +++ b/main/ast_expr2f.c @@ -1409,7 +1409,7 @@ struct parse_io void ast_yyset_column(int column_no, yyscan_t yyscanner); int ast_yyget_column(yyscan_t yyscanner); static int curlycount = 0; -static char *expr2_token_subst(char *mess); +static char *expr2_token_subst(const char *mess); #line 1415 "ast_expr2f.c" @@ -3229,11 +3229,11 @@ static char *expr2_token_equivs2[] = }; -static char *expr2_token_subst(char *mess) +static char *expr2_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 expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*); @@ -3278,7 +3278,7 @@ int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio ) char spacebuf[8000]; /* best safe than sorry */ char spacebuf2[8000]; /* best safe than sorry */ int i=0; - char *s2 = expr2_token_subst((char *)s); + char *s2 = expr2_token_subst(s); spacebuf[0] = 0; for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' '; /* uh... assuming yyg is defined, then I can use the yycolumn macro, diff --git a/main/cdr.c b/main/cdr.c index d69db1778..5aa7a24f1 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -1130,7 +1130,7 @@ void ast_cdr_submit_batch(int shutdown) } } -static int submit_scheduled_batch(void *data) +static int submit_scheduled_batch(const void *data) { ast_cdr_submit_batch(0); /* manually reschedule from this point in time */ diff --git a/main/channel.c b/main/channel.c index eaa325d32..1ffa06416 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1833,13 +1833,13 @@ void ast_deactivate_generator(struct ast_channel *chan) ast_channel_unlock(chan); } -static int generator_force(void *data) +static int generator_force(const void *data) { /* Called if generator doesn't have data */ void *tmp; int res; int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples); - struct ast_channel *chan = data; + struct ast_channel *chan = (struct ast_channel *)data; tmp = chan->generatordata; chan->generatordata = NULL; generate = chan->generator->generate; @@ -2057,7 +2057,7 @@ int ast_waitfordigit(struct ast_channel *c, int ms) return ast_waitfordigit_full(c, ms, -1, -1); } -int ast_settimeout(struct ast_channel *c, int samples, int (*func)(void *data), void *data) +int ast_settimeout(struct ast_channel *c, int samples, int (*func)(const void *data), void *data) { int res = -1; #ifdef HAVE_ZAPTEL @@ -2253,7 +2253,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio) ioctl(chan->timingfd, ZT_TIMERACK, &blah); if (chan->timingfunc) { /* save a copy of func/data before unlocking the channel */ - int (*func)(void *) = chan->timingfunc; + int (*func)(const void *) = chan->timingfunc; void *data = chan->timingdata; ast_channel_unlock(chan); func(data); diff --git a/main/db1-ast/hash/hash.c b/main/db1-ast/hash/hash.c index a28cb8b63..47dc52a0e 100644 --- a/main/db1-ast/hash/hash.c +++ b/main/db1-ast/hash/hash.c @@ -68,7 +68,7 @@ static void *hash_realloc __P((SEGMENT **, int, int)); static int hash_seq __P((const DB *, DBT *, DBT *, u_int32_t)); static int hash_sync __P((const DB *, u_int32_t)); static int hdestroy __P((HTAB *)); -static HTAB *init_hash __P((HTAB *, const char *, HASHINFO *)); +static HTAB *init_hash __P((HTAB *, const char *, const HASHINFO *)); static int init_htab __P((HTAB *, int)); #if BYTE_ORDER == LITTLE_ENDIAN static void swap_header __P((HTAB *)); @@ -133,7 +133,7 @@ __hash_open(file, flags, mode, info, dflags) (void)fcntl(hashp->fp, F_SETFD, 1); } if (new_table) { - if (!(hashp = init_hash(hashp, file, (HASHINFO *)info))) + if (!(hashp = init_hash(hashp, file, info))) RETURN_ERROR(errno, error1); } else { /* Table already exists */ @@ -280,7 +280,7 @@ static HTAB * init_hash(hashp, file, info) HTAB *hashp; const char *file; - HASHINFO *info; + const HASHINFO *info; { #ifdef _STATBUF_ST_BLKSIZE struct stat statbuf; diff --git a/main/dnsmgr.c b/main/dnsmgr.c index 043b9e685..f44751b97 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -220,9 +220,9 @@ static void *do_refresh(void *data) return NULL; } -static int refresh_list(void *data) +static int refresh_list(const void *data) { - struct refresh_info *info = data; + struct refresh_info *info = (struct refresh_info *)data; struct ast_dnsmgr_entry *entry; /* if a refresh or reload is already in progress, exit now */ diff --git a/main/file.c b/main/file.c index 443cb24d4..65dd5e1b9 100644 --- a/main/file.c +++ b/main/file.c @@ -620,7 +620,7 @@ enum fsread_res { FSREAD_SUCCESS_NOSCHED, }; -static int ast_fsread_audio(void *data); +static int ast_fsread_audio(const void *data); static enum fsread_res ast_readaudio_callback(struct ast_filestream *s) { @@ -659,9 +659,9 @@ return_failure: return FSREAD_FAILURE; } -static int ast_fsread_audio(void *data) +static int ast_fsread_audio(const void *data) { - struct ast_filestream *fs = data; + struct ast_filestream *fs = (struct ast_filestream *)data; enum fsread_res res; res = ast_readaudio_callback(fs); @@ -672,7 +672,7 @@ static int ast_fsread_audio(void *data) return 0; } -static int ast_fsread_video(void *data); +static int ast_fsread_video(const void *data); static enum fsread_res ast_readvideo_callback(struct ast_filestream *s) { @@ -698,9 +698,9 @@ static enum fsread_res ast_readvideo_callback(struct ast_filestream *s) return FSREAD_SUCCESS_SCHED; } -static int ast_fsread_video(void *data) +static int ast_fsread_video(const void *data) { - struct ast_filestream *fs = data; + struct ast_filestream *fs = (struct ast_filestream *)data; enum fsread_res res; res = ast_readvideo_callback(fs); diff --git a/main/rtp.c b/main/rtp.c index f4b058570..39f8c85ec 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -175,10 +175,10 @@ struct ast_rtp { }; /* Forward declarations */ -static int ast_rtcp_write(void *data); +static int ast_rtcp_write(const void *data); static void timeval2ntp(struct timeval tv, unsigned int *msw, unsigned int *lsw); -static int ast_rtcp_write_sr(void *data); -static int ast_rtcp_write_rr(void *data); +static int ast_rtcp_write_sr(const void *data); +static int ast_rtcp_write_rr(const void *data); static unsigned int ast_rtcp_calc_interval(struct ast_rtp *rtp); static int ast_rtp_senddigit_continuation(struct ast_rtp *rtp); int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit); @@ -2307,9 +2307,9 @@ int ast_rtcp_send_h261fur(void *data) } /*! \brief Send RTCP sender's report */ -static int ast_rtcp_write_sr(void *data) +static int ast_rtcp_write_sr(const void *data) { - struct ast_rtp *rtp = data; + struct ast_rtp *rtp = (struct ast_rtp *)data; int res; int len = 0; struct timeval now; @@ -2421,9 +2421,9 @@ static int ast_rtcp_write_sr(void *data) } /*! \brief Send RTCP recepient's report */ -static int ast_rtcp_write_rr(void *data) +static int ast_rtcp_write_rr(const void *data) { - struct ast_rtp *rtp = data; + struct ast_rtp *rtp = (struct ast_rtp *)data; int res; int len = 32; unsigned int lost; @@ -2520,9 +2520,9 @@ static int ast_rtcp_write_rr(void *data) /*! \brief Write and RTCP packet to the far end * \note Decide if we are going to send an SR (with Reception Block) or RR * RR is sent if we have not sent any rtp packets in the previous interval */ -static int ast_rtcp_write(void *data) +static int ast_rtcp_write(const void *data) { - struct ast_rtp *rtp = data; + struct ast_rtp *rtp = (struct ast_rtp *)data; int res; if (!rtp || !rtp->rtcp) diff --git a/main/sched.c b/main/sched.c index abc5b3da1..04589a018 100644 --- a/main/sched.c +++ b/main/sched.c @@ -56,7 +56,7 @@ struct sched { struct timeval when; /*!< Absolute time event should take place */ int resched; /*!< When to reschedule */ int variable; /*!< Use return value from callback to reschedule */ - void *data; /*!< Data */ + const void *data; /*!< Data */ ast_sched_cb callback; /*!< Callback */ }; @@ -211,7 +211,7 @@ static int sched_settime(struct timeval *tv, int when) /*! \brief * Schedule callback(data) to happen when ms into the future */ -int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable) +int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, const void *data, int variable) { struct sched *tmp; int res = -1; @@ -244,7 +244,7 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal return res; } -int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, void *data) +int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, const void *data) { return ast_sched_add_variable(con, when, callback, data, 0); } |