From a729a57ba121061fd42f5dd4f557ed1f18d6dc99 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Thu, 21 Apr 2005 06:30:23 +0000 Subject: [PATCH] fix various compiler warnings git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5491 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_chanspy.c | 3 ++- channels/chan_features.c | 4 ++++ channels/chan_oss.c | 4 ++-- codecs/gsm/inc/private.h | 17 +++++++++++------ codecs/gsm/src/decode.c | 1 - codecs/gsm/src/long_term.c | 2 -- codecs/gsm/src/lpc.c | 2 -- codecs/gsm/src/preprocess.c | 6 ++++-- codecs/gsm/src/rpe.c | 1 - codecs/gsm/src/short_term.c | 5 ----- jitterbuf.c | 2 ++ 11 files changed, 25 insertions(+), 22 deletions(-) diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index e90dab41f9..e0374d7ac2 100755 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -104,7 +104,6 @@ struct chanspy_translation_helper { }; /* Prototypes */ -static struct ast_channel *local_get_channel_by_name(char *name); static struct ast_channel *local_get_channel_begin_name(char *name); static struct ast_channel *local_channel_walk(struct ast_channel *chan); static void spy_release(struct ast_channel *chan, void *data); @@ -118,6 +117,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int static int chanspy_exec(struct ast_channel *chan, void *data); +#if 0 static struct ast_channel *local_get_channel_by_name(char *name) { struct ast_channel *ret; @@ -129,6 +129,7 @@ static struct ast_channel *local_get_channel_by_name(char *name) return ret; } +#endif static struct ast_channel *local_channel_walk(struct ast_channel *chan) { diff --git a/channels/chan_features.c b/channels/chan_features.c index 8db531d3ca..9a6b4412a6 100755 --- a/channels/chan_features.c +++ b/channels/chan_features.c @@ -123,6 +123,7 @@ static inline int indexof(struct feature_pvt *p, struct ast_channel *owner, int return -1; } +#if 0 static void wakeup_sub(struct feature_pvt *p, int a) { struct ast_frame null = { AST_FRAME_NULL, }; @@ -141,6 +142,7 @@ static void wakeup_sub(struct feature_pvt *p, int a) break; } } +#endif static void restore_channel(struct feature_pvt *p, int index) { @@ -180,6 +182,7 @@ static void update_features(struct feature_pvt *p, int index) } } +#if 0 static void swap_subs(struct feature_pvt *p, int a, int b) { int tinthreeway; @@ -200,6 +203,7 @@ static void swap_subs(struct feature_pvt *p, int a, int b) wakeup_sub(p, a); wakeup_sub(p, b); } +#endif static int features_answer(struct ast_channel *ast) { diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 809fdba08e..f52da8b73a 100755 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -119,7 +119,7 @@ static struct chan_oss_pvt { static struct ast_channel *oss_request(const char *type, int format, void *data, int *cause); static int oss_digit(struct ast_channel *c, char digit); -static int oss_text(struct ast_channel *c, char *text); +static int oss_text(struct ast_channel *c, const char *text); static int oss_hangup(struct ast_channel *c); static int oss_answer(struct ast_channel *c); static struct ast_frame *oss_read(struct ast_channel *chan); @@ -484,7 +484,7 @@ static int oss_digit(struct ast_channel *c, char digit) return 0; } -static int oss_text(struct ast_channel *c, char *text) +static int oss_text(struct ast_channel *c, const char *text) { ast_verbose( " << Console Received text %s >> \n", text); return 0; diff --git a/codecs/gsm/inc/private.h b/codecs/gsm/inc/private.h index 140aef1ae9..b7115ae510 100755 --- a/codecs/gsm/inc/private.h +++ b/codecs/gsm/inc/private.h @@ -151,13 +151,18 @@ static __inline__ short GSM_SUB(short a, short b) */ /* Nonportable, but faster: */ -#define GSM_ADD(a, b) \ - ((ulongword)((ltmp = (longword)(a) + (longword)(b)) - MIN_WORD) > \ - MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp) +# define GSM_ADD(a, b) ({ \ + register longword ltmp; \ + ltmp = (longword) (a) + (longword) (b); \ + ((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? \ + (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp); \ + }) -# define GSM_SUB(a, b) \ - ((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \ - ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) +#define GSM_SUB(a, b) ({ \ + register longword ltmp; \ + ltmp = (longword) (a) - (longword) (b); \ + (ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp); \ + }) #endif diff --git a/codecs/gsm/src/decode.c b/codecs/gsm/src/decode.c index 34e5586633..7d56bf96c7 100755 --- a/codecs/gsm/src/decode.c +++ b/codecs/gsm/src/decode.c @@ -22,7 +22,6 @@ static void Postprocessing P2((S,s), { register int k; register word msr = S->msr; - register longword ltmp; /* for GSM_ADD */ register word tmp; for (k = 160; k--; s++) { diff --git a/codecs/gsm/src/long_term.c b/codecs/gsm/src/long_term.c index ee01c146b7..98f64aa2aa 100755 --- a/codecs/gsm/src/long_term.c +++ b/codecs/gsm/src/long_term.c @@ -852,7 +852,6 @@ static void Long_term_analysis_filtering P6((bc,Nc,dp,d,dpp,e), */ { register int k; - register longword ltmp; # undef STEP # define STEP(BP) \ @@ -921,7 +920,6 @@ void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp), * table 4.3b. */ { - register longword ltmp; /* for ADD */ register int k; word brp, drpp, Nr; diff --git a/codecs/gsm/src/lpc.c b/codecs/gsm/src/lpc.c index 4ec52ee01c..a8e9192ba7 100755 --- a/codecs/gsm/src/lpc.c +++ b/codecs/gsm/src/lpc.c @@ -211,7 +211,6 @@ static void Reflection_coefficients P2( (L_ACF, r), { register int i, m, n; register word temp; - register longword ltmp; word ACF[9]; /* 0..8 */ word P[ 9]; /* 0..8 */ word K[ 9]; /* 2..8 */ @@ -319,7 +318,6 @@ static void Quantization_and_coding P1((LAR), ) { register word temp; - longword ltmp; /* This procedure needs four tables; the following equations diff --git a/codecs/gsm/src/preprocess.c b/codecs/gsm/src/preprocess.c index 83c3f6a566..03746f9c3b 100755 --- a/codecs/gsm/src/preprocess.c +++ b/codecs/gsm/src/preprocess.c @@ -46,7 +46,6 @@ void Gsm_Preprocess P3((S, s, so), word SO; - longword ltmp; /* for ADD */ ulongword utmp; /* for L_ADD */ register int k = 160; @@ -86,7 +85,10 @@ void Gsm_Preprocess P3((S, s, so), /* Execution of a 31 bv 16 bits multiplication */ { - word msp, lsp; + word msp; +#ifndef __GNUC__ + word lsp; +#endif longword L_s2; longword L_temp; diff --git a/codecs/gsm/src/rpe.c b/codecs/gsm/src/rpe.c index 6644e37974..8be0c07723 100755 --- a/codecs/gsm/src/rpe.c +++ b/codecs/gsm/src/rpe.c @@ -362,7 +362,6 @@ static void APCM_inverse_quantization P4((xMc,mant,exp,xMp), { int i; word temp, temp1, temp2, temp3; - longword ltmp; assert( mant >= 0 && mant <= 7 ); diff --git a/codecs/gsm/src/short_term.c b/codecs/gsm/src/short_term.c index c1921f551e..c8c0c1b2b1 100755 --- a/codecs/gsm/src/short_term.c +++ b/codecs/gsm/src/short_term.c @@ -30,7 +30,6 @@ static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp), word * LARpp) /* out: decoded .. */ { register word temp1 /* , temp2 */; - register long ltmp; /* for GSM_ADD */ /* This procedure requires for efficient implementation * two tables. @@ -99,7 +98,6 @@ static void Coefficients_0_12 P3((LARpp_j_1, LARpp_j, LARp), register word * LARp) { register int i; - register longword ltmp; for (i = 1; i <= 8; i++, LARp++, LARpp_j_1++, LARpp_j++) { *LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 )); @@ -113,7 +111,6 @@ static void Coefficients_13_26 P3((LARpp_j_1, LARpp_j, LARp), register word * LARp) { register int i; - register longword ltmp; for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { *LARp = GSM_ADD( SASR( *LARpp_j_1, 1), SASR( *LARpp_j, 1 )); } @@ -125,7 +122,6 @@ static void Coefficients_27_39 P3((LARpp_j_1, LARpp_j, LARp), register word * LARp) { register int i; - register longword ltmp; for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { *LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 )); @@ -156,7 +152,6 @@ static void LARp_to_rp P1((LARp), { register int i; register word temp; - register longword ltmp; for (i = 1; i <= 8; i++, LARp++) { diff --git a/jitterbuf.c b/jitterbuf.c index bab3f28c6e..a7668e17e9 100755 --- a/jitterbuf.c +++ b/jitterbuf.c @@ -98,10 +98,12 @@ void jb_destroy(jitterbuf *jb) /* maybe later we can make the history buckets variable size, or something? */ /* drop parameter determines whether we will drop outliers to minimize * delay */ +#if 0 static int longcmp(const void *a, const void *b) { return *(long *)a - *(long *)b; } +#endif static void history_put(jitterbuf *jb, long ts, long now) {