diff options
-rw-r--r-- | libtiff/tif_dir.c | 2 | ||||
-rw-r--r-- | libtiff/tif_dir.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c index c3a7a418..85006218 100644 --- a/libtiff/tif_dir.c +++ b/libtiff/tif_dir.c @@ -1621,7 +1621,7 @@ void TIFFFreeDirectory(TIFF *tif) TIFFDirectory *td = &tif->tif_dir; int i; - _TIFFmemset(td->td_fieldsset, 0, FIELD_SETLONGS); + _TIFFmemset(td->td_fieldsset, 0, sizeof(td->td_fieldsset)); CleanupField(td_sminsamplevalue); CleanupField(td_smaxsamplevalue); CleanupField(td_colormap[0]); diff --git a/libtiff/tif_dir.h b/libtiff/tif_dir.h index 53473fb3..9eaf22f8 100644 --- a/libtiff/tif_dir.h +++ b/libtiff/tif_dir.h @@ -70,9 +70,9 @@ typedef struct */ typedef struct { -#define FIELD_SETLONGS 4 +#define FIELDSET_ITEMS 4 /* bit vector of fields that are set */ - unsigned long td_fieldsset[FIELD_SETLONGS]; + uint32_t td_fieldsset[FIELDSET_ITEMS]; uint32_t td_imagewidth, td_imagelength, td_imagedepth; uint32_t td_tilewidth, td_tilelength, td_tiledepth; @@ -202,9 +202,9 @@ typedef struct */ #define FIELD_PSEUDO 0 -#define FIELD_LAST (32 * FIELD_SETLONGS - 1) +#define FIELD_LAST (32 * FIELDSET_ITEMS - 1) -#define BITn(n) (((unsigned long)1L) << ((n)&0x1f)) +#define BITn(n) (((uint32_t)1L) << ((n)&0x1f)) #define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32]) #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field)) #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field)) |