comparison src/video/math_private.h @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 7a610f25c12f
children 2a3ec308d995
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
18 #define _MATH_PRIVATE_H_ 18 #define _MATH_PRIVATE_H_
19 19
20 #include "SDL_name.h" 20 #include "SDL_name.h"
21 #include "SDL_endian.h" 21 #include "SDL_endian.h"
22 22
23 #define huge really_big /* huge is a reserved keyword in VC++ 6.0 */ 23 #define huge really_big /* huge is a reserved keyword in VC++ 6.0 */
24 #define u_int32_t uint32_t 24 #define u_int32_t uint32_t
25 25
26 /* The original fdlibm code used statements like: 26 /* The original fdlibm code used statements like:
27 n0 = ((*(int*)&one)>>29)^1; * index of high word * 27 n0 = ((*(int*)&one)>>29)^1; * index of high word *
28 ix0 = *(n0+(int*)&x); * high word of x * 28 ix0 = *(n0+(int*)&x); * high word of x *
46 #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) || \ 46 #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) || \
47 (!defined(__VFP_FP__) && (defined(__arm__) || defined(__thumb__))) 47 (!defined(__VFP_FP__) && (defined(__arm__) || defined(__thumb__)))
48 48
49 typedef union 49 typedef union
50 { 50 {
51 double value; 51 double value;
52 struct 52 struct
53 { 53 {
54 u_int32_t msw; 54 u_int32_t msw;
55 u_int32_t lsw; 55 u_int32_t lsw;
56 } parts; 56 } parts;
57 } ieee_double_shape_type; 57 } ieee_double_shape_type;
58 58
59 #else 59 #else
60 60
61 typedef union 61 typedef union
62 { 62 {
63 double value; 63 double value;
64 struct 64 struct
65 { 65 {
66 u_int32_t lsw; 66 u_int32_t lsw;
67 u_int32_t msw; 67 u_int32_t msw;
68 } parts; 68 } parts;
69 } ieee_double_shape_type; 69 } ieee_double_shape_type;
70 70
71 #endif 71 #endif
72 72
73 /* Get two 32 bit ints from a double. */ 73 /* Get two 32 bit ints from a double. */
131 /* A union which permits us to convert between a float and a 32 bit 131 /* A union which permits us to convert between a float and a 32 bit
132 int. */ 132 int. */
133 133
134 typedef union 134 typedef union
135 { 135 {
136 float value; 136 float value;
137 u_int32_t word; 137 u_int32_t word;
138 } ieee_float_shape_type; 138 } ieee_float_shape_type;
139 139
140 /* Get a 32 bit int from a float. */ 140 /* Get a 32 bit int from a float. */
141 141
142 #define GET_FLOAT_WORD(i,d) \ 142 #define GET_FLOAT_WORD(i,d) \
159 #ifdef __STDC__ 159 #ifdef __STDC__
160 static const double 160 static const double
161 #else 161 #else
162 static double 162 static double
163 #endif 163 #endif
164 zero = 0.0, 164 zero = 0.0, one = 1.0, two = 2.0, two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */
165 one = 1.0, 165 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
166 two = 2.0, 166 twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
167 two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */ 167 huge = 1.0e+300, tiny = 1.0e-300;
168 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
169 twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
170 huge = 1.0e+300,
171 tiny = 1.0e-300;
172 168
173 #endif /* _MATH_PRIVATE_H_ */ 169 #endif /* _MATH_PRIVATE_H_ */
170 /* vi: set ts=4 sw=4 expandtab: */