refs.c: change some "flags" to "unsigned int"