On Wed, 20 Dec 2006, Junio C Hamano wrote:
I needed to fix the changes to git-compat-util.h a bit from the
version I sent earlier to make OpenBSD happy (sys/types.h there
did not expose u_int unless _BSD_SOURCE was set, and
netinet/in.h was duplicated by mistake).
Please don't use "u_int" in the first place. It's an abomination of a
type. It should never be used.
There's simply no point. It's "unsigned int", and that doesn't need any
header files at all.
I don't understand why people are lazy, and can't write "unsigned", but
then introduce a type that requires you to have all kinds of magic. The
lazyness just results in more work, and is totally nonportable.
So "u_int" (along with its idiotic brethren "u_long", "u_short" and
"u_char") is just silly.
The only user in git seems to have been copied from a source that is
insane. It does
u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
which is just insane. It actually seems to want to use "uint16_t", which
at least would make sense, and be a type that has some _point_ to it.
So please change the "u_int" to either "unsigned int" or "uint16_t".
Either is better.