Skip to content

Commit 042d50e

Browse files
committedJan 9, 2025
Remove get_field_type form TIFFField structure because it is not used anymore and rename other parameter to set_get_field_type.
1 parent 673347a commit 042d50e

21 files changed

+605
-616
lines changed
 

‎libtiff/tif_dir.c

+16-15
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
748748
/*
749749
* Set custom value ... save a copy of the custom tag value.
750750
*/
751-
/*--: Rational2Double: For Rationals evaluate "set_field_type" to
752-
* determine internal storage size. */
751+
/*--: Rational2Double: For Rationals evaluate "set_get_field_type"
752+
* to determine internal storage size. */
753753
tv_size = TIFFFieldSetGetSize(fip);
754754
if (tv_size == 0)
755755
{
@@ -842,7 +842,7 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
842842
fip->field_writecount == TIFF_SPP || tv->count > 1)
843843
{
844844
/*--: Rational2Double: For Rationals tv_size is set above to
845-
* 4 or 8 according to fip->set_field_type! */
845+
* 4 or 8 according to fip->set_get_field_type! */
846846
_TIFFmemcpy(tv->value, va_arg(ap, void *),
847847
tv->count * tv_size);
848848
/* Test here for too big values for LONG8, SLONG8 in
@@ -977,7 +977,8 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
977977
case TIFF_RATIONAL:
978978
case TIFF_SRATIONAL:
979979
/*-- Rational2Double: For Rationals tv_size is set
980-
* above to 4 or 8 according to fip->set_field_type!
980+
* above to 4 or 8 according to
981+
* fip->set_get_field_type!
981982
*/
982983
{
983984
if (tv_size == 8)
@@ -995,11 +996,11 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
995996
* default. */
996997
if (tv_size != 4)
997998
{
998-
TIFFErrorExtR(
999-
tif, module,
1000-
"Rational2Double: .set_field_type "
1001-
"in not 4 but %d",
1002-
tv_size);
999+
TIFFErrorExtR(tif, module,
1000+
"Rational2Double: "
1001+
".set_get_field_type "
1002+
"in not 4 but %d",
1003+
tv_size);
10031004
}
10041005
}
10051006
}
@@ -1526,7 +1527,7 @@ static int _TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
15261527
case TIFF_SRATIONAL:
15271528
{
15281529
/*-- Rational2Double: For Rationals evaluate
1529-
* "set_field_type" to determine internal
1530+
* "set_get_field_type" to determine internal
15301531
* storage size and return value size. */
15311532
int tv_size = TIFFFieldSetGetSize(fip);
15321533
if (tv_size == 8)
@@ -1544,11 +1545,11 @@ static int _TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
15441545
* default. */
15451546
if (tv_size != 4)
15461547
{
1547-
TIFFErrorExtR(
1548-
tif, "_TIFFVGetField",
1549-
"Rational2Double: .set_field_type "
1550-
"in not 4 but %d",
1551-
tv_size);
1548+
TIFFErrorExtR(tif, "_TIFFVGetField",
1549+
"Rational2Double: "
1550+
".set_get_field_type "
1551+
"in not 4 but %d",
1552+
tv_size);
15521553
}
15531554
}
15541555
}

‎libtiff/tif_dir.h

+9-10
Original file line numberDiff line numberDiff line change
@@ -329,16 +329,15 @@ extern "C"
329329

330330
struct _TIFFField
331331
{
332-
uint32_t field_tag; /* field's tag */
333-
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
334-
short field_writecount; /* write count/TIFF_VARIABLE */
335-
TIFFDataType field_type; /* type of associated data */
336-
uint32_t
337-
field_anonymous; /* if true, this is a unknown / anonymous tag */
338-
TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField
339-
and TIFFGetField */
340-
TIFFSetGetFieldType get_field_type; /* not used */
341-
unsigned short field_bit; /* bit in fieldsset bit vector */
332+
uint32_t field_tag; /* field's tag */
333+
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
334+
short field_writecount; /* write count/TIFF_VARIABLE */
335+
TIFFDataType field_type; /* type of associated data */
336+
uint32_t field_anonymous; /* if true, this is a unknown /
337+
anonymous tag */
338+
TIFFSetGetFieldType set_get_field_type; /* type to be passed to
339+
TIFFSetField, TIFFGetField */
340+
unsigned short field_bit; /* bit in fieldsset bit vector */
342341
unsigned char field_oktochange; /* if true, can change while writing */
343342
unsigned char field_passcount; /* if true, pass dir count on set */
344343
char *field_name; /* ASCII name */

0 commit comments

Comments
 (0)
Please sign in to comment.