1
0
Fork 0

upgrade deprecated fixed-length types

This commit is contained in:
Scott Giese 2022-01-21 00:15:57 -06:00
parent 1f272e7d6f
commit c6ef571612

View file

@ -184,10 +184,10 @@ bool TGSrtmTiff::load() {
cols = rows = 6000; cols = rows = 6000;
col_step = row_step = 3; col_step = row_step = 3;
uint32 w, h, d; uint32_t w, h, d;
uint16 dataType; uint16_t dataType;
uint16 samplesperpixel; uint16_t samplesperpixel;
uint16 bitspersample; uint16_t bitspersample;
TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &w ); TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &w );
TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &h ); TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &h );
@ -198,12 +198,12 @@ bool TGSrtmTiff::load() {
tdata_t buf = _TIFFmalloc( TIFFScanlineSize( tif ) ); tdata_t buf = _TIFFmalloc( TIFFScanlineSize( tif ) );
if ( lkind == LoadKind::BottomLeft ) { if ( lkind == LoadKind::BottomLeft ) {
uint32 row = 0; uint32_t row = 0;
for ( ; row < h; row++ ) { for ( ; row < h; row++ ) {
TIFFReadScanline( tif, buf, row ); TIFFReadScanline( tif, buf, row );
uint32 col = 0; uint32_t col = 0;
for ( ; col < w; col++ ) { for ( ; col < w; col++ ) {
int16 v = ((int16*)buf)[col]; int16_t v = ((int16_t*)buf)[col];
if ( v == -32768 ) if ( v == -32768 )
v = 0; v = 0;
data[col][6000-1-row] = v; data[col][6000-1-row] = v;
@ -213,7 +213,7 @@ bool TGSrtmTiff::load() {
} }
} }
for ( ; row < 6000; row++ ) { for ( ; row < 6000; row++ ) {
uint32 col = 0; uint32_t col = 0;
for ( ; col < 6000; col++ ) { for ( ; col < 6000; col++ ) {
data[col][6000-1-row] = 0; data[col][6000-1-row] = 0;
} }
@ -282,9 +282,9 @@ bool TGSrtmTiff::load() {
} }
} else if ( lkind == LoadKind::TopLeft ) { } else if ( lkind == LoadKind::TopLeft ) {
TIFFReadScanline( tif, buf, 0 ); TIFFReadScanline( tif, buf, 0 );
uint32 col = 0; uint32_t col = 0;
for ( ; col < w; col++ ) { for ( ; col < w; col++ ) {
int16 v = ((int16*)buf)[col]; int16_t v = ((int16_t*)buf)[col];
if ( v == -32768 ) if ( v == -32768 )
v = 0; v = 0;
data[col][0] = v; data[col][0] = v;
@ -293,10 +293,10 @@ bool TGSrtmTiff::load() {
data[col][0] = 0; data[col][0] = 0;
} }
} else if ( lkind == LoadKind::BottomRight ) { } else if ( lkind == LoadKind::BottomRight ) {
uint32 row = 0; uint32_t row = 0;
for ( ; row < h; row++ ) { for ( ; row < h; row++ ) {
TIFFReadScanline( tif, buf, row ); TIFFReadScanline( tif, buf, row );
int16 v = ((int16*)buf)[0]; int16_t v = ((int16_t*)buf)[0];
if ( v == -32768 ) if ( v == -32768 )
v = 0; v = 0;
data[0][6000-1-row] = v; data[0][6000-1-row] = v;
@ -307,7 +307,7 @@ bool TGSrtmTiff::load() {
} else /* if ( lkind == LoadKind::TopRight ) */ { } else /* if ( lkind == LoadKind::TopRight ) */ {
if ( h == 6000 ) { if ( h == 6000 ) {
TIFFReadScanline( tif, buf, h-1 ); TIFFReadScanline( tif, buf, h-1 );
int16 v = ((int16*)buf)[0]; int16_t v = ((int16_t*)buf)[0];
if ( v == -32768 ) if ( v == -32768 )
v = 0; v = 0;
data[0][0] = v; data[0][0] = v;