Sfoglia il codice sorgente

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

tags/v0.99.beta14
Sam Hocevar sam 18 anni fa
parent
commit
3d376d8cad
3 ha cambiato i file con 7 aggiunte e 12 eliminazioni
  1. +5
    -0
      common.h
  2. +0
    -5
      cucul/font.c
  3. +2
    -7
      cucul/import.c

+ 5
- 0
common.h Vedi File

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

#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 hton32 htonl
#else


+ 0
- 5
cucul/font.c Vedi File

@@ -22,11 +22,6 @@
# if defined(HAVE_ENDIAN_H)
# include <endian.h>
# 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)
# include <errno.h>
# endif


+ 2
- 7
cucul/import.c Vedi File

@@ -22,11 +22,6 @@
# if defined(HAVE_ERRNO_H)
# include <errno.h>
# 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 <stdlib.h>
# include <string.h>
@@ -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 */


Caricamento…
Annulla
Salva