1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-03-02 17:03:52 +00:00

FS-7046 fix some additional warnings

This commit is contained in:
Jeff Lenk 2014-12-22 15:09:50 -06:00
parent 85ff3ae3f7
commit af6b23a124
4 changed files with 10 additions and 7 deletions
src/mod/endpoints/mod_verto

@ -38,7 +38,7 @@
#include <poll.h> #include <poll.h>
#endif #endif
McastHandle::McastHandle(const char *host, int port, int flags) McastHandle::McastHandle(const char *host, int16_t port, int flags)
{ {
mcast_socket_create(host, port, &handle, (mcast_flag_t) flags); mcast_socket_create(host, port, &handle, (mcast_flag_t) flags);
} }

@ -45,7 +45,7 @@ class McastHandle {
private: private:
mcast_handle_t handle; mcast_handle_t handle;
public: public:
McastHandle(const char *host, int port, int flags); McastHandle(const char *host, int16_t port, int flags);
virtual ~McastHandle(); virtual ~McastHandle();
int send(const char *data); int send(const char *data);
char *recv(int ms = 0); char *recv(int ms = 0);

@ -104,7 +104,7 @@ static void json_cleanup(void)
switch_mutex_lock(json_GLOBALS.store_mutex); switch_mutex_lock(json_GLOBALS.store_mutex);
top: top:
for (hi = switch_core_hash_first_iter(json_GLOBALS.store_hash, hi); hi; hi = switch_core_hash_next(&hi)) { for (hi = switch_core_hash_first_iter(json_GLOBALS.store_hash, hi); hi;) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
json = (cJSON *) val; json = (cJSON *) val;
cJSON_Delete(json); cJSON_Delete(json);
@ -315,7 +315,7 @@ static void unsub_all_jsock(void)
top: top:
head = NULL; head = NULL;
for (hi = switch_core_hash_first(globals.event_channel_hash); hi; hi = switch_core_hash_next(&hi)) { for (hi = switch_core_hash_first(globals.event_channel_hash); hi;) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
head = (jsock_sub_node_head_t *) val; head = (jsock_sub_node_head_t *) val;
jsock_unsub_head(NULL, head); jsock_unsub_head(NULL, head);
@ -3976,6 +3976,8 @@ static void parse_ip(char *host, uint16_t *port, in_addr_t *addr, char *input)
strncpy(host, input, 255); strncpy(host, input, 255);
host[255] = 0;
if ((p = strchr(host, ':')) != NULL) { if ((p = strchr(host, ':')) != NULL) {
*p++ = '\0'; *p++ = '\0';
*port = (uint16_t)atoi(p); *port = (uint16_t)atoi(p);
@ -4983,7 +4985,7 @@ static switch_bool_t json_commit(cJSON *json, const char *name, switch_mutex_t *
sql = switch_mprintf("insert into json_store (name,data) values('%q','%q')", name, ascii); sql = switch_mprintf("insert into json_store (name,data) values('%q','%q')", name, ascii);
switch_snprintf(del_sql, sizeof(del_sql), "delete from json_store where name='%q'", name); switch_snprintfv(del_sql, sizeof(del_sql), "delete from json_store where name='%q'", name);
dbh = json_get_db_handle(); dbh = json_get_db_handle();
@ -5038,7 +5040,7 @@ static switch_status_t json_hanguphook(switch_core_session_t *session)
SWITCH_STANDARD_JSON_API(json_store_function) SWITCH_STANDARD_JSON_API(json_store_function)
{ {
cJSON *JSON_STORE, *reply = NULL, *data = cJSON_GetObjectItem(json, "data"); cJSON *JSON_STORE = NULL, *reply = NULL, *data = cJSON_GetObjectItem(json, "data");
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
const char *cmd_attr = cJSON_GetObjectCstr(data, "cmd"); const char *cmd_attr = cJSON_GetObjectCstr(data, "cmd");
const char *uuid = cJSON_GetObjectCstr(data, "uuid"); const char *uuid = cJSON_GetObjectCstr(data, "uuid");

@ -309,7 +309,7 @@ int ws_handshake(wsh_t *wsh)
"%s\r\n", "%s\r\n",
b64, b64,
proto_buf); proto_buf);
respond[511] = 0;
ws_raw_write(wsh, respond, strlen(respond)); ws_raw_write(wsh, respond, strlen(respond));
wsh->handshake = 1; wsh->handshake = 1;
@ -322,6 +322,7 @@ int ws_handshake(wsh_t *wsh)
snprintf(respond, sizeof(respond), "HTTP/1.1 400 Bad Request\r\n" snprintf(respond, sizeof(respond), "HTTP/1.1 400 Bad Request\r\n"
"Sec-WebSocket-Version: 13\r\n\r\n"); "Sec-WebSocket-Version: 13\r\n\r\n");
respond[511] = 0;
ws_raw_write(wsh, respond, strlen(respond)); ws_raw_write(wsh, respond, strlen(respond));