summaryrefslogtreecommitdiff
path: root/transcode_data.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 16:22:49 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 16:22:49 (GMT)
commit752e053a1df0446b6ca20815b1976dd322d736bd (patch)
tree7ece75f0de59fd63b1263145479927001796a1c3 /transcode_data.h
parent2ae7b0328e9bf0caf16411eabc924effedccfb5c (diff)
* transcode_data.h (BYTE_LOOKUP): change to uintptr_t array.
(BYTE_LOOKUP_BASE): follow the type change. (BYTE_LOOKUP_INFO): ditto. (PType): ditto. (rb_transcoding): ditto. * tool/transcode-tblgen.rb: follow the type change. * transcode.c: ditto. * enc/trans/newline.trans: ditto. * enc/trans/iso2022.trans: ditto. * enc/trans/utf_16_32.trans: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r--transcode_data.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/transcode_data.h b/transcode_data.h
index b705760..8287cf6 100644
--- a/transcode_data.h
+++ b/transcode_data.h
@@ -16,17 +16,14 @@
typedef unsigned char base_element;
-typedef struct byte_lookup {
- const base_element *base;
- const struct byte_lookup *const *info;
-} BYTE_LOOKUP;
+typedef uintptr_t BYTE_LOOKUP[2];
-#define BYTE_LOOKUP_BASE(bl) ((bl)->base)
-#define BYTE_LOOKUP_INFO(bl) ((bl)->info)
+#define BYTE_LOOKUP_BASE(bl) ((const base_element *)(((uintptr_t *)(bl))[0]))
+#define BYTE_LOOKUP_INFO(bl) ((const struct byte_lookup *const *)(((uintptr_t *)(bl))[1]))
#ifndef PType
/* data file needs to treat this as a pointer, to remove warnings */
-#define PType (const BYTE_LOOKUP *)
+#define PType (uintptr_t)
#endif
#define NOMAP (PType 0x01) /* single byte direct map */
@@ -76,7 +73,7 @@ typedef struct rb_transcoding {
int flags;
int resume_position;
- const BYTE_LOOKUP *next_table;
+ uintptr_t next_table;
VALUE next_info;
unsigned char next_byte;
@@ -109,7 +106,7 @@ typedef struct rb_transcoding {
struct rb_transcoder {
const char *from_encoding;
const char *to_encoding;
- const BYTE_LOOKUP *conv_tree_start;
+ uintptr_t conv_tree_start;
int input_unit_length;
int max_input;
int max_output;