Changeset 1303 for libcaca/trunk


Ignore:
Timestamp:
Nov 8, 2006, 2:05:42 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • Don't use htonl() directly, use common.h's hton32() wrapper.
Location:
libcaca/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/common.h

    r1048 r1303  
    3434
    3535#if defined(HAVE_HTONS)
     36#   if defined(HAVE_ARPA_INET_H)
     37#       include <arpa/inet.h>
     38#   elif defined(HAVE_NETINET_IN_H)
     39#       include <netinet/in.h>
     40#   endif
    3641#   define hton16 htons
    3742#   define hton32 htonl
  • libcaca/trunk/cucul/font.c

    r1281 r1303  
    2222#   if defined(HAVE_ENDIAN_H)
    2323#       include <endian.h>
    24 #   endif
    25 #   if defined(HAVE_ARPA_INET_H)
    26 #       include <arpa/inet.h>
    27 #   elif defined(HAVE_NETINET_IN_H)
    28 #       include <netinet/in.h>
    2924#   endif
    3025#   if defined(HAVE_ERRNO_H)
  • libcaca/trunk/cucul/import.c

    r1302 r1303  
    2323#       include <errno.h>
    2424#   endif
    25 #   if defined(HAVE_ARPA_INET_H)
    26 #       include <arpa/inet.h>
    27 #   elif defined(HAVE_NETINET_IN_H)
    28 #       include <netinet/in.h>
    29 #   endif
    3025#   include <stdio.h>
    3126#   include <stdlib.h>
     
    4035    uint32_t x;
    4136    memcpy(&x, s, 4);
    42     return ntohl(x);
     37    return hton32(x);
    4338}
    4439
     
    4742    uint16_t x;
    4843    memcpy(&x, s, 2);
    49     return ntohs(x);
     44    return hton16(x);
    5045}
    5146
Note: See TracChangeset for help on using the changeset viewer.