partial warnings fixes

This gets the worst of the Wconversion problems, but the variational
smoother code is still almost certainly not 64-bit ready.

I'm leaving the defaultless-switch and Wshadow problems untouched for
now; this code is still too opaque to me.
More Wconversion fixes