| 1 |
Forwarded: https://github.com/festvox/flite/pull/48 |
| 2 |
commited |
| 3 |
|
| 4 |
--- |
| 5 |
include/cst_val.h | 11 +++++++++-- |
| 6 |
include/cst_val_const.h | 27 ++++++++++++++++++++++----- |
| 7 |
src/wavesynth/cst_units.c | 2 +- |
| 8 |
3 files changed, 32 insertions(+), 8 deletions(-) |
| 9 |
|
| 10 |
--- a/include/cst_val.h |
| 11 |
+++ b/include/cst_val.h |
| 12 |
@@ -46,6 +46,8 @@ |
| 13 |
#include "cst_alloc.h" |
| 14 |
#include "cst_val_defs.h" |
| 15 |
|
| 16 |
+#include <stdint.h> |
| 17 |
+ |
| 18 |
/* Only CONS can be an even number */ |
| 19 |
#define CST_VAL_TYPE_CONS 0 |
| 20 |
#define CST_VAL_TYPE_INT 1 |
| 21 |
@@ -61,10 +63,15 @@ typedef struct cst_val_cons_struct { |
| 22 |
|
| 23 |
typedef struct cst_val_atom_struct { |
| 24 |
#ifdef WORDS_BIGENDIAN |
| 25 |
+#if UINTPTR_MAX > 0xfffffffful |
| 26 |
+ int ref_count; |
| 27 |
+ int type; /* order is here important */ |
| 28 |
+#else |
| 29 |
short ref_count; |
| 30 |
short type; /* order is here important */ |
| 31 |
+#endif |
| 32 |
#else |
| 33 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 34 |
+#if UINTPTR_MAX > 0xfffffffful |
| 35 |
int type; /* order is here important */ |
| 36 |
int ref_count; |
| 37 |
#else |
| 38 |
@@ -74,7 +81,7 @@ typedef struct cst_val_atom_struct { |
| 39 |
#endif |
| 40 |
union |
| 41 |
{ |
| 42 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 43 |
+#if UINTPTR_MAX > 0xfffffffful |
| 44 |
double fval; |
| 45 |
long long ival; |
| 46 |
void *vval; |
| 47 |
--- a/include/cst_val_const.h |
| 48 |
+++ b/include/cst_val_const.h |
| 49 |
@@ -111,6 +111,8 @@ |
| 50 |
|
| 51 |
#include "cst_val_defs.h" |
| 52 |
|
| 53 |
+#include <stdint.h> |
| 54 |
+ |
| 55 |
/* There is built-in int to string conversions here for numbers */ |
| 56 |
/* up to 20, note if you make this bigger you have to hand change */ |
| 57 |
/* other things too */ |
| 58 |
@@ -191,10 +193,15 @@ extern const cst_val val_string_24; |
| 59 |
/* unquestionably doing the wrong thing */ |
| 60 |
typedef struct cst_val_atom_struct_float { |
| 61 |
#ifdef WORDS_BIGENDIAN |
| 62 |
+#if UINTPTR_MAX > 0xfffffffful |
| 63 |
+ int ref_count; |
| 64 |
+ int type; /* order is here important */ |
| 65 |
+#else |
| 66 |
short ref_count; |
| 67 |
short type; /* order is here important */ |
| 68 |
+#endif |
| 69 |
#else |
| 70 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 71 |
+#if UINTPTR_MAX > 0xfffffffful |
| 72 |
int type; /* order is here important */ |
| 73 |
int ref_count; |
| 74 |
#else |
| 75 |
@@ -202,7 +209,7 @@ typedef struct cst_val_atom_struct_float |
| 76 |
short ref_count; |
| 77 |
#endif |
| 78 |
#endif |
| 79 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 80 |
+#if UINTPTR_MAX > 0xfffffffful |
| 81 |
double fval; |
| 82 |
#else |
| 83 |
float fval; |
| 84 |
@@ -211,10 +218,15 @@ typedef struct cst_val_atom_struct_float |
| 85 |
|
| 86 |
typedef struct cst_val_atom_struct_int { |
| 87 |
#ifdef WORDS_BIGENDIAN |
| 88 |
+#if UINTPTR_MAX > 0xfffffffful |
| 89 |
+ int ref_count; |
| 90 |
+ int type; /* order is here important (and unintuitive) */ |
| 91 |
+#else |
| 92 |
short ref_count; |
| 93 |
short type; /* order is here important (and unintuitive) */ |
| 94 |
+#endif |
| 95 |
#else |
| 96 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 97 |
+#if UINTPTR_MAX > 0xfffffffful |
| 98 |
int type; /* order is here important */ |
| 99 |
int ref_count; |
| 100 |
#else |
| 101 |
@@ -222,7 +234,7 @@ typedef struct cst_val_atom_struct_int { |
| 102 |
short ref_count; |
| 103 |
#endif |
| 104 |
#endif |
| 105 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 106 |
+#if UINTPTR_MAX > 0xfffffffful |
| 107 |
long long ival; |
| 108 |
#else |
| 109 |
int ival; |
| 110 |
@@ -231,10 +243,15 @@ typedef struct cst_val_atom_struct_int { |
| 111 |
|
| 112 |
typedef struct cst_val_atom_struct_void { |
| 113 |
#ifdef WORDS_BIGENDIAN |
| 114 |
+#if UINTPTR_MAX > 0xfffffffful |
| 115 |
+ int ref_count; |
| 116 |
+ int type; /* order is here important */ |
| 117 |
+#else |
| 118 |
short ref_count; |
| 119 |
short type; /* order is here important */ |
| 120 |
+#endif |
| 121 |
#else |
| 122 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 123 |
+#if UINTPTR_MAX > 0xfffffffful |
| 124 |
int type; /* order is here important */ |
| 125 |
int ref_count; |
| 126 |
#else |
| 127 |
--- a/src/wavesynth/cst_units.c |
| 128 |
+++ b/src/wavesynth/cst_units.c |
| 129 |
@@ -590,7 +590,7 @@ void add_residual_pulse(int targ_size, u |
| 130 |
int unit_size, const unsigned char *unit_residual) |
| 131 |
{ |
| 132 |
int i,m; |
| 133 |
-#if (defined(__x86_64__) || defined(_M_X64)) |
| 134 |
+#if UINTPTR_MAX > 0xfffffffful |
| 135 |
long long p; |
| 136 |
/* Unit residual isn't a pointer its a number, the power for the |
| 137 |
the sts, yes this is hackily casting the address to a number */ |