diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-21 14:40:10 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-21 14:40:10 +0000 |
commit | 16927b7f7a7bce25329d1c2be0f31fbd789cb221 (patch) | |
tree | 9799cdd844ef78877a6446a6746e82e0c090bc9a /main | |
parent | e935ee6eac3ecb38b704ea2e9c2e86309150ab84 (diff) |
Merged revisions 83432 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r83432 | russell | 2007-09-21 09:37:20 -0500 (Fri, 21 Sep 2007) | 4 lines
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/trunk@83433 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 | 10 |
9 files changed, 38 insertions, 38 deletions
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl index 725205304..9f2d993af 100644 --- a/main/ast_expr2.fl +++ b/main/ast_expr2.fl @@ -110,7 +110,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" @@ -348,11 +348,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*); @@ -397,7 +397,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 860f19f2d..7310e0196 100644 --- a/main/ast_expr2f.c +++ b/main/ast_expr2f.c @@ -1482,7 +1482,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 1488 "ast_expr2f.c" @@ -3310,11 +3310,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*); @@ -3359,7 +3359,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 9bd79cf93..12d1e37fd 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -1123,7 +1123,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 83389a721..d8a137ec0 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1545,13 +1545,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; @@ -1971,7 +1971,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 @@ -2182,7 +2182,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 ea79d85d0..c9a0f40f4 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -217,9 +217,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 d64e9cd94..19f50bf81 100644 --- a/main/file.c +++ b/main/file.c @@ -609,7 +609,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) { @@ -648,9 +648,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); @@ -661,7 +661,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) { @@ -687,9 +687,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 8f7587813..17d9d4bd1 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -181,10 +181,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); @@ -2654,9 +2654,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; @@ -2791,9 +2791,9 @@ static int ast_rtcp_write_sr(void *data) } /*! \brief Send RTCP recipient'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; @@ -2890,9 +2890,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 f85c0dca4..a68692db0 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 */ }; @@ -207,7 +207,7 @@ static int sched_settime(struct timeval *tv, int when) return 0; } -int ast_sched_replace_variable(int old_id, struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable) +int ast_sched_replace_variable(int old_id, struct sched_context *con, int when, ast_sched_cb callback, const void *data, int variable) { /* 0 means the schedule item is new; do not delete */ if (old_id > 0) @@ -218,7 +218,7 @@ int ast_sched_replace_variable(int old_id, struct sched_context *con, 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; @@ -251,14 +251,14 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal return res; } -int ast_sched_replace(int old_id, struct sched_context *con, int when, ast_sched_cb callback, void *data) +int ast_sched_replace(int old_id, struct sched_context *con, int when, ast_sched_cb callback, const void *data) { if (old_id > -1) ast_sched_del(con, old_id); return ast_sched_add(con, when, callback, data); } -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); } |