Fix a bunch of minor portability problems and maybe-bugs revealed by
Tom Lane <tgl@sss.pgh.pa.us>
Fix a bunch of minor portability problems and maybe-bugs revealed by running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...