Skip to content

Commit

Permalink
TIFF: make the tag_name name member a const pointer
Browse files Browse the repository at this point in the history
We store string literal pointers in these.
  • Loading branch information
tonycoz committed Nov 15, 2023
1 parent 046f70d commit 8594c74
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions TIFF/imtiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ Some of these functions are internal.
#define Sample16To8(num) ((num) / 257)

struct tag_name {
char *name;
const char *name;
tf_uint32 tag;
};

static i_img *read_one_rgb_tiled(TIFF *tif, i_img_dim width, i_img_dim height, int allow_incomplete);
static i_img *read_one_rgb_lines(TIFF *tif, i_img_dim width, i_img_dim height, int allow_incomplete);

static struct tag_name text_tag_names[] =
static const struct tag_name
text_tag_names[] =
{
{ "tiff_documentname", TIFFTAG_DOCUMENTNAME, },
{ "tiff_imagedescription", TIFFTAG_IMAGEDESCRIPTION, },
Expand All @@ -71,7 +72,7 @@ static struct tag_name text_tag_names[] =
{ "tiff_hostcomputer", TIFFTAG_HOSTCOMPUTER, },
};

static struct tag_name
static const struct tag_name
compress_values[] =
{
{ "none", COMPRESSION_NONE },
Expand All @@ -92,7 +93,7 @@ compress_values[] =
static const int compress_value_count =
sizeof(compress_values) / sizeof(*compress_values);

static struct tag_name
static const struct tag_name
sample_format_values[] =
{
{ "uint", SAMPLEFORMAT_UINT },
Expand Down

0 comments on commit 8594c74

Please sign in to comment.