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:
parent
f2ea8d4c05
commit
52982c01a5
@ -177,19 +177,14 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
|
|||||||
|
|
||||||
if (match_len < (1 << 16)) {
|
if (match_len < (1 << 16)) {
|
||||||
CHECK_OUTPUT_BYTES(sizeof(uint16_t));
|
CHECK_OUTPUT_BYTES(sizeof(uint16_t));
|
||||||
compressed[compressed_pos] = match_len & 0xFF;
|
PUSH_LE_U16(compressed, compressed_pos, match_len);
|
||||||
compressed[compressed_pos + 1] = (match_len >> 8);
|
|
||||||
compressed_pos += sizeof(uint16_t);
|
compressed_pos += sizeof(uint16_t);
|
||||||
} else {
|
} else {
|
||||||
CHECK_OUTPUT_BYTES(sizeof(uint16_t) + sizeof(uint32_t));
|
CHECK_OUTPUT_BYTES(sizeof(uint16_t) + sizeof(uint32_t));
|
||||||
compressed[compressed_pos] = 0;
|
PUSH_LE_U16(compressed, compressed_pos, 0);
|
||||||
compressed[compressed_pos + 1] = 0;
|
|
||||||
compressed_pos += sizeof(uint16_t);
|
compressed_pos += sizeof(uint16_t);
|
||||||
|
|
||||||
compressed[compressed_pos] = match_len & 0xFF;
|
PUSH_LE_U32(compressed, compressed_pos, match_len);
|
||||||
compressed[compressed_pos + 1] = (match_len >> 8) & 0xFF;
|
|
||||||
compressed[compressed_pos + 2] = (match_len >> 16) & 0xFF;
|
|
||||||
compressed[compressed_pos + 3] = (match_len >> 24) & 0xFF;
|
|
||||||
compressed_pos += sizeof(uint32_t);
|
compressed_pos += sizeof(uint32_t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user