Skip to content

Commit 1192d87

Browse files
committed
remove old libtiff numeric defines
use the glib ones instead rather than depending on stdint etc.
1 parent 33cca3e commit 1192d87

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

doc/libvips.actions

Whitespace-only changes.

libvips/foreign/tiff2vips.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ static int rtiff_we_decompress[] = {
279279
* out as a separate thing.
280280
*/
281281
typedef struct _RtiffHeader {
282-
uint32 width;
283-
uint32 height;
282+
guint32 width;
283+
guint32 height;
284284
int samples_per_pixel;
285285
int bits_per_sample;
286286
int photometric_interpretation;
@@ -293,22 +293,22 @@ typedef struct _RtiffHeader {
293293
* unpremultiply with. -1 for no unpremultiplication.
294294
*/
295295
int alpha_band;
296-
uint16 compression;
296+
guint16 compression;
297297

298298
/* Is this directory tiled.
299299
*/
300300
gboolean tiled;
301301

302302
/* Fields for tiled images, as returned by libtiff.
303303
*/
304-
uint32 tile_width;
305-
uint32 tile_height;
304+
guint32 tile_width;
305+
guint32 tile_height;
306306
tsize_t tile_size;
307307
tsize_t tile_row_size;
308308

309309
/* Fields for strip images, as returned by libtiff.
310310
*/
311-
uint32 rows_per_strip;
311+
guint32 rows_per_strip;
312312
tsize_t strip_size;
313313
tsize_t scanline_size;
314314
int number_of_strips;
@@ -322,7 +322,7 @@ typedef struct _RtiffHeader {
322322
* or 1) and size of the buffer we read to (a scanline, or a strip in
323323
* size).
324324
*/
325-
uint32 read_height;
325+
guint32 read_height;
326326
tsize_t read_size;
327327

328328
/* Scale factor to get absolute cd/m2 from XYZ.
@@ -413,20 +413,20 @@ typedef struct _Rtiff {
413413
static int
414414
tfexists( TIFF *tif, ttag_t tag )
415415
{
416-
uint32 a, b;
416+
guint32 a, b;
417417

418418
if( TIFFGetField( tif, tag, &a, &b ) )
419419
return( 1 );
420420
else
421421
return( 0 );
422422
}
423423

424-
/* Get a uint32 field.
424+
/* Get a guint32 field.
425425
*/
426426
static int
427-
tfget32( TIFF *tif, ttag_t tag, uint32 *out )
427+
tfget32( TIFF *tif, ttag_t tag, guint32 *out )
428428
{
429-
uint32 fld;
429+
guint32 fld;
430430

431431
if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) {
432432
vips_error( "tiff2vips",
@@ -439,12 +439,12 @@ tfget32( TIFF *tif, ttag_t tag, uint32 *out )
439439
return( 1 );
440440
}
441441

442-
/* Get a uint16 field.
442+
/* Get a guint16 field.
443443
*/
444444
static int
445445
tfget16( TIFF *tif, ttag_t tag, int *out )
446446
{
447-
uint16 fld;
447+
guint16 fld;
448448

449449
if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) {
450450
vips_error( "tiff2vips",
@@ -512,7 +512,7 @@ static int
512512
get_sample_format( TIFF *tiff )
513513
{
514514
int sample_format;
515-
uint16 v;
515+
guint16 v;
516516

517517
sample_format = SAMPLEFORMAT_INT;
518518

@@ -532,7 +532,7 @@ static int
532532
get_orientation( TIFF *tiff )
533533
{
534534
int orientation;
535-
uint16 v;
535+
guint16 v;
536536

537537
orientation = ORIENTATION_TOPLEFT;
538538

@@ -686,7 +686,7 @@ rtiff_set_page( Rtiff *rtiff, int page )
686686
}
687687

688688
if( rtiff->subifd >= 0 ) {
689-
uint16 subifd_count;
689+
guint16 subifd_count;
690690
toff_t *subifd_offsets;
691691

692692
if( !TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD,
@@ -1224,7 +1224,7 @@ rtiff_greyscale_line( Rtiff *rtiff,
12241224

12251225
switch( format ) {
12261226
case VIPS_FORMAT_CHAR:
1227-
GREY_LOOP( guchar, 0 );
1227+
GREY_LOOP( gchar, 0 );
12281228
break;
12291229

12301230
case VIPS_FORMAT_UCHAR:
@@ -1646,7 +1646,7 @@ rtiff_pick_reader( Rtiff *rtiff )
16461646
static int
16471647
rtiff_set_header( Rtiff *rtiff, VipsImage *out )
16481648
{
1649-
uint32 data_length;
1649+
guint32 data_length;
16501650
void *data;
16511651

16521652
rtiff_set_decode_format( rtiff );
@@ -2437,9 +2437,9 @@ static int
24372437
rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
24382438
{
24392439
int i;
2440-
uint16 extra_samples_count;
2441-
uint16 *extra_samples_types;
2442-
uint16 subifd_count;
2440+
guint16 extra_samples_count;
2441+
guint16 *extra_samples_types;
2442+
guint16 subifd_count;
24432443
toff_t *subifd_offsets;
24442444
char *image_description;
24452445

@@ -2489,7 +2489,7 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
24892489
*
24902490
* tiffcp fails for images like this too.
24912491
*/
2492-
uint16 hsub, vsub;
2492+
guint16 hsub, vsub;
24932493

24942494
TIFFGetFieldDefaulted( rtiff->tiff,
24952495
TIFFTAG_YCBCRSUBSAMPLING, &hsub, &vsub );
@@ -2548,7 +2548,7 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
25482548
header->separate = TRUE;
25492549
}
25502550

2551-
/* TIFFGetField needs a uint16 to write count to.
2551+
/* TIFFGetField needs a guint16 to write count to.
25522552
*/
25532553
if( TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD,
25542554
&subifd_count, &subifd_offsets ) )

libvips/foreign/vips2tiff.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer )
810810
alpha_bands = VIPS_CLIP( 0,
811811
wtiff->ready->Bands - colour_bands, MAX_ALPHA );
812812
if( alpha_bands > 0 ) {
813-
uint16 v[MAX_ALPHA];
813+
guint16 v[MAX_ALPHA];
814814
int i;
815815

816816
/* EXTRASAMPLE_UNASSALPHA means generic extra
@@ -1984,11 +1984,11 @@ wtiff_copy_tiles( Wtiff *wtiff, TIFF *out, TIFF *in )
19841984
static int
19851985
wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in )
19861986
{
1987-
uint32 ui32;
1988-
uint16 ui16;
1989-
uint16 ui16_2;
1987+
guint32 ui32;
1988+
guint16 ui16;
1989+
guint16 ui16_2;
19901990
float f;
1991-
uint16 *a;
1991+
guint16 *a;
19921992

19931993
/* All the fields we might have set.
19941994
*/

0 commit comments

Comments
 (0)