From ae051cfc47ed827674bd570c82f74cfeeae20e67 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Sat, 14 May 2011 23:15:09 +0200 Subject: [PATCH] FreeTDM: gcc-4.6 fixes (-Wunused-but-set) ftdm_io.c: Remove cut_path() function and call since it didn't seem to do anything useful anyway. ftmod_analog.c/ftmod_analog_em.c: Remove status variable that was used for the result of codec_func(), but was never checked for errors or returned to the caller. libteletone_generate.c: Remove unused variable "var". Signed-off-by: Stefan Knoblich --- libs/freetdm/src/ftdm_io.c | 19 ------------------- .../src/ftmod/ftmod_analog/ftmod_analog.c | 3 +-- .../ftmod/ftmod_analog_em/ftmod_analog_em.c | 3 +-- libs/freetdm/src/libteletone_generate.c | 4 +--- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index ddfe78dd71..8674fcad91 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -310,21 +310,6 @@ FTDM_STR2ENUM(ftdm_str2channel_indication, ftdm_channel_indication2str, ftdm_cha static ftdm_status_t ftdm_group_add_channels(ftdm_span_t* span, int currindex, const char* name); -static const char *cut_path(const char *in) -{ - const char *p, *ret = in; - char delims[] = "/\\"; - char *i; - - for (i = delims; *i; i++) { - p = in; - while ((p = strchr(p, *i)) != 0) { - ret = ++p; - } - } - return ret; -} - static void null_logger(const char *file, const char *func, int line, int level, const char *fmt, ...) { if (file && func && line && level && fmt) { @@ -350,7 +335,6 @@ static int ftdm_log_level = FTDM_LOG_LEVEL_DEBUG; static void default_logger(const char *file, const char *func, int line, int level, const char *fmt, ...) { - const char *fp; char data[1024]; va_list ap; @@ -360,14 +344,11 @@ static void default_logger(const char *file, const char *func, int line, int lev if (level > ftdm_log_level) { return; } - - fp = cut_path(file); va_start(ap, fmt); vsnprintf(data, sizeof(data), fmt, ap); - fprintf(stderr, "[%s] %s:%d %s() %s", FTDM_LEVEL_NAMES[level], file, line, func, data); va_end(ap); diff --git a/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c b/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c index 21008e6c96..7e230ecc34 100644 --- a/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c +++ b/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c @@ -426,7 +426,6 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj) uint32_t state_counter = 0, elapsed = 0, collecting = 0, interval = 0, last_digit = 0, indicate = 0, dial_timeout = analog_data->wait_dialtone_timeout; uint32_t answer_on_polarity_counter = 0; ftdm_sigmsg_t sig; - ftdm_status_t status; ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "ANALOG CHANNEL thread starting.\n"); @@ -916,7 +915,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj) } if (codec_func) { - status = codec_func(frame, sizeof(frame), &rlen); + codec_func(frame, sizeof(frame), &rlen); } else { snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "codec error!"); goto done; diff --git a/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c b/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c index 31c2421b9b..907a8cb034 100644 --- a/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c +++ b/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c @@ -221,7 +221,6 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj) ftdm_channel_t *closed_chan; uint32_t state_counter = 0, elapsed = 0, collecting = 0, interval = 0, last_digit = 0, indicate = 0, dial_timeout = 30000; ftdm_sigmsg_t sig; - ftdm_status_t status; ftdm_log(FTDM_LOG_DEBUG, "ANALOG EM CHANNEL thread starting.\n"); @@ -545,7 +544,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj) } if (codec_func) { - status = codec_func(frame, sizeof(frame), &rlen); + codec_func(frame, sizeof(frame), &rlen); } else { snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "codec error!"); goto done; diff --git a/libs/freetdm/src/libteletone_generate.c b/libs/freetdm/src/libteletone_generate.c index 7f37b7a258..c0d6a54349 100644 --- a/libs/freetdm/src/libteletone_generate.c +++ b/libs/freetdm/src/libteletone_generate.c @@ -273,7 +273,7 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cmd) { char *data = NULL, *cur = NULL, *end = NULL; - int var = 0, LOOPING = 0; + int LOOPING = 0; if (!cmd) { return -1; @@ -287,7 +287,6 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm cur = data; while (*cur) { - var = 0; if (*cur == ' ' || *cur == '\r' || *cur == '\n') { cur++; continue; @@ -298,7 +297,6 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm } if (*(cur + 1) == '=') { - var = 1; switch(*cur) { case 'c': ts->channels = atoi(cur + 2);