Browse Source

* Don't use htonl() directly, use common.h's hton32() wrapper.

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
3d376d8cad
3 changed files with 7 additions and 12 deletions
  1. +5
    -0
      common.h
  2. +0
    -5
      cucul/font.c
  3. +2
    -7
      cucul/import.c

+ 5
- 0
common.h View File

@@ -33,6 +33,11 @@ typedef unsigned long int uintptr_t;
#endif #endif


#if defined(HAVE_HTONS) #if defined(HAVE_HTONS)
# if defined(HAVE_ARPA_INET_H)
# include <arpa/inet.h>
# elif defined(HAVE_NETINET_IN_H)
# include <netinet/in.h>
# endif
# define hton16 htons # define hton16 htons
# define hton32 htonl # define hton32 htonl
#else #else


+ 0
- 5
cucul/font.c View File

@@ -22,11 +22,6 @@
# if defined(HAVE_ENDIAN_H) # if defined(HAVE_ENDIAN_H)
# include <endian.h> # include <endian.h>
# endif # endif
# if defined(HAVE_ARPA_INET_H)
# include <arpa/inet.h>
# elif defined(HAVE_NETINET_IN_H)
# include <netinet/in.h>
# endif
# if defined(HAVE_ERRNO_H) # if defined(HAVE_ERRNO_H)
# include <errno.h> # include <errno.h>
# endif # endif


+ 2
- 7
cucul/import.c View File

@@ -22,11 +22,6 @@
# if defined(HAVE_ERRNO_H) # if defined(HAVE_ERRNO_H)
# include <errno.h> # include <errno.h>
# endif # endif
# if defined(HAVE_ARPA_INET_H)
# include <arpa/inet.h>
# elif defined(HAVE_NETINET_IN_H)
# include <netinet/in.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
# include <string.h> # include <string.h>
@@ -39,14 +34,14 @@ static inline uint32_t sscanu32(void const *s)
{ {
uint32_t x; uint32_t x;
memcpy(&x, s, 4); memcpy(&x, s, 4);
return ntohl(x);
return hton32(x);
} }


static inline uint16_t sscanu16(void const *s) static inline uint16_t sscanu16(void const *s)
{ {
uint16_t x; uint16_t x;
memcpy(&x, s, 2); memcpy(&x, s, 2);
return ntohs(x);
return hton16(x);
} }


/* ANSI Graphic Rendition Combination Mode */ /* ANSI Graphic Rendition Combination Mode */


Loading…
Cancel
Save