Skip to content

Commit 661e5b5

Browse files
committed
Some more malloc/realloc casts for C++
1 parent 151d493 commit 661e5b5

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

libretro-common/file/file_path.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void path_linked_list_add_path(struct path_linked_list *in_path_llist,
146146
in_path_llist->path = strdup(path);
147147
else
148148
{
149-
struct path_linked_list *node = (struct path_linked_list*) malloc(sizeof(*node));
149+
struct path_linked_list *node = (struct path_linked_list*)malloc(sizeof(*node));
150150

151151
if (node)
152152
{
@@ -1401,7 +1401,7 @@ size_t fill_pathname_application_path(char *s, size_t len)
14011401
return strlcpy(s, info.name, len);
14021402
}
14031403
#elif defined(__QNX__)
1404-
char *buff = malloc(len);
1404+
char *buff = (char*)malloc(len);
14051405
size_t _len = 0;
14061406
if (_cmdname(buff))
14071407
_len = strlcpy(s, buff, len);

libretro-common/net/net_socket_ssl_bear.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ static size_t current_vdn_size;
4545

4646
static uint8_t* blobdup(const void * src, size_t len)
4747
{
48-
uint8_t * ret = malloc(len);
48+
uint8_t *ret = (uint8_t*)malloc(len);
4949
memcpy(ret, src, len);
5050
return ret;
5151
}
5252
static void vdn_append(void* dest_ctx, const void * src, size_t len)
5353
{
54-
current_vdn = realloc(current_vdn, current_vdn_size + len);
55-
memcpy(current_vdn+current_vdn_size, src, len);
54+
current_vdn = (uint8_t*)realloc(current_vdn, current_vdn_size + len);
55+
memcpy(current_vdn + current_vdn_size, src, len);
5656
current_vdn_size += len;
5757
}
5858

network/cloud_sync/webdav.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ static void webdav_do_update(bool success, webdav_cb_state_t *webdav_cb_st)
758758

759759
/* TODO: would be better to read file as it's being written to wire, this is very inefficient */
760760
len = filestream_get_size(webdav_cb_st->rfile);
761-
buf = malloc((size_t)(len + 1));
761+
buf = (char*)malloc((size_t)(len + 1));
762762
filestream_read(webdav_cb_st->rfile, buf, len);
763763

764764
fill_pathname_join_special(url, webdav_st->url, webdav_cb_st->path, sizeof(url));

tasks/task_save.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ bool content_undo_load_state(void)
160160
size_t temp_data_size;
161161
bool ret = false;
162162
unsigned num_blocks = 0;
163-
void* temp_data = NULL;
163+
void *temp_data = NULL;
164164
struct sram_block *blocks = NULL;
165165
struct string_list *savefile_list = (struct string_list*)savefile_ptr_get();
166166

0 commit comments

Comments
 (0)