Lots of trivial tweaks to minimize compiler warnings, especially on 64-bit platform: Added missing type casts, changed types, added missing NULL checks.

This commit is contained in:
Peter Olsson
2014-01-22 22:28:53 +01:00
parent 643c88f49b
commit 084e245085
57 changed files with 226 additions and 216 deletions
+18 -18
View File
@@ -1892,15 +1892,15 @@ static switch_status_t do_config(void)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcasecmp(var, "all")) {
switch_byte_t all = switch_true(val);
switch_byte_t all = switch_true_byte(val);
memset(&profile->perms, all, sizeof(profile->perms));
} else if (!strcasecmp(var, "none")) {
switch_byte_t none = switch_true(val);
switch_byte_t none = switch_true_byte(val);
memset(&profile->perms, none, sizeof(profile->perms));
} else if (!strcasecmp(var, "set-params")) {
profile->perms.set_params = switch_true(val);
profile->perms.set_params = switch_true_byte(val);
} else if (!strcasecmp(var, "set-vars")) {
profile->perms.set_vars = switch_true(val);
profile->perms.set_vars = switch_true_byte(val);
if (profile->perms.set_vars) {
switch_xml_t x_list, x_var;
@@ -1928,7 +1928,7 @@ static switch_status_t do_config(void)
}
}
} else if (!strcasecmp(var, "get-vars")) {
profile->perms.get_vars = switch_true(val);
profile->perms.get_vars = switch_true_byte(val);
if (profile->perms.get_vars) {
switch_xml_t x_list, x_var;
@@ -1956,9 +1956,9 @@ static switch_status_t do_config(void)
}
}
} else if (!strcasecmp(var, "extended-data")) {
profile->perms.extended_data = switch_true(val);
profile->perms.extended_data = switch_true_byte(val);
} else if (!strcasecmp(var, "execute-apps")) {
profile->perms.execute_apps = switch_true(val);
profile->perms.execute_apps = switch_true_byte(val);
if (profile->perms.execute_apps) {
switch_xml_t x_list, x_app;
@@ -1987,7 +1987,7 @@ static switch_status_t do_config(void)
}
} else if (!strcasecmp(var, "expand-vars")) {
profile->perms.expand_vars = switch_true(val);
profile->perms.expand_vars = switch_true_byte(val);
if (profile->perms.expand_vars) {
switch_xml_t x_list, x_var, x_api;
@@ -2039,27 +2039,27 @@ static switch_status_t do_config(void)
}
} else if (!strcasecmp(var, "dial")) {
profile->perms.dial.enabled = switch_true(val);
profile->perms.dial.enabled = switch_true_byte(val);
} else if (!strcasecmp(var, "dial-set-context")) {
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
profile->perms.dial.set_context = switch_true(val);
profile->perms.dial.set_context = switch_true_byte(val);
} else if (!strcasecmp(var, "dial-set-dialplan")) {
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
profile->perms.dial.set_dp = switch_true(val);
profile->perms.dial.set_dp = switch_true_byte(val);
} else if (!strcasecmp(var, "dial-set-cid-name")) {
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
profile->perms.dial.set_cid_name = switch_true(val);
profile->perms.dial.set_cid_name = switch_true_byte(val);
} else if (!strcasecmp(var, "dial-set-cid-number")) {
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
profile->perms.dial.set_cid_number = switch_true(val);
profile->perms.dial.set_cid_number = switch_true_byte(val);
} else if (!strcasecmp(var, "dial-full-originate")) {
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
profile->perms.dial.full_originate = switch_true(val);
profile->perms.dial.full_originate = switch_true_byte(val);
} else if (!strcasecmp(var, "conference")) {
profile->perms.conference.enabled = switch_true(val);
profile->perms.conference.enabled = switch_true_byte(val);
} else if (!strcasecmp(var, "conference-set-profile")) {
if (switch_true(val)) profile->perms.conference.enabled = SWITCH_TRUE;
profile->perms.conference.set_profile = switch_true(val);
profile->perms.conference.set_profile = switch_true_byte(val);
}
}
@@ -2577,7 +2577,7 @@ static switch_status_t write_meta_file(http_file_context_t *context, const char
data);
status = write(fd, write_data, strlen(write_data) + 1) > 0 ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
status = write(fd, write_data, (int)strlen(write_data) + 1) > 0 ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
}
close(fd);
@@ -2947,7 +2947,7 @@ static switch_status_t http_file_file_read(switch_file_handle_t *handle, void *d
*len = context->samples;
}
context->samples -= *len;
context->samples -= (int)*len;
memset(data, 255, *len *2);
status = SWITCH_STATUS_SUCCESS;
} else {