fixing bitfield misuse

version0.2
Joe Damato 16 years ago committed by Ryan
parent 0e34695b94
commit 431707b5b1

@ -70,8 +70,25 @@ struct http_parser {
enum http_parser_type type; enum http_parser_type type;
size_t chunk_size; size_t chunk_size;
unsigned eating:1;
unsigned error:1; /**
XXX
do this so no other code has to change, but make the field only 1 byte wide
instead of 2 (on x86/x86_64).
doing this not only shrinks the sizeof this struct by a byte but it ALSO
makes wrapping this in FFI way easier.
*/
union {
struct {
unsigned eating:1;
unsigned error:1;
};
struct {
unsigned char _flags;
};
};
size_t body_read; size_t body_read;
const char *header_field_mark; const char *header_field_mark;

Loading…
Cancel
Save