Changeset 14717

Show
Ignore:
Timestamp:
06/17/08 15:41:20 (6 months ago)
Author:
rouault
Message:

Use CPLPrintPointer instead of ugly #ifdef (pasted from USGSDEMLoadRaster)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/alg/gdalcutline.cpp

    r14713 r14717  
    259259    GByte *pabyPolyMask = (GByte *) CPLCalloc( nXSize, nYSize ); 
    260260    GDALDatasetH hMemDS; 
    261     CPLString osDPOption; 
    262     char *apszOptions[2] = { NULL, NULL }; 
    263261    double adfGeoTransform[6] = { 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 }; 
    264262 
    265 #if defined(WIN32) && defined(_MSC_VER) 
    266     osDPOption.Printf( "DATAPOINTER=0x%p", pabyPolyMask ); 
    267 #else 
    268     osDPOption.Printf( "DATAPOINTER=%p", pabyPolyMask ); 
    269 #endif 
    270     apszOptions[0] = (char *) osDPOption.c_str(); 
     263    char szDataPointer[100]; 
     264    char *apszOptions[] = { szDataPointer, NULL }; 
     265 
     266    memset( szDataPointer, 0, sizeof(szDataPointer) ); 
     267    sprintf( szDataPointer, "DATAPOINTER=" ); 
     268    CPLPrintPointer( szDataPointer+strlen(szDataPointer),  
     269                    pabyPolyMask,  
     270                     sizeof(szDataPointer) - strlen(szDataPointer) ); 
    271271 
    272272    hMemDS = GDALCreate( hMemDriver, "warp_temp",