From 3d376d8cad9bb6d87996daaac89daa8e7542a3b8 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 8 Nov 2006 13:05:42 +0000 Subject: [PATCH] * Don't use htonl() directly, use common.h's hton32() wrapper. --- common.h | 5 +++++ cucul/font.c | 5 ----- cucul/import.c | 9 ++------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/common.h b/common.h index b5026d8..77a89b5 100644 --- a/common.h +++ b/common.h @@ -33,6 +33,11 @@ typedef unsigned long int uintptr_t; #endif #if defined(HAVE_HTONS) +# if defined(HAVE_ARPA_INET_H) +# include +# elif defined(HAVE_NETINET_IN_H) +# include +# endif # define hton16 htons # define hton32 htonl #else diff --git a/cucul/font.c b/cucul/font.c index 78123d2..f887f99 100644 --- a/cucul/font.c +++ b/cucul/font.c @@ -22,11 +22,6 @@ # if defined(HAVE_ENDIAN_H) # include # endif -# if defined(HAVE_ARPA_INET_H) -# include -# elif defined(HAVE_NETINET_IN_H) -# include -# endif # if defined(HAVE_ERRNO_H) # include # endif diff --git a/cucul/import.c b/cucul/import.c index da7abde..a05c95b 100644 --- a/cucul/import.c +++ b/cucul/import.c @@ -22,11 +22,6 @@ # if defined(HAVE_ERRNO_H) # include # endif -# if defined(HAVE_ARPA_INET_H) -# include -# elif defined(HAVE_NETINET_IN_H) -# include -# endif # include # include # include @@ -39,14 +34,14 @@ static inline uint32_t sscanu32(void const *s) { uint32_t x; memcpy(&x, s, 4); - return ntohl(x); + return hton32(x); } static inline uint16_t sscanu16(void const *s) { uint16_t x; memcpy(&x, s, 2); - return ntohs(x); + return hton16(x); } /* ANSI Graphic Rendition Combination Mode */