Changeset 13704

Show
Ignore:
Timestamp:
02/06/08 06:56:39 (5 months ago)
Author:
dron
Message:

Fixes to compile with GCC 2.95.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/frmts/srtmhgt/srtmhgtdataset.cpp

    r13687 r13704  
    3131 ****************************************************************************/ 
    3232 
    33 #include <stdio.h> 
    34 #include <stdlib.h> 
    35 #include <string.h> 
    3633#include "gdal_pam.h" 
    3734#include "cpl_port.h" 
     
    4239 
    4340CPL_CVSID("$Id: srtmhgtdataset.cpp $"); 
     41 
    4442CPL_C_START 
    4543void    GDALRegister_SRTMHGT(void); 
     
    8785    friend class SRTMHGTDataset; 
    8886 
    89     int        bNoDataSet; 
     87    int                bNoDataSet; 
    9088    double      dfNoDataValue; 
    9189 
     
    122120/************************************************************************/ 
    123121 
    124 CPLErr SRTMHGTRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, void* pImage) 
     122CPLErr SRTMHGTRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, 
     123                                     void* pImage) 
    125124{ 
    126125  SRTMHGTDataset* poGDS = (SRTMHGTDataset*) poDS; 
     
    129128  if(nBlockXOff != 0) 
    130129  { 
    131       CPLError(CE_Failure, CPLE_NotSupported, "unhandled nBlockXOff value : %d", nBlockXOff); 
     130      CPLError(CE_Failure, CPLE_NotSupported, 
     131               "unhandled nBlockXOff value : %d", nBlockXOff); 
    132132      return CE_Failure; 
    133133  } 
     
    137137 
    138138/* -------------------------------------------------------------------- */ 
    139 /*      Load the desired data into the working buffer.              */ 
     139/*      Load the desired data into the working buffer.                  */ 
    140140/* -------------------------------------------------------------------- */ 
    141141  VSIFSeekL(poGDS->fpImage, nBlockYOff*nBlockXSize*2, SEEK_SET); 
     
    270270 
    271271/* -------------------------------------------------------------------- */ 
    272 /*      We check the file size to see if it is 25,934,402 bytes */ 
     272/*      We check the file size to see if it is 25,934,402 bytes         */ 
    273273/*      (SRTM 1) or 2,884,802 bytes (SRTM 3)                            */     
    274274/* -------------------------------------------------------------------- */ 
    275275  VSIStatBufL fileStat; 
     276 
    276277  if(VSIStatL(poOpenInfo->pszFilename, &fileStat) != 0) 
    277278      return FALSE; 
     
    461462/* -------------------------------------------------------------------- */ 
    462463    char expectedFileName[12]; 
    463     sprintf(expectedFileName, "%c%02d%c%03d.HGT", 
    464             (nLLOriginLat >= 0) ? 'N' : 'S', (nLLOriginLat >= 0) ? nLLOriginLat : -nLLOriginLat, 
    465             (nLLOriginLong >= 0) ? 'E' : 'W', (nLLOriginLong >= 0) ? nLLOriginLong : -nLLOriginLong); 
     464    snprintf(expectedFileName, sizeof(expectedFileName), "%c%02d%c%03d.HGT", 
     465             (nLLOriginLat >= 0) ? 'N' : 'S', 
     466             (nLLOriginLat >= 0) ? nLLOriginLat : -nLLOriginLat, 
     467             (nLLOriginLong >= 0) ? 'E' : 'W', 
     468             (nLLOriginLong >= 0) ? nLLOriginLong : -nLLOriginLong); 
    466469    if (!EQUAL(expectedFileName, CPLGetFilename(pszFilename))) 
    467470    {