mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-13 17:57:12 +08:00
bytesex.h: simplify the trivial case of cpu_to_le*()
In the trivial case, cpu_to_le*() can just be macros containing a single cast. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
parent
82025ea0e9
commit
8cdde2bbaa
@ -130,13 +130,13 @@
|
||||
#ifdef WORDS_LITTLEENDIAN
|
||||
|
||||
#ifndef HAVE_CPU_TO_LE16
|
||||
static inline uint16_t cpu_to_le16(uint16_t v) { return v; }
|
||||
# define cpu_to_le16(v) ((uint16_t)(v))
|
||||
#endif
|
||||
#ifndef HAVE_CPU_TO_LE32
|
||||
static inline uint32_t cpu_to_le32(uint32_t v) { return v; }
|
||||
# define cpu_to_le32(v) ((uint32_t)(v))
|
||||
#endif
|
||||
#ifndef HAVE_CPU_TO_LE64
|
||||
static inline uint64_t cpu_to_le64(uint64_t v) { return v; }
|
||||
# define cpu_to_le64(v) ((uint64_t)(v))
|
||||
#endif
|
||||
|
||||
#elif defined(WORDS_BIGENDIAN)
|
||||
|
Loading…
x
Reference in New Issue
Block a user