mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
lib:util: Remove redundant casts in PUSH_*() macros
The PUSH_*() macros already cast their arguments to the expected type, so we don’t need to cast the arguments *again* prior to invoking the macros. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
7d88280baa
commit
a334ad85b8
@ -59,17 +59,17 @@
|
||||
PUSH_LE_U8(data, pos, val)
|
||||
|
||||
#define PUSH_LE_U16(data, pos, val) \
|
||||
(PUSH_LE_U8(data, pos, (uint8_t)((uint16_t)(val) & 0xff)), PUSH_LE_U8(data, (pos) + 1, (uint8_t)((uint16_t)(val) >> 8)))
|
||||
(PUSH_LE_U8(data, pos, (uint16_t)(val) & 0xff), PUSH_LE_U8(data, (pos) + 1, (uint16_t)(val) >> 8))
|
||||
#define PUSH_LE_I16(data, pos, val) \
|
||||
PUSH_LE_U16(data, pos, val)
|
||||
|
||||
#define PUSH_LE_U32(data, pos, val) \
|
||||
(PUSH_LE_U16(data, pos, (uint16_t)((uint32_t)(val) & 0xffff)), PUSH_LE_U16(data, (pos) + 2, (uint16_t)((uint32_t)(val) >> 16)))
|
||||
(PUSH_LE_U16(data, pos, (uint32_t)(val) & 0xffff), PUSH_LE_U16(data, (pos) + 2, (uint32_t)(val) >> 16))
|
||||
#define PUSH_LE_I32(data, pos, val) \
|
||||
PUSH_LE_U32(data, pos, val)
|
||||
|
||||
#define PUSH_LE_U64(data, pos, val) \
|
||||
(PUSH_LE_U32(data, pos, (uint32_t)((uint64_t)(val) & 0xffffffff)), PUSH_LE_U32(data, (pos) + 4, (uint32_t)((uint64_t)(val) >> 32)))
|
||||
(PUSH_LE_U32(data, pos, (uint64_t)(val) & 0xffffffff), PUSH_LE_U32(data, (pos) + 4, (uint64_t)(val) >> 32))
|
||||
#define PUSH_LE_I64(data, pos, val) \
|
||||
PUSH_LE_U64(data, pos, val)
|
||||
|
||||
@ -107,17 +107,17 @@
|
||||
PUSH_BE_U8(data, pos, val)
|
||||
|
||||
#define PUSH_BE_U16(data, pos, val) \
|
||||
(PUSH_BE_U8(data, pos, (uint8_t)(((uint16_t)(val)) >> 8)), PUSH_BE_U8(data, (pos) + 1, (uint8_t)((uint16_t)(val) & 0xff)))
|
||||
(PUSH_BE_U8(data, pos, ((uint16_t)(val)) >> 8), PUSH_BE_U8(data, (pos) + 1, (uint16_t)(val) & 0xff))
|
||||
#define PUSH_BE_I16(data, pos, val) \
|
||||
PUSH_BE_U16(data, pos, val)
|
||||
|
||||
#define PUSH_BE_U32(data, pos, val) \
|
||||
(PUSH_BE_U16(data, pos, (uint16_t)(((uint32_t)(val)) >> 16)), PUSH_BE_U16(data, (pos) + 2, (uint16_t)((uint32_t)(val) & 0xffff)))
|
||||
(PUSH_BE_U16(data, pos, (uint32_t)(val) >> 16), PUSH_BE_U16(data, (pos) + 2, (uint32_t)(val) & 0xffff))
|
||||
#define PUSH_BE_I32(data, pos, val) \
|
||||
PUSH_BE_U32(data, pos, val)
|
||||
|
||||
#define PUSH_BE_U64(data, pos, val) \
|
||||
(PUSH_BE_U32(data, pos, (uint32_t)(((uint64_t)(val)) >> 32)), PUSH_BE_U32(data, (pos) + 4, (uint32_t)((uint64_t)(val) & 0xffffffff)))
|
||||
(PUSH_BE_U32(data, pos, (uint64_t)(val) >> 32), PUSH_BE_U32(data, (pos) + 4, (uint64_t)(val) & 0xffffffff))
|
||||
#define PUSH_BE_I64(data, pos, val) \
|
||||
PUSH_BE_U64(data, pos, val)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user