diff options
Diffstat (limited to 'core/network.c')
-rw-r--r-- | core/network.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/network.c b/core/network.c index 601066cd..6b5f9970 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -63,10 +63,10 @@ static int sock; | |||
63 | 63 | ||
64 | //Basic network functions: | 64 | //Basic network functions: |
65 | //Function to send packet(data) of length length to ip_port | 65 | //Function to send packet(data) of length length to ip_port |
66 | int sendpacket(IP_Port ip_port, char * data, uint32_t length) | 66 | int sendpacket(IP_Port ip_port, uint8_t * data, uint32_t length) |
67 | { | 67 | { |
68 | ADDR addr = {AF_INET, ip_port.port, ip_port.ip}; | 68 | ADDR addr = {AF_INET, ip_port.port, ip_port.ip}; |
69 | return sendto(sock, data, length, 0, (struct sockaddr *)&addr, sizeof(addr)); | 69 | return sendto(sock,(char *) data, length, 0, (struct sockaddr *)&addr, sizeof(addr)); |
70 | 70 | ||
71 | } | 71 | } |
72 | 72 | ||
@@ -74,7 +74,7 @@ int sendpacket(IP_Port ip_port, char * data, uint32_t length) | |||
74 | //the packet data into data | 74 | //the packet data into data |
75 | //the packet length into length. | 75 | //the packet length into length. |
76 | //dump all empty packets. | 76 | //dump all empty packets. |
77 | int recievepacket(IP_Port * ip_port, char * data, uint32_t * length) | 77 | int recievepacket(IP_Port * ip_port, uint8_t * data, uint32_t * length) |
78 | { | 78 | { |
79 | ADDR addr; | 79 | ADDR addr; |
80 | #ifdef WIN32 | 80 | #ifdef WIN32 |
@@ -82,7 +82,7 @@ int recievepacket(IP_Port * ip_port, char * data, uint32_t * length) | |||
82 | #else | 82 | #else |
83 | uint32_t addrlen = sizeof(addr); | 83 | uint32_t addrlen = sizeof(addr); |
84 | #endif | 84 | #endif |
85 | (*(int32_t *)length) = recvfrom(sock, data, MAX_UDP_PACKET_SIZE, 0, (struct sockaddr *)&addr, &addrlen); | 85 | (*(int32_t *)length) = recvfrom(sock,(char *) data, MAX_UDP_PACKET_SIZE, 0, (struct sockaddr *)&addr, &addrlen); |
86 | if(*(int32_t *)length <= 0) | 86 | if(*(int32_t *)length <= 0) |
87 | { | 87 | { |
88 | //nothing received | 88 | //nothing received |