- Timestamp:
- Jun 15, 2008, 2:28:14 PM (14 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/kernel/kernel.c
r2300 r2398 383 383 384 384 /* errno.h stuff */ 385 385 386 int errno = 0; 386 387 387 /* arpa/inet.h functions */388 389 /* XXX FIXME Converts only from little endian to big endian (x86) */390 unsigned int htonl(unsigned int hostlong)391 {392 return ((hostlong&0xFFFF0000)>>16)|((hostlong&0x0000FFFFFF)<<16);393 }394 395 /* XXX FIXME Converts only from little endian to big endian (x86) */396 unsigned short htons(unsigned short hostlong)397 {398 return ((hostlong&0xFF00)>>8)|((hostlong&0x00FF)<<8);399 }400 401 388 #endif /* __KERNEL__ */ -
libcaca/trunk/stubs.h
r2299 r2398 51 51 52 52 /* hton16() and hton32() */ 53 #if defined HAVE_HTONS 54 # if defined __KERNEL__ 55 /* Nothing to do */ 56 # elif defined HAVE_ARPA_INET_H 53 #if defined HAVE_HTONS && !defined __KERNEL__ 54 # if defined HAVE_ARPA_INET_H 57 55 # include <arpa/inet.h> 58 56 # elif defined HAVE_NETINET_IN_H … … 62 60 # define hton32 htonl 63 61 #else 64 # if defined HAVE_ENDIAN_H 62 # if defined __KERNEL__ 63 /* Nothing to do */ 64 # elif defined HAVE_ENDIAN_H 65 65 # include <endian.h> 66 66 # endif -
libcaca/trunk/tools/makefont.c
r2299 r2398 437 437 static int printf_u32(char const *fmt, uint32_t i) 438 438 { 439 uint32_t ni = hton l(i);439 uint32_t ni = hton32(i); 440 440 return printf_hex(fmt, (uint8_t *)&ni, 4); 441 441 } … … 443 443 static int printf_u16(char const *fmt, uint16_t i) 444 444 { 445 uint16_t ni = hton s(i);445 uint16_t ni = hton16(i); 446 446 return printf_hex(fmt, (uint8_t *)&ni, 2); 447 447 }
Note: See TracChangeset
for help on using the changeset viewer.