aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-21 06:30:23 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-21 06:30:23 +0000
commitbef71744f4685c36a2c2db1af2d9d97a1abca305 (patch)
tree32ef323c5510fa3321c859182f59030f2c675829
parent31e8dcf4fe91466bf35a3f6d4de2bd714c43b288 (diff)
fix various compiler warnings
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5491 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_chanspy.c3
-rwxr-xr-xchannels/chan_features.c4
-rwxr-xr-xchannels/chan_oss.c4
-rwxr-xr-xcodecs/gsm/inc/private.h19
-rwxr-xr-xcodecs/gsm/src/decode.c1
-rwxr-xr-xcodecs/gsm/src/long_term.c2
-rwxr-xr-xcodecs/gsm/src/lpc.c2
-rwxr-xr-xcodecs/gsm/src/preprocess.c6
-rwxr-xr-xcodecs/gsm/src/rpe.c1
-rwxr-xr-xcodecs/gsm/src/short_term.c5
-rwxr-xr-xjitterbuf.c2
11 files changed, 26 insertions, 23 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index e90dab41f..e0374d7ac 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 8db531d3c..9a6b4412a 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 809fdba08..f52da8b73 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 140aef1ae..b7115ae51 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_SUB(a, b) \
- ((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \
- ? MAX_WORD : ltmp <= MIN_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) ({ \
+ 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 34e558663..7d56bf96c 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 ee01c146b..98f64aa2a 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 4ec52ee01..a8e9192ba 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 83c3f6a56..03746f9c3 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 6644e3797..8be0c0772 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 c1921f551..c8c0c1b2b 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 bab3f28c6..a7668e17e 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)
{