(MSVC) MSVC build fixes

This commit is contained in:
twinaphex 2016-12-24 01:45:01 +01:00
parent 3639011ed4
commit 64dc7daeca
2 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ static size_t buf_remaining(struct socket_buffer *sbuf)
*/ */
bool netplay_init_socket_buffer(struct socket_buffer *sbuf, size_t size) bool netplay_init_socket_buffer(struct socket_buffer *sbuf, size_t size)
{ {
sbuf->data = malloc(size); sbuf->data = (unsigned char*)malloc(size);
if (sbuf->data == NULL) if (sbuf->data == NULL)
return false; return false;
sbuf->bufsz = size; sbuf->bufsz = size;
@ -71,7 +71,7 @@ bool netplay_init_socket_buffer(struct socket_buffer *sbuf, size_t size)
*/ */
bool netplay_resize_socket_buffer(struct socket_buffer *sbuf, size_t newsize) bool netplay_resize_socket_buffer(struct socket_buffer *sbuf, size_t newsize)
{ {
unsigned char *newdata = malloc(newsize); unsigned char *newdata = (unsigned char*)malloc(newsize);
if (newdata == NULL) if (newdata == NULL)
return false; return false;

View File

@ -283,7 +283,7 @@ bool netplay_sync_pre_frame(netplay_t *netplay)
{ {
if (connection_num == 0) if (connection_num == 0)
{ {
netplay->connections = malloc(sizeof(struct netplay_connection)); netplay->connections = (netplay_connection*)malloc(sizeof(struct netplay_connection));
if (netplay->connections == NULL) if (netplay->connections == NULL)
{ {
socket_close(new_fd); socket_close(new_fd);
@ -295,7 +295,7 @@ bool netplay_sync_pre_frame(netplay_t *netplay)
else else
{ {
size_t new_connections_size = netplay->connections_size * 2; size_t new_connections_size = netplay->connections_size * 2;
struct netplay_connection *new_connections = struct netplay_connection *new_connections = (netplay_connection*)
realloc(netplay->connections, realloc(netplay->connections,
new_connections_size*sizeof(struct netplay_connection)); new_connections_size*sizeof(struct netplay_connection));
if (new_connections == NULL) if (new_connections == NULL)