瀏覽代碼

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

tags/v0.99.beta14
Sam Hocevar sam 18 年之前
父節點
當前提交
3d376d8cad
共有 3 個檔案被更改,包括 7 行新增12 行删除
  1. +5
    -0
      common.h
  2. +0
    -5
      cucul/font.c
  3. +2
    -7
      cucul/import.c

+ 5
- 0
common.h 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 */


Loading…
取消
儲存