From: John Hodge Date: Thu, 17 Nov 2011 14:13:33 +0000 (+0800) Subject: Usermode/Libs - Fixing misc compile warnings X-Git-Tag: rel0.14~96 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=08e1f139ca02aa899f698d90146a5bc9926c2f37;p=tpg%2Facess2.git Usermode/Libs - Fixing misc compile warnings --- diff --git a/Usermode/Libraries/libnet.so_src/main.c b/Usermode/Libraries/libnet.so_src/main.c index 7f8d0482..b39d7548 100644 --- a/Usermode/Libraries/libnet.so_src/main.c +++ b/Usermode/Libraries/libnet.so_src/main.c @@ -69,6 +69,7 @@ char *Net_GetInterface(int AddressType, void *Address) // Query the route manager for the route number { char buf[sizeof(int)+size]; + uint32_t *type = (void*)buf; // Open fd = open("/Devices/ip/routes", 0); @@ -78,8 +79,8 @@ char *Net_GetInterface(int AddressType, void *Address) } // Make structure and ask - *(int*)buf = AddressType; - memcpy(&buf[sizeof(int)], Address, size); + *type = AddressType; + memcpy(type+1, Address, size); routeNum = ioctl(fd, ioctl(fd, 3, "locate_route"), buf); // Close diff --git a/Usermode/Libraries/liburi.so_src/main.c b/Usermode/Libraries/liburi.so_src/main.c index 419e05bc..bf88b98d 100644 --- a/Usermode/Libraries/liburi.so_src/main.c +++ b/Usermode/Libraries/liburi.so_src/main.c @@ -120,6 +120,7 @@ tURI *URI_Parse(const char *String) else { ret->PortStr = NULL; ret->PortNum = -1; + portlen = 0; } if(*tmp == '\0') @@ -249,7 +250,7 @@ size_t URI_Read(tURIFile *File, size_t Bytes, void *Buffer) size_t tmp; printf("URI_Read(File=%p, Bytes=%u, Buffer=%p)\n", - File, Bytes, Buffer); + File, (unsigned int)Bytes, Buffer); if(!File || !Buffer) return -1; if(Bytes == 0) return 0; @@ -315,7 +316,7 @@ int URI_file_Open(char *Host, int Port, char *Path, int Mode) if(Mode & URI_MODE_READ) smode |= OPENFLAG_READ; if(Mode & URI_MODE_WRITE) smode |= OPENFLAG_WRITE; - printf("URI_file_Open: open('%s', 0x%x)\n", Path, smode); +// printf("URI_file_Open: open('%s', 0x%x)\n", Path, smode); { int ret; ret = open(Path, smode); @@ -324,8 +325,8 @@ int URI_file_Open(char *Host, int Port, char *Path, int Mode) } size_t URI_file_Read(int Handle, size_t Bytes, void *Buffer) { - printf("URI_file_Read: (Handle=%i, Buffer=%p, Bytes=%i)\n", - Handle, Buffer, Bytes); +// printf("URI_file_Read: (Handle=%i, Buffer=%p, Bytes=%i)\n", +// Handle, Buffer, (int)Bytes); return read(Handle, Buffer, Bytes); } size_t URI_file_Write(int Handle, size_t Bytes, void *Buffer)