14 Dec
2005
14 Dec
'05
9:54 p.m.
On Wed, 14 Dec 2005, Timo Sirainen wrote:
On Wed, 2005-12-14 at 17:42 +0100, Vaclav Haisman wrote: [...] the the following:
- unsigned char mode:3; -> enum io_condition in the struct. More readable and it doesn't use more space anyway unless you're going to add more fields. Actually I think that the bitfield might be necessary. I used it because I didn't want to mask out the uninteresting bits of condition flags on lines like
ctx->fds[fd].mode |= condition;
Without either the bitfield or some masking it is possible that this will set some higher bits on. If it happens then the parts of code that compare the mode against zero will break.
Is it not possible for some higher bit to be set? Can the code stay as it is?
[...]
Vaclav Haisman