fixed some compile warnings

This commit is contained in:
Thomas Ries
2017-09-27 19:21:36 +00:00
parent 337c9bd862
commit fd23024e99
5 changed files with 28 additions and 6 deletions
+18
View File
@@ -232,6 +232,11 @@ static void output_to_stderr(const char *label, va_list ap, char *file,
if (!log_to_stderr) return;
sts = gettimeofday(&tv, NULL);
if (sts != 0) {
tv.tv_sec=0;
tv.tv_usec=0;
}
tim = localtime(&(tv.tv_sec));
fprintf(stderr, "%2.2i:%2.2i:%2.2i.%3.3i %s%s:%i ",
tim->tm_hour, tim->tm_min, tim->tm_sec,
@@ -267,6 +272,10 @@ static void output_to_TCP(const char *label, va_list ap, char *file,
if (debug_fd <= 0) return;
sts = gettimeofday(&tv, NULL);
if (sts != 0) {
tv.tv_sec=0;
tv.tv_usec=0;
}
tim = localtime(&(tv.tv_sec));
snprintf(outbuf, sizeof(outbuf), "%2.2i:%2.2i:%2.2i.%3.3i %s%s:%i ",
tim->tm_hour, tim->tm_min, tim->tm_sec,
@@ -374,6 +383,9 @@ void log_dump_buffer(unsigned int class, char *file, int line,
if (debug_fd > 0) {
snprintf(outbuf, sizeof(outbuf) ,"---BUFFER DUMP follows---\n");
sts=write(debug_fd, outbuf, strlen(outbuf));
if (sts < 0) {
ERROR("write returned error [%i:%s]",errno, strerror(errno));
}
}
for (i=0; i<length; i+=16) {
@@ -392,6 +404,9 @@ void log_dump_buffer(unsigned int class, char *file, int line,
snprintf(outbuf, sizeof(outbuf) ," %-47.47s %-16.16s\n",
tmplin1, tmplin2);
sts=write(debug_fd, outbuf, strlen(outbuf));
if (sts < 0) {
ERROR("write returned error [%i:%s]",errno, strerror(errno));
}
}
}
@@ -402,6 +417,9 @@ void log_dump_buffer(unsigned int class, char *file, int line,
if (debug_fd > 0) {
snprintf(outbuf, sizeof(outbuf) ,"---end of BUFFER DUMP---\n");
sts=write(debug_fd, outbuf, strlen(outbuf));
if (sts < 0) {
ERROR("write returned error [%i:%s]",errno, strerror(errno));
}
}
pthread_mutex_unlock(&log_mutex);
+3
View File
@@ -258,6 +258,9 @@ static int sdp_filter_codec(sdp_message_t *sdp) {
// fetch the media type value (first number field in value)
attr_mediatype=0;
sts=sscanf(sdp_attr->a_att_value, "%i", &attr_mediatype);
if (sts == 0) {
DEBUGC(DBCLASS_PLUGIN, "parsing SDP attribute mediatype failed");
}
DEBUGC(DBCLASS_PLUGIN, " +--Attr field=%s, val=%s [MT=%i]",
sdp_attr->a_att_field, sdp_attr->a_att_value, attr_mediatype);
+3 -4
View File
@@ -55,9 +55,8 @@ extern int errno;
void register_init(void) {
FILE *stream;
int sts, i;
// size_t len;
char buff[128];
char *c;
// char *c;
memset(urlmap, 0, sizeof(urlmap));
@@ -75,14 +74,14 @@ void register_init(void) {
/* read the url table from file */
DEBUGC(DBCLASS_REG,"loading registration table");
for (i=0;i < URLMAP_SIZE; i++) {
c=fgets(buff, sizeof(buff), stream);
fgets(buff, sizeof(buff), stream);
sts=sscanf(buff, "****:%i:%i", &urlmap[i].active, &urlmap[i].expires);
if (sts == 0) break; /* format error */
if (urlmap[i].active) {
#define R(X) {\
sts=osip_uri_init(&X); \
if (sts == 0) { \
c=fgets(buff, sizeof(buff), stream);\
fgets(buff, sizeof(buff), stream);\
buff[sizeof(buff)-1]='\0';\
if (strchr(buff, 10)) *strchr(buff, 10)='\0';\
if (strchr(buff, 13)) *strchr(buff, 13)='\0';\
+3
View File
@@ -1025,6 +1025,9 @@ static void rtpproxy_kill( void ) {
sts = rtp_relay_stop_fwd(&cid, rtp_proxytable[i].direction,
rtp_proxytable[i].media_stream_no,
LOCK_FDSET);
if (sts != STS_SUCCESS) {
DEBUGC(DBCLASS_RTP,"rtp_relay_stop_fwd did return error");
}
}
}
+1 -2
View File
@@ -615,7 +615,6 @@ int sip_add_myvia (sip_ticket_t *ticket, int interface) {
*/
int sip_del_myvia (sip_ticket_t *ticket) {
osip_via_t *via;
int sts;
DEBUGC(DBCLASS_PROXY,"deleting topmost VIA");
via = osip_list_get (&(ticket->sipmsg->vias), 0);
@@ -630,7 +629,7 @@ int sip_del_myvia (sip_ticket_t *ticket) {
return STS_FAILURE;
}
sts = osip_list_remove(&(ticket->sipmsg->vias), 0);
osip_list_remove(&(ticket->sipmsg->vias), 0);
osip_via_free (via);
return STS_SUCCESS;
}