Raise WARNS to 6:
- Rename local variables to avoid conflicts with globals;
- Make local functions static;
- Add missing function prototypes;
- Remove stale function prototypes and struct declarations;
- Un-nest nested extern declarations;
- Constify some char *'s where appropriate;
- Resolve comparisons between signed and unsigned;
- Copy some strings into work buffers instead of returning
a const char * from a function defined to return a char *.
Submitted-by: Sepherosa Ziehau <sepherosa_at_softhome_dot_net>
Some-tweaks-by: cpressey