From: John Hodge (sonata) Date: Tue, 11 Mar 2014 00:01:26 +0000 (+0800) Subject: Usermode/libpsocket - Constify and bugfix X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=c6eb9805c1835736a71c1415ced824744c66ff91;p=tpg%2Facess2.git Usermode/libpsocket - Constify and bugfix --- diff --git a/Usermode/Libraries/libpsocket.so_src/getaddrinfo.c b/Usermode/Libraries/libpsocket.so_src/getaddrinfo.c index aa8128d9..bd50f911 100644 --- a/Usermode/Libraries/libpsocket.so_src/getaddrinfo.c +++ b/Usermode/Libraries/libpsocket.so_src/getaddrinfo.c @@ -113,9 +113,9 @@ int getaddrinfo(const char *node, const char *service, const struct addrinfo *hi // Convert `node` into types if( service ) { - char *end; + const char *end; - default_port = strtol(service, &end, 0); + default_port = strtol(service, (char**)&end, 0); if( *end != '\0' && (hints->ai_flags & AI_NUMERICSERV) ) { return EAI_NONAME; diff --git a/Usermode/Libraries/libpsocket.so_src/pton.c b/Usermode/Libraries/libpsocket.so_src/pton.c index 581c4f1c..32cde27a 100644 --- a/Usermode/Libraries/libpsocket.so_src/pton.c +++ b/Usermode/Libraries/libpsocket.so_src/pton.c @@ -8,6 +8,7 @@ #include #include // Net_PrintAddress #include // _SysDebug +#include // === CODE === int inet_pton(int af, const char *src, void *dst) @@ -22,10 +23,10 @@ const char *inet_ntop(int af, const void *src, char *dest, size_t len) switch(af) { case AF_INET: - str = Net_PrintAddress(4, ((struct in_addr*)src)->s_addr); + str = Net_PrintAddress(4, &((const struct in_addr*)src)->s_addr); break; case AF_INET6: - str = Net_PrintAddress(6, ((struct in6_addr*)src)->s6_addr); + str = Net_PrintAddress(6, &((const struct in6_addr*)src)->s6_addr); break; default: str = NULL;