[FreeTDM] Another round of ftdm_log() format string fixes.
Use FTDM_SIZE_FMT where needed, don't treat ftdm_event_t as an int (even if the e_type enum is the first member), datalen vs. *datalen fix and other warnings. All reported by __check_printf() (GCC + __attribute__((format(printf,x,y))) ). Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
parent
9d5eb0737b
commit
674dc9850b
|
@ -149,7 +149,7 @@ static void dump_chan_io_to_file(ftdm_channel_t *fchan, ftdm_io_dump_t *dump, FI
|
|||
if (dump->wrapped) {
|
||||
rc = fwrite(&dump->buffer[dump->windex], 1, towrite, file);
|
||||
if (rc != towrite) {
|
||||
ftdm_log_chan(fchan, FTDM_LOG_ERROR, "only wrote %d out of %d bytes in io dump buffer\n",
|
||||
ftdm_log_chan(fchan, FTDM_LOG_ERROR, "only wrote %"FTDM_SIZE_FMT" out of %"FTDM_SIZE_FMT" bytes in io dump buffer: %s\n",
|
||||
rc, towrite, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ static void dump_chan_io_to_file(ftdm_channel_t *fchan, ftdm_io_dump_t *dump, FI
|
|||
towrite = dump->windex;
|
||||
rc = fwrite(&dump->buffer[0], 1, towrite, file);
|
||||
if (rc != towrite) {
|
||||
ftdm_log_chan(fchan, FTDM_LOG_ERROR, "only wrote %d out of %d bytes in io dump buffer: %s\n",
|
||||
ftdm_log_chan(fchan, FTDM_LOG_ERROR, "only wrote %"FTDM_SIZE_FMT" out of %"FTDM_SIZE_FMT" bytes in io dump buffer: %s\n",
|
||||
rc, towrite, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
@ -1174,7 +1174,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_next_event(ftdm_span_t *span, ftdm_event_t *
|
|||
|
||||
status = ftdm_event_handle_oob(*event);
|
||||
if (status != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "failed to handle event %d\n", **event);
|
||||
ftdm_log(FTDM_LOG_ERROR, "failed to handle event %d\n", (*event)->e_type);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
@ -1204,7 +1204,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read_event(ftdm_channel_t *ftdmchan, ftdm
|
|||
|
||||
status = ftdm_event_handle_oob(*event);
|
||||
if (status != FTDM_SUCCESS) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "failed to handle event %d\n", **event);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "failed to handle event %d\n", (*event)->e_type);
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -2980,7 +2980,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_command(ftdm_channel_t *ftdmchan, ftdm_co
|
|||
GOTO_STATUS(done, FTDM_FAIL);
|
||||
}
|
||||
if (start_chan_io_dump(ftdmchan, &ftdmchan->txdump, size) != FTDM_SUCCESS) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Failed to enable output dump of size %d\n", size);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Failed to enable output dump of size %"FTDM_SIZE_FMT"\n", size);
|
||||
GOTO_STATUS(done, FTDM_FAIL);
|
||||
}
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Enabled output dump with size %"FTDM_SIZE_FMT"\n", size);
|
||||
|
@ -3012,7 +3012,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_command(ftdm_channel_t *ftdmchan, ftdm_co
|
|||
GOTO_STATUS(done, FTDM_FAIL);
|
||||
}
|
||||
dump_chan_io_to_file(ftdmchan, &ftdmchan->rxdump, obj);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Dumped input of size %d to file %p\n", ftdmchan->rxdump.size, obj);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Dumped input of size %"FTDM_SIZE_FMT" to file %p\n", ftdmchan->rxdump.size, obj);
|
||||
GOTO_STATUS(done, FTDM_SUCCESS);
|
||||
}
|
||||
break;
|
||||
|
@ -3635,7 +3635,7 @@ FT_DECLARE(ftdm_status_t) ftdm_raw_write (ftdm_channel_t *ftdmchan, void *data,
|
|||
}
|
||||
if (ftdmchan->fds[FTDM_WRITE_TRACE_INDEX] > -1) {
|
||||
if ((write(ftdmchan->fds[FTDM_WRITE_TRACE_INDEX], data, dlen)) != dlen) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Raw output trace failed to write all of the %"FTDM_SIZE_FMT" bytes\n", dlen);
|
||||
ftdm_log(FTDM_LOG_WARNING, "Raw output trace failed to write all of the %d bytes\n", dlen);
|
||||
}
|
||||
}
|
||||
write_chan_io_dump(&ftdmchan->txdump, data, dlen);
|
||||
|
@ -3681,7 +3681,8 @@ FT_DECLARE(ftdm_status_t) ftdm_raw_read (ftdm_channel_t *ftdmchan, void *data, f
|
|||
if (ftdmchan->dtmfdbg.file) {
|
||||
rc = fwrite(data, 1, dlen, ftdmchan->dtmfdbg.file);
|
||||
if (rc != dlen) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "DTMF debugger wrote only %d out of %d bytes: %s\n", rc, datalen, strerror(errno));
|
||||
ftdm_log(FTDM_LOG_WARNING, "DTMF debugger wrote only %"FTDM_SIZE_FMT" out of %"FTDM_SIZE_FMT" bytes: %s\n",
|
||||
rc, *datalen, strerror(errno));
|
||||
}
|
||||
ftdmchan->dtmfdbg.closetimeout--;
|
||||
if (!ftdmchan->dtmfdbg.closetimeout) {
|
||||
|
@ -3900,7 +3901,9 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_process_media(ftdm_channel_t *ftdmchan, v
|
|||
*(str+mlen) = '\0';
|
||||
ftdm_copy_string(str, sp, ++mlen);
|
||||
ftdm_clean_string(str);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "FSK: TYPE %s LEN %d VAL [%s]\n", ftdm_mdmf_type2str(type), mlen-1, str);
|
||||
|
||||
ftdm_log(FTDM_LOG_DEBUG, "FSK: TYPE %s LEN %"FTDM_SIZE_FMT" VAL [%s]\n",
|
||||
ftdm_mdmf_type2str(type), mlen-1, str);
|
||||
|
||||
switch(type) {
|
||||
case MDMF_DDN:
|
||||
|
|
|
@ -10,7 +10,7 @@ static ftdm_channel_indication_t indication = FTDM_CHANNEL_INDICATE_NONE;
|
|||
static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
|
||||
{
|
||||
int chanid = ftdm_channel_get_ph_id(sigmsg->channel);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Got R2 channel sig [%s] in channel\n", ftdm_signal_event2str(sigmsg->event_id), chanid);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Got R2 channel sig [%s] in channel %d\n", ftdm_signal_event2str(sigmsg->event_id), chanid);
|
||||
switch (sigmsg->event_id) {
|
||||
case FTDM_SIGEVENT_START:
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue