NetBSD downstream patches.

  const fixes.

  -Wconversion fixes for the skeleton files.

  param namespace protection (add _ to inline function parameters).

  unused variable/code removal.

  rename warn to lwarn to avoid conflict with <err.h>.

  ctype.h function argument correction.

  merged the error functions lerrif and lerrsf -> lerr.