Fix some compiler warnings from llvm 5.1 (#5414).  Forward port of these commits to 1.11.1: r27703 r27704 r27705 r27706 r27707 r27708 r27709 r27710 r27711 r27712 r27717 r27718 r27720

git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@27721 f0d54148-0727-0410-94bb-9a71ac55c965