SCP: Cleanup compiler warnings

This commit is contained in:
Mark Pizzolato 2018-10-10 00:03:37 -07:00
parent 6e65b635e3
commit f8a18df1c4
2 changed files with 5 additions and 5 deletions

View file

@ -2284,7 +2284,7 @@ if (sim_deb_switches & SWMASK ('N'))
if (sim_deb_switches & SWMASK ('B')) { if (sim_deb_switches & SWMASK ('B')) {
sim_deb_buffer_size = (size_t)(1024 * 1024 * buffer_size); sim_deb_buffer_size = (size_t)(1024 * 1024 * buffer_size);
sim_deb_buffer = realloc (sim_deb_buffer, sim_deb_buffer_size); sim_deb_buffer = (char *)realloc (sim_deb_buffer, sim_deb_buffer_size);
sim_debug_buffer_offset = sim_debug_buffer_inuse = 0; sim_debug_buffer_offset = sim_debug_buffer_inuse = 0;
memset (sim_deb_buffer, 0, sim_deb_buffer_size); memset (sim_deb_buffer, 0, sim_deb_buffer_size);
} }

View file

@ -773,7 +773,7 @@ if (((*filepath == '\'') || (*filepath == '"')) &&
(filepath[strlen (filepath) - 1] == *filepath)) { (filepath[strlen (filepath) - 1] == *filepath)) {
size_t temp_size = 1 + strlen (filepath); size_t temp_size = 1 + strlen (filepath);
tempfilepath = malloc (temp_size); tempfilepath = (char *)malloc (temp_size);
if (tempfilepath == NULL) if (tempfilepath == NULL)
return NULL; return NULL;
strlcpy (tempfilepath, 1 + filepath, temp_size); strlcpy (tempfilepath, 1 + filepath, temp_size);
@ -784,7 +784,7 @@ if ((filepath[1] == ':') ||
(filepath[0] == '/') || (filepath[0] == '/') ||
(filepath[0] == '\\')){ (filepath[0] == '\\')){
tot_len = 1 + strlen (filepath); tot_len = 1 + strlen (filepath);
fullpath = malloc (tot_len); fullpath = (char *)malloc (tot_len);
if (fullpath == NULL) { if (fullpath == NULL) {
free (tempfilepath); free (tempfilepath);
return NULL; return NULL;
@ -800,7 +800,7 @@ else {
return NULL; return NULL;
} }
tot_len = 1 + strlen (filepath) + 1 + strlen (dir); tot_len = 1 + strlen (filepath) + 1 + strlen (dir);
fullpath = malloc (tot_len); fullpath = (char *)malloc (tot_len);
if (fullpath == NULL) { if (fullpath == NULL) {
free (tempfilepath); free (tempfilepath);
return NULL; return NULL;
@ -854,7 +854,7 @@ for (p = parts; *p; p++) {
break; break;
} }
} }
result = malloc (1 + tot_size); result = (char *)malloc (1 + tot_size);
*result = '\0'; *result = '\0';
if (*parts == '\0') /* empty part specifier means strip only quotes */ if (*parts == '\0') /* empty part specifier means strip only quotes */
strlcat (result, filepath, 1 + tot_size); strlcat (result, filepath, 1 + tot_size);