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 <s.knoblich@axsentis.de>
This commit is contained in:
parent
082cb7154e
commit
ae051cfc47
|
@ -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 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, ...)
|
static void null_logger(const char *file, const char *func, int line, int level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
if (file && func && line && level && 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, ...)
|
static void default_logger(const char *file, const char *func, int line, int level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
const char *fp;
|
|
||||||
char data[1024];
|
char data[1024];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
@ -361,13 +345,10 @@ static void default_logger(const char *file, const char *func, int line, int lev
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fp = cut_path(file);
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
||||||
vsnprintf(data, sizeof(data), fmt, ap);
|
vsnprintf(data, sizeof(data), fmt, ap);
|
||||||
|
|
||||||
|
|
||||||
fprintf(stderr, "[%s] %s:%d %s() %s", FTDM_LEVEL_NAMES[level], file, line, func, data);
|
fprintf(stderr, "[%s] %s:%d %s() %s", FTDM_LEVEL_NAMES[level], file, line, func, data);
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
|
@ -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 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;
|
uint32_t answer_on_polarity_counter = 0;
|
||||||
ftdm_sigmsg_t sig;
|
ftdm_sigmsg_t sig;
|
||||||
ftdm_status_t status;
|
|
||||||
|
|
||||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "ANALOG CHANNEL thread starting.\n");
|
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) {
|
if (codec_func) {
|
||||||
status = codec_func(frame, sizeof(frame), &rlen);
|
codec_func(frame, sizeof(frame), &rlen);
|
||||||
} else {
|
} else {
|
||||||
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "codec error!");
|
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "codec error!");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
@ -221,7 +221,6 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
|
||||||
ftdm_channel_t *closed_chan;
|
ftdm_channel_t *closed_chan;
|
||||||
uint32_t state_counter = 0, elapsed = 0, collecting = 0, interval = 0, last_digit = 0, indicate = 0, dial_timeout = 30000;
|
uint32_t state_counter = 0, elapsed = 0, collecting = 0, interval = 0, last_digit = 0, indicate = 0, dial_timeout = 30000;
|
||||||
ftdm_sigmsg_t sig;
|
ftdm_sigmsg_t sig;
|
||||||
ftdm_status_t status;
|
|
||||||
|
|
||||||
ftdm_log(FTDM_LOG_DEBUG, "ANALOG EM CHANNEL thread starting.\n");
|
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) {
|
if (codec_func) {
|
||||||
status = codec_func(frame, sizeof(frame), &rlen);
|
codec_func(frame, sizeof(frame), &rlen);
|
||||||
} else {
|
} else {
|
||||||
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "codec error!");
|
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "codec error!");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
@ -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)
|
TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cmd)
|
||||||
{
|
{
|
||||||
char *data = NULL, *cur = NULL, *end = NULL;
|
char *data = NULL, *cur = NULL, *end = NULL;
|
||||||
int var = 0, LOOPING = 0;
|
int LOOPING = 0;
|
||||||
|
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -287,7 +287,6 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
||||||
cur = data;
|
cur = data;
|
||||||
|
|
||||||
while (*cur) {
|
while (*cur) {
|
||||||
var = 0;
|
|
||||||
if (*cur == ' ' || *cur == '\r' || *cur == '\n') {
|
if (*cur == ' ' || *cur == '\r' || *cur == '\n') {
|
||||||
cur++;
|
cur++;
|
||||||
continue;
|
continue;
|
||||||
|
@ -298,7 +297,6 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(cur + 1) == '=') {
|
if (*(cur + 1) == '=') {
|
||||||
var = 1;
|
|
||||||
switch(*cur) {
|
switch(*cur) {
|
||||||
case 'c':
|
case 'c':
|
||||||
ts->channels = atoi(cur + 2);
|
ts->channels = atoi(cur + 2);
|
||||||
|
|
Loading…
Reference in New Issue