1
diff -uNrBb a/zzip/fetch.c b/zzip/fetch.c
2
--- a/zzip/fetch.c 2008-04-05 17:56:49.000000000 +0100
3
+++ b/zzip/fetch.c 2008-04-05 17:56:44.000000000 +0100
6
#include <zzip/fetch.h>
8
-#if defined ZZIP_WORDS_BIGENDIAN && \
9
- defined bswap_16 && defined bswap_32 && defined bswap_64
10
-# define __ZZIP_GET16(__p) bswap_16(*(uint16_t*)(__p))
11
-# define __ZZIP_GET32(__p) bswap_32(*(uint32_t*)(__p))
12
-# define __ZZIP_SET16(__p,__x) (*(uint16_t*)(__p) = bswap_16((uint16_t)(__x)))
13
-# define __ZZIP_SET32(__p,__x) (*(uint32_t*)(__p) = bswap_32((uint32_t)(__x)))
14
-# define __ZZIP_GET64(__p) bswap_64(*(zzip_off64_t*)(__p))
15
-# define __ZZIP_SET64(__p,__x) \
16
- (*(zzip_off64_t*)(__p) = bswap_64((zzip_off64_t)(__x)))
19
/* ------------------------- fetch helpers --------------------------------- */
22
diff -up a/zzip/fetch.h b/zzip/fetch.h
23
--- a/zzip/fetch.h 2008-03-23 07:41:26.000000000 +1100
24
+++ b/zzip/fetch.h 2009-03-23 21:28:05.000000000 +1100
25
@@ -23,35 +23,12 @@ extern void __zzip_set16(zzip_byte_t
26
extern uint64_t __zzip_get64(zzip_byte_t * s) __zzip_attribute__((const));
27
extern void __zzip_set64(zzip_byte_t * s, uint64_t v);
29
-#ifdef ZZIP_WORDS_BIGENDIAN
30
-# if defined bswap_16 && defined bswap_32 && defined bswap_64 /* i.e. linux */
31
-# ifndef ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
32
-# define _ZZIP_USE_BSWAP
35
-# ifdef _ZZIP_USE_BSWAP
36
-# define ZZIP_GET16(__p) bswap_16(*(uint16_t*)(__p))
37
-# define ZZIP_GET32(__p) bswap_32(*(uint32_t*)(__p))
38
-# define ZZIP_GET64(__p) bswap_64(*(uint64_t*)(__p))
39
-# define ZZIP_SET16(__p,__x) (*(uint16_t*)(__p) = bswap_16((uint16_t)(__x)))
40
-# define ZZIP_SET32(__p,__x) (*(uint32_t*)(__p) = bswap_32((uint32_t)(__x)))
41
-# define ZZIP_SET64(__p,__x) (*(uint64_t*)(__p) = bswap_64((uint64_t)(__x)))
43
# define ZZIP_GET64(__p) (__zzip_get64((__p)))
44
# define ZZIP_GET32(__p) (__zzip_get32((__p)))
45
# define ZZIP_GET16(__p) (__zzip_get16((__p)))
46
# define ZZIP_SET64(__p,__x) (__zzip_set64((__p),(__x)))
47
# define ZZIP_SET32(__p,__x) (__zzip_set32((__p),(__x)))
48
# define ZZIP_SET16(__p,__x) (__zzip_set16((__p),(__x)))
50
-#else /* little endian is the original zip format byteorder */
51
-# define ZZIP_GET16(__p) (*(uint16_t*)(__p))
52
-# define ZZIP_GET32(__p) (*(uint32_t*)(__p))
53
-# define ZZIP_GET64(__p) (*(uint64_t*)(__p))
54
-# define ZZIP_SET16(__p,__x) (*(uint16_t*)(__p) = (uint16_t)(__x))
55
-# define ZZIP_SET32(__p,__x) (*(uint32_t*)(__p) = (uint32_t)(__x))
56
-# define ZZIP_SET64(__p,__x) (*(uint64_t*)(__p) = (uint64_t)(__x))
59
/* ..................... bitcorrect physical access .................... */