blob: 024954267564a0e16105d8b5a1845e8aa34f01af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
$NetBSD: patch-ak,v 1.1.1.1 2004/05/14 15:42:15 dillo Exp $
This includes sound-20040508.diff from the master site.
--- sys.h.orig Sat Apr 17 19:06:50 2004
+++ sys.h
@@ -26,7 +26,7 @@ typedef signed short int16;
typedef unsigned long uint32;
typedef signed long int32;
-#if defined LITTLE_ENDIAN
+#if defined SYS_LITTLE_ENDIAN
inline uint16 READ_BE_UINT16(const void *ptr) {
const uint8 *b = (const uint8 *)ptr;
@@ -38,16 +38,14 @@ inline uint32 READ_BE_UINT32(const void
return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
}
-#elif defined BIG_ENDIAN
+#elif defined SYS_BIG_ENDIAN
inline uint16 READ_BE_UINT16(const void *ptr) {
- return (const uint8 *)ptr;
- return (b[1] << 8) | b[0];
+ return *(const uint16 *)ptr;
}
inline uint32 READ_BE_UINT32(const void *ptr) {
- const uint8 *b = (const uint8 *)ptr;
- return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0];
+ return *(const uint32 *)ptr;
}
#else
|