My only style comment here would be to replace this with some kind of named constant so it's clear why we're AND'ing with this variable.

If all of the callers have been implemented in C, could actually replace this with a different constant that makes sense for the C convention.