summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-11-26 23:45:13 +0300
committerMatthieu Patou <mat@samba.org>2010-11-26 22:32:16 +0100
commit58db821de1cc8c3eca9257638e7ed1b250b28400 (patch)
treee62f34d11f0b34ab5e20d471842a5bc4dc66aaf1 /lib
parente8ae340421aa62d396543d183641eeecf0ab2b96 (diff)
downloadsamba-58db821de1cc8c3eca9257638e7ed1b250b28400.tar.gz
samba-58db821de1cc8c3eca9257638e7ed1b250b28400.tar.bz2
samba-58db821de1cc8c3eca9257638e7ed1b250b28400.zip
Fix endianess problems as discovered on the build farm
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Fri Nov 26 22:32:16 CET 2010 on sn-devel-104
Diffstat (limited to 'lib')
-rw-r--r--lib/compression/lzxpress.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/compression/lzxpress.c b/lib/compression/lzxpress.c
index 0396c9ddcb..a4ded7e455 100644
--- a/lib/compression/lzxpress.c
+++ b/lib/compression/lzxpress.c
@@ -34,6 +34,7 @@
#include "replace.h"
#include "lzxpress.h"
+#include "../lib/util/byteorder.h"
#define __BUF_POS_CONST(buf,ofs)(((const uint8_t *)buf)+(ofs))
@@ -130,11 +131,11 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
if (best_len < 10) {
/* Classical meta-data */
metadata = (uint16_t)(((best_offset - 1) << 3) | (best_len - 3));
- dest[metadata_size / sizeof(uint16_t)] = metadata;
+ SSVAL(dest, metadata_size / sizeof(uint16_t), metadata);
metadata_size += sizeof(uint16_t);
} else {
metadata = (uint16_t)(((best_offset - 1) << 3) | 7);
- dest[metadata_size / sizeof(uint16_t)] = metadata;
+ SSVAL(dest, metadata_size / sizeof(uint16_t), metadata);
metadata_size = sizeof(uint16_t);
if (best_len < (15 + 7 + 3)) {
@@ -199,7 +200,7 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
indic_bit++;
if ((indic_bit - 1) % 32 > (indic_bit % 32)) {
- *(uint32_t *)indic_pos = indic;
+ SIVAL(indic_pos, 0, indic);
indic = 0;
indic_pos = &compressed[compressed_pos];
compressed_pos += sizeof(uint32_t);
@@ -213,7 +214,7 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
uncompressed_pos++;
compressed_pos++;
if (((indic_bit - 1) % 32) > (indic_bit % 32)){
- *(uint32_t *)indic_pos = indic;
+ SIVAL(indic_pos, 0, indic);
indic = 0;
indic_pos = &compressed[compressed_pos];
compressed_pos += sizeof(uint32_t);
@@ -225,7 +226,7 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
indic |= 0 << (32 - ((indic_bit % 32) + 1));
*(uint32_t *)&compressed[compressed_pos] = 0;
- *(uint32_t *)indic_pos = indic;
+ SIVAL(indic_pos, 0, indic);
compressed_pos += sizeof(uint32_t);
}