Avoid void * arithmetic
[mplayer/glamo.git] / tremor / tremor.diff
blob04f540c113835cc96e2cac603b41c2c0c73e0c2c
1 diff -ur orig/misc.h mod-2004-01-05/misc.h
2 --- misc.h 2005-01-04 16:29:01.000000000 +0100
3 +++ misc.h 2004-12-30 13:09:20.000000000 +0100
4 @@ -29,8 +29,9 @@
5 /* 64 bit multiply */
7 #include <sys/types.h>
8 +#include "config.h"
10 -#if BYTE_ORDER==LITTLE_ENDIAN
11 +#ifndef WORDS_BIGENDIAN
12 union magic {
13 struct {
14 ogg_int32_t lo;
15 @@ -38,9 +39,7 @@
16 } halves;
17 ogg_int64_t whole;
19 -#endif
21 -#if BYTE_ORDER==BIG_ENDIAN
22 +#else
23 union magic {
24 struct {
25 ogg_int32_t hi;
26 diff -ur orig/os_types.h mod-2004-01-05/os_types.h
27 --- os_types.h 2005-01-04 16:29:02.000000000 +0100
28 +++ os_types.h 2005-01-05 10:39:07.000000000 +0100
29 @@ -32,57 +32,11 @@
30 #define _ogg_realloc realloc
31 #define _ogg_free free
33 -#ifdef _WIN32
35 -# ifndef __GNUC__
36 - /* MSVC/Borland */
37 - typedef __int64 ogg_int64_t;
38 - typedef __int32 ogg_int32_t;
39 - typedef unsigned __int32 ogg_uint32_t;
40 - typedef __int16 ogg_int16_t;
41 -# else
42 - /* Cygwin */
43 - #include <_G_config.h>
44 - typedef _G_int64_t ogg_int64_t;
45 - typedef _G_int32_t ogg_int32_t;
46 - typedef _G_uint32_t ogg_uint32_t;
47 - typedef _G_int16_t ogg_int16_t;
48 -# endif
50 -#elif defined(__MACOS__)
52 -# include <sys/types.h>
53 - typedef SInt16 ogg_int16_t;
54 - typedef SInt32 ogg_int32_t;
55 - typedef UInt32 ogg_uint32_t;
56 - typedef SInt64 ogg_int64_t;
58 -#elif defined(__MACOSX__) /* MacOS X Framework build */
60 -# include <sys/types.h>
61 - typedef int16_t ogg_int16_t;
62 - typedef int32_t ogg_int32_t;
63 - typedef u_int32_t ogg_uint32_t;
64 + #include <inttypes.h>
65 typedef int64_t ogg_int64_t;
67 -#elif defined(__BEOS__)
69 - /* Be */
70 -# include <inttypes.h>
72 -#elif defined (__EMX__)
74 - /* OS/2 GCC */
75 - typedef short ogg_int16_t;
76 - typedef int ogg_int32_t;
77 - typedef unsigned int ogg_uint32_t;
78 - typedef long long ogg_int64_t;
80 -#else
82 -# include <sys/types.h>
83 -# include "config_types.h"
85 -#endif
86 + typedef int32_t ogg_int32_t;
87 + typedef uint32_t ogg_uint32_t;
88 + typedef uint16_t ogg_uint16_t;
89 + typedef int16_t ogg_int16_t;
91 #endif /* _OS_TYPES_H */
92 Index: sharedbook.c
93 ===================================================================
94 RCS file: /cvsroot/mplayer/main/tremor/sharedbook.c,v
95 retrieving revision 1.1
96 diff -u -r1.1 sharedbook.c
97 --- sharedbook.c 30 Dec 2004 12:09:20 -0000 1.1
98 +++ sharedbook.c 18 Aug 2005 16:13:54 -0000
99 @@ -208,7 +211,7 @@
100 int indexdiv=1;
101 for(k=0;k<b->dim;k++){
102 int index= (j/indexdiv)%quantvals;
103 - int point;
104 + ogg_int32_t point;
105 int val=VFLOAT_MULTI(delta,delpoint,
106 abs(b->quantlist[index]),&point);
108 @@ -242,7 +245,7 @@
109 int lastpoint=0;
111 for(k=0;k<b->dim;k++){
112 - int point;
113 + ogg_int32_t point;
114 int val=VFLOAT_MULTI(delta,delpoint,
115 abs(b->quantlist[j*b->dim+k]),&point);