Skip to content

Commit 231edd4

Browse files
author
Simon Gomizelj
committed
Drop all dead functions
These functions are never used anywhere: - double xp_get_double(const char *name, const char *what, double defval) - char* time_string(int ms) - char* double_time_string(double ms) - size_t decompress_if_needed(int sock, char* buff, size_t len, void** st)
1 parent 610ccc4 commit 231edd4

File tree

2 files changed

+0
-91
lines changed

2 files changed

+0
-91
lines changed

src/scenario.cpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,6 @@ static double xp_get_double(const char *name, const char *what)
260260
return val;
261261
}
262262

263-
static double xp_get_double(const char *name, const char *what, double defval)
264-
{
265-
if (!(xp_get_value(name))) {
266-
return defval;
267-
}
268-
return xp_get_double(name, what);
269-
}
270-
271263
static long xp_get_long(const char *name, const char *what)
272264
{
273265
char *ptr;
@@ -454,21 +446,6 @@ bool get_bool(const char *ptr, const char *what)
454446
}
455447

456448
/* Pretty print a time. */
457-
static char* time_string(int ms)
458-
{
459-
static char tmp[20];
460-
461-
if (ms < 10000) {
462-
snprintf(tmp, sizeof(tmp), "%dms", ms);
463-
} else if (ms < 100000) {
464-
snprintf(tmp, sizeof(tmp), "%.1fs", ((float)ms)/1000);
465-
} else {
466-
snprintf(tmp, sizeof(tmp), "%ds", ms/1000);
467-
}
468-
469-
return tmp;
470-
}
471-
472449
int time_string(double ms, char *res, int reslen)
473450
{
474451
if (ms < 10000) {
@@ -502,23 +479,6 @@ int time_string(double ms, char *res, int reslen)
502479
}
503480
}
504481

505-
static char* double_time_string(double ms)
506-
{
507-
static char tmp[20];
508-
509-
if (ms < 1000) {
510-
snprintf(tmp, sizeof(tmp), "%.2lfms", ms);
511-
} else if (ms < 10000) {
512-
snprintf(tmp, sizeof(tmp), "%.1lfms", ms);
513-
} else if (ms < 100000) {
514-
snprintf(tmp, sizeof(tmp), "%.1lfs", ms / 1000);
515-
} else {
516-
snprintf(tmp, sizeof(tmp), "%ds", (int)(ms/1000));
517-
}
518-
519-
return tmp;
520-
}
521-
522482
/* For backwards compatibility, we assign "true" to slot 1, false to 0, and
523483
* allow other valid integers. */
524484
int scenario::get_rtd(const char *ptr, bool start)

src/socket.cpp

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,57 +1685,6 @@ void free_socketbuf(struct socketbuf *socketbuf)
16851685
free(socketbuf);
16861686
}
16871687

1688-
static size_t decompress_if_needed(int sock, char* buff, size_t len, void** st)
1689-
{
1690-
if (compression && len) {
1691-
if (useMessagef == 1) {
1692-
struct timeval currentTime;
1693-
GET_TIME (&currentTime);
1694-
TRACE_MSG("----------------------------------------------- %s\n"
1695-
"Compressed message received, header :\n"
1696-
"0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x "
1697-
"0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1698-
CStat::formatTime(&currentTime, true),
1699-
buff[0] , buff[1] , buff[2] , buff[3],
1700-
buff[4] , buff[5] , buff[6] , buff[7],
1701-
buff[8] , buff[9] , buff[10], buff[11],
1702-
buff[12], buff[13], buff[14], buff[15]);
1703-
}
1704-
1705-
int rc = comp_uncompress(st,
1706-
buff,
1707-
(unsigned int *) &len);
1708-
1709-
switch(rc) {
1710-
case COMP_OK:
1711-
TRACE_MSG("Compressed message decompressed properly.\n");
1712-
break;
1713-
1714-
case COMP_REPLY:
1715-
TRACE_MSG("Compressed message KO, sending a reply (resynch).\n");
1716-
sendto(sock,
1717-
buff,
1718-
len,
1719-
0,
1720-
(sockaddr *)(void *)&remote_sockaddr,
1721-
SOCK_ADDR_SIZE(&remote_sockaddr));
1722-
resynch_send++;
1723-
return 0;
1724-
1725-
case COMP_DISCARD:
1726-
TRACE_MSG("Compressed message discarded by plugin.\n");
1727-
resynch_recv++;
1728-
return 0;
1729-
1730-
default:
1731-
case COMP_KO:
1732-
ERROR("Compression plugin error");
1733-
return 0;
1734-
}
1735-
}
1736-
return len;
1737-
}
1738-
17391688
#ifdef USE_SCTP
17401689
void sipp_sctp_peer_params(struct sipp_socket *socket)
17411690
{

0 commit comments

Comments
 (0)