diff options
author | Adam Goode <adam@spicenitz.org> | 2020-03-08 00:54:36 +0100 |
---|---|---|
committer | Thomas Bernard <miniupnp@free.fr> | 2020-03-08 00:54:36 +0100 |
commit | d6827861cbb4b5e2ca5c262a620206954191db1d (patch) | |
tree | 0a6e996207f01fe0d343d3dfc7e0f176696cbd8c /libtiff/tif_aux.c | |
parent | 63c666344fe6b8e28e27f69b5b0fd156ded40b14 (diff) | |
download | libtiff-git-d6827861cbb4b5e2ca5c262a620206954191db1d.tar.gz |
Make the default whitepoint and ycbcrcoeffs arrays const
Now that we are returning const pointers in TIFFGetFieldDefaulted,
we can now make these static default arrays const.
see #11
Diffstat (limited to 'libtiff/tif_aux.c')
-rw-r--r-- | libtiff/tif_aux.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libtiff/tif_aux.c b/libtiff/tif_aux.c index bfe9d5ae..c9f19054 100644 --- a/libtiff/tif_aux.c +++ b/libtiff/tif_aux.c @@ -292,7 +292,7 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap) case TIFFTAG_YCBCRCOEFFICIENTS: { /* defaults are from CCIR Recommendation 601-1 */ - static float ycbcrcoeffs[] = { 0.299f, 0.587f, 0.114f }; + static const float ycbcrcoeffs[] = { 0.299f, 0.587f, 0.114f }; *va_arg(ap, const float **) = ycbcrcoeffs; return 1; } @@ -305,12 +305,13 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap) return (1); case TIFFTAG_WHITEPOINT: { - static float whitepoint[2]; /* TIFF 6.0 specification tells that it is no default value for the WhitePoint, but AdobePhotoshop TIFF Technical Note tells that it should be CIE D50. */ - whitepoint[0] = D50_X0 / (D50_X0 + D50_Y0 + D50_Z0); - whitepoint[1] = D50_Y0 / (D50_X0 + D50_Y0 + D50_Z0); + static const float whitepoint[] = { + D50_X0 / (D50_X0 + D50_Y0 + D50_Z0), + D50_Y0 / (D50_X0 + D50_Y0 + D50_Z0) + }; *va_arg(ap, const float **) = whitepoint; return 1; } |