build: Enable -Wfloat-conversion and fix warnings
See the commit messages for details.
Most of the commits are to fix false positive warnings. The first commit fixes a true positive bug which the warning found (includes a unit test).
Signed-off-by: Philip Withnall pwithnall@gnome.org
Helps: #3405