diff options
Diffstat (limited to 'transcode.c')
-rw-r--r-- | transcode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/transcode.c b/transcode.c index 1997e310c3..850ba0f251 100644 --- a/transcode.c +++ b/transcode.c @@ -71,6 +71,7 @@ typedef struct rb_transcoding { union rb_transcoding_state_t { /* opaque data for stateful encoding */ void *ptr; + char ary[sizeof(double) > sizeof(void*) ? sizeof(double) : sizeof(void*)]; double dummy_for_alignment; } state; } rb_transcoding; @@ -89,7 +90,7 @@ typedef struct rb_transcoding { #define TRANSCODING_STATE_EMBED_MAX sizeof(union rb_transcoding_state_t) #define TRANSCODING_STATE(tc) \ ((tc)->transcoder->state_size <= sizeof((tc)->state) ? \ - (void *)&(tc)->state : \ + (tc)->state.ary : \ (tc)->state.ptr) typedef struct { @@ -424,7 +425,6 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos, const unsigned char *in_stop, unsigned char *out_stop, rb_transcoding *tc, const int opt) - { const rb_transcoder *tr = tc->transcoder; int unitlen = tr->input_unit_length; |