Hacker News new | past | comments | ask | show | jobs | submit login

This was rather readable, more so than I've come to expect from that particular source.

Still, I must point out that using a signed 1-bit bitfield (there are lots of those in that article), is generally a bad idea. Consider for instance something like:

    struct foo6 {
      int bigfield:31;      /* 32-bit word 1 begins */
      int littlefield:1;
    };
That "littlefield" member is signed but has a size of just one bit, which means it is limited to representing the two values 0 and -1 (in two's complement). This is very seldom useful. The general rule of thumb is to always make "boolean"-type bitfields have an unsigned type, for this reason.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: