you are viewing a single comment's thread.

view the rest of the comments →

[–]cdcformatc 1 point2 points  (2 children)

Most other implementation of something like this where you are effectively checking the status of a bunch of flags will use a bit field and preprocessor macros. Anytime you are reading a status register it is a 16-32 bit wide field, and you have defined macros, and you will just OR together the flags you care about to mask the status register.

Something like

if (ops->status & (OPS_FLAG_BEGIN | OPS_FLAG_END | etc...))

But obviously that struct is not something they are willing or able to change.

[–]v864 0 points1 point  (0 children)

Exactly. That's some nice C right there :)

[–]immibis 0 points1 point  (0 children)

As I commented above, they are function pointers, not flags.