diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-10 08:46:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-10 08:46:06 +0000 |
commit | 3a3bda73dd0e5d6803f2aecfe7415804268d9251 (patch) | |
tree | 2bc807a34bf898b83968d4925e45365797cafda9 /transcode_data.h | |
parent | 38b92f838f0c387807e5f430277af5cd7196cd71 (diff) | |
download | ruby-3a3bda73dd0e5d6803f2aecfe7415804268d9251.tar.gz |
* string.c (rb_str_tmp_new): creates hidden temporary buffer.
* transcode.c (transcoding): added a pointer to function to flush.
* transcode.c (transcode_loop): do not use string internal.
[ruby-dev:32512]
* transcode.c (str_transcode): allow Encoding objects.
* transcode_data.h (BYTE_LOOKUP): use actual struct name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r-- | transcode_data.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/transcode_data.h b/transcode_data.h index 42e0921458..f16b969da3 100644 --- a/transcode_data.h +++ b/transcode_data.h @@ -1,14 +1,13 @@ typedef unsigned char base_element; -typedef const void * const info_element; typedef struct byte_lookup { const base_element *base; - const void * const * const info; + const struct byte_lookup *const *info; } BYTE_LOOKUP; #ifdef TRANSCODE_DATA /* data file needs to treat this as a pointer, to remove warnings */ -#define PType (const void * const) +#define PType (const BYTE_LOOKUP *) #else /* in code, this is treated as just an integer */ #define PType (int) @@ -23,10 +22,10 @@ typedef struct byte_lookup { #define UNDEF (PType 0x09) /* legal but undefined */ #define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */ -#define output1(b1) ((void*)((((unsigned char)(b1))<<8)|ONEbt)) -#define output2(b1,b2) ((void*)((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt)) -#define output3(b1,b2,b3) ((void*)((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|THREEbt)) -#define output4(b0,b1,b2,b3) ((void*)((((unsigned char)(b1))<< 8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)) +#define output1(b1) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<<8)|ONEbt)) +#define output2(b1,b2) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt)) +#define output3(b1,b2,b3) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|THREEbt)) +#define output4(b0,b1,b2,b3) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<< 8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)) #define getBT1(a) (((a)>> 8)&0xFF) #define getBT2(a) (((a)>>16)&0xFF) |