Include float.h for DBL_MAX
Fix unused var when not using GDAL
Fix gcc compile error - for some reason it wasn't casting properly when it was an argument