More compiler warnings addressed (#5414).  Mostly the same as was in the 1.11 branch with r27741 r27739 r27729 r27723

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