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

View File

@ -38,7 +38,7 @@
#include <poll.h>
#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);
}

View File

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

View File

@ -104,7 +104,7 @@ static void json_cleanup(void)
switch_mutex_lock(json_GLOBALS.store_mutex);
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);
json = (cJSON *) val;
cJSON_Delete(json);
@ -315,7 +315,7 @@ static void unsub_all_jsock(void)
top:
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);
head = (jsock_sub_node_head_t *) val;
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);
host[255] = 0;
if ((p = strchr(host, ':')) != NULL) {
*p++ = '\0';
*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);
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();
@ -5038,7 +5040,7 @@ static switch_status_t json_hanguphook(switch_core_session_t *session)
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;
const char *cmd_attr = cJSON_GetObjectCstr(data, "cmd");
const char *uuid = cJSON_GetObjectCstr(data, "uuid");

View File

@ -309,7 +309,7 @@ int ws_handshake(wsh_t *wsh)
"%s\r\n",
b64,
proto_buf);
respond[511] = 0;
ws_raw_write(wsh, respond, strlen(respond));
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"
"Sec-WebSocket-Version: 13\r\n\r\n");
respond[511] = 0;
ws_raw_write(wsh, respond, strlen(respond));