diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-27 15:00:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-27 15:28:44 -0400 |
commit | 4d81f5211b3c714edae6370bccc6873033c0092d (patch) | |
tree | 351446df167a5e80530a66dcb7b13c697fa19180 /src/common/compat.h | |
parent | 000de2f2ac4f740be8351673691371d78a5da7e9 (diff) | |
download | tor-4d81f5211b3c714edae6370bccc6873033c0092d.tar.gz tor-4d81f5211b3c714edae6370bccc6873033c0092d.zip |
Move set/get_uint*() to inline functions in arch/bytes.h
Also move our ntohll/htonll functions.
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index 1379f95a7e..2282e07be3 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -46,6 +46,7 @@ #endif #include "lib/cc/compat_compiler.h" +#include "lib/arch/bytes.h" #include "common/compat_time.h" #include "lib/string/compat_ctype.h" #include "lib/string/compat_string.h" @@ -152,22 +153,6 @@ typedef enum { /* ===== OS compatibility */ MOCK_DECL(const char *, get_uname, (void)); -uint16_t get_uint16(const void *cp) ATTR_NONNULL((1)); -uint32_t get_uint32(const void *cp) ATTR_NONNULL((1)); -uint64_t get_uint64(const void *cp) ATTR_NONNULL((1)); -void set_uint16(void *cp, uint16_t v) ATTR_NONNULL((1)); -void set_uint32(void *cp, uint32_t v) ATTR_NONNULL((1)); -void set_uint64(void *cp, uint64_t v) ATTR_NONNULL((1)); - -/* These uint8 variants are defined to make the code more uniform. */ -#define get_uint8(cp) (*(const uint8_t*)(cp)) -static void set_uint8(void *cp, uint8_t v); -static inline void -set_uint8(void *cp, uint8_t v) -{ - *(uint8_t*)cp = v; -} - #if !defined(HAVE_RLIM_T) typedef unsigned long rlim_t; #endif |