> int parse_integer(const char *s, unsigned int base, T *val);> I suspect splitting this into parse_signed_intand parse_unsigned_int(or some other equivalent names)will make the call-sites a lot easier to read.