aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_flags_encoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-10-04 22:57:12 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-10-04 22:57:12 +0300
commitebfb2c5e1f344e5c6e549b9dedaa49b0749a4a24 (patch)
tree7e2f519ad2be01b8f9c7b230f71d479d550c9ae4 /src/liblzma/common/stream_flags_encoder.c
parentAdd support for --enable-assume-ram=SIZE. (diff)
downloadxz-ebfb2c5e1f344e5c6e549b9dedaa49b0749a4a24.tar.xz
Use a tuklib module for integer handling.
This replaces bswap.h and integer.h. The tuklib module uses <byteswap.h> on GNU, <sys/endian.h> on *BSDs and <sys/byteorder.h> on Solaris, which may contain optimized code like inline assembly.
Diffstat (limited to '')
-rw-r--r--src/liblzma/common/stream_flags_encoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liblzma/common/stream_flags_encoder.c b/src/liblzma/common/stream_flags_encoder.c
index ecbd0f13..4e717159 100644
--- a/src/liblzma/common/stream_flags_encoder.c
+++ b/src/liblzma/common/stream_flags_encoder.c
@@ -46,7 +46,7 @@ lzma_stream_header_encode(const lzma_stream_flags *options, uint8_t *out)
const uint32_t crc = lzma_crc32(out + sizeof(lzma_header_magic),
LZMA_STREAM_FLAGS_SIZE, 0);
- integer_write_32(out + sizeof(lzma_header_magic)
+ unaligned_write32le(out + sizeof(lzma_header_magic)
+ LZMA_STREAM_FLAGS_SIZE, crc);
return LZMA_OK;
@@ -66,7 +66,7 @@ lzma_stream_footer_encode(const lzma_stream_flags *options, uint8_t *out)
if (!is_backward_size_valid(options))
return LZMA_PROG_ERROR;
- integer_write_32(out + 4, options->backward_size / 4 - 1);
+ unaligned_write32le(out + 4, options->backward_size / 4 - 1);
// Stream Flags
if (stream_flags_encode(options, out + 2 * 4))
@@ -76,7 +76,7 @@ lzma_stream_footer_encode(const lzma_stream_flags *options, uint8_t *out)
const uint32_t crc = lzma_crc32(
out + 4, 4 + LZMA_STREAM_FLAGS_SIZE, 0);
- integer_write_32(out, crc);
+ unaligned_write32le(out, crc);
// Magic
memcpy(out + 2 * 4 + LZMA_STREAM_FLAGS_SIZE,