Use explicit != 0U comparisons for bitmask checks, static_cast instead of C-style casts, <cstdint>/<cstdio> instead of the C headers, and puts() instead of iprintf() for plain strings.