1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

compression: Make use of PUSH_LE_Uxx macros

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2022-03-07 20:24:48 +13:00 committed by Andrew Bartlett
parent f2ea8d4c05
commit 52982c01a5

View File

@ -177,19 +177,14 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
if (match_len < (1 << 16)) {
CHECK_OUTPUT_BYTES(sizeof(uint16_t));
compressed[compressed_pos] = match_len & 0xFF;
compressed[compressed_pos + 1] = (match_len >> 8);
PUSH_LE_U16(compressed, compressed_pos, match_len);
compressed_pos += sizeof(uint16_t);
} else {
CHECK_OUTPUT_BYTES(sizeof(uint16_t) + sizeof(uint32_t));
compressed[compressed_pos] = 0;
compressed[compressed_pos + 1] = 0;
PUSH_LE_U16(compressed, compressed_pos, 0);
compressed_pos += sizeof(uint16_t);
compressed[compressed_pos] = match_len & 0xFF;
compressed[compressed_pos + 1] = (match_len >> 8) & 0xFF;
compressed[compressed_pos + 2] = (match_len >> 16) & 0xFF;
compressed[compressed_pos + 3] = (match_len >> 24) & 0xFF;
PUSH_LE_U32(compressed, compressed_pos, match_len);
compressed_pos += sizeof(uint32_t);
}
}