| Lei Zhang | b71d24c | 2018-04-13 20:38:37 +0000 | [diff] [blame] | 1 | diff --git a/third_party/lcms/src/cmsalpha.c b/third_party/lcms/src/cmsalpha.c |
| 2 | index 7d6aa345f..566f5fe9b 100644 |
| 3 | --- a/third_party/lcms/src/cmsalpha.c |
| 4 | +++ b/third_party/lcms/src/cmsalpha.c |
| 5 | @@ -252,7 +252,7 @@ int FormatterPos(cmsUInt32Number frm) |
| 6 | static |
| 7 | cmsFormatterAlphaFn _cmsGetFormatterAlpha(cmsContext id, cmsUInt32Number in, cmsUInt32Number out) |
| 8 | { |
| 9 | -static cmsFormatterAlphaFn FormattersAlpha[5][5] = { |
| 10 | +static const cmsFormatterAlphaFn FormattersAlpha[5][5] = { |
| 11 | |
| 12 | /* from 8 */ { copy8, from8to16, from8toHLF, from8toFLT, from8toDBL }, |
| 13 | /* from 16*/ { from16to8, copy16, from16toHLF, from16toFLT, from16toDBL }, |
| 14 | diff --git a/third_party/lcms/src/cmsgamma.c b/third_party/lcms/src/cmsgamma.c |
| 15 | index 6e36cf462..eadbed852 100644 |
| 16 | --- a/third_party/lcms/src/cmsgamma.c |
| 17 | +++ b/third_party/lcms/src/cmsgamma.c |
| 18 | @@ -57,7 +57,7 @@ typedef struct _cmsParametricCurvesCollection_st { |
| 19 | static cmsFloat64Number DefaultEvalParametricFn(cmsInt32Number Type, const cmsFloat64Number Params[], cmsFloat64Number R); |
| 20 | |
| 21 | // The built-in list |
| 22 | -static _cmsParametricCurvesCollection DefaultCurves = { |
| 23 | +static const _cmsParametricCurvesCollection DefaultCurves = { |
| 24 | 9, // # of curve types |
| 25 | { 1, 2, 3, 4, 5, 6, 7, 8, 108 }, // Parametric curve ID |
| 26 | { 1, 3, 4, 5, 7, 4, 5, 5, 1 }, // Parameters by type |
| 27 | @@ -161,7 +161,7 @@ cmsBool _cmsRegisterParametricCurvesPlugin(cmsContext ContextID, cmsPluginBase* |
| 28 | |
| 29 | // Search in type list, return position or -1 if not found |
| 30 | static |
| 31 | -int IsInSet(int Type, _cmsParametricCurvesCollection* c) |
| 32 | +int IsInSet(int Type, const _cmsParametricCurvesCollection* c) |
| 33 | { |
| 34 | int i; |
| 35 | |
| 36 | @@ -174,9 +174,9 @@ int IsInSet(int Type, _cmsParametricCurvesCollection* c) |
| 37 | |
| 38 | // Search for the collection which contains a specific type |
| 39 | static |
| 40 | -_cmsParametricCurvesCollection *GetParametricCurveByType(cmsContext ContextID, int Type, int* index) |
| 41 | +const _cmsParametricCurvesCollection *GetParametricCurveByType(cmsContext ContextID, int Type, int* index) |
| 42 | { |
| 43 | - _cmsParametricCurvesCollection* c; |
| 44 | + const _cmsParametricCurvesCollection* c; |
| 45 | int Position; |
| 46 | _cmsCurvesPluginChunkType* ctx = ( _cmsCurvesPluginChunkType*) _cmsContextGetClientChunk(ContextID, CurvesPlugin); |
| 47 | |
| 48 | @@ -269,7 +269,7 @@ cmsToneCurve* AllocateToneCurveStruct(cmsContext ContextID, cmsInt32Number nEntr |
| 49 | // is placed in advance to maximize performance. |
| 50 | if (Segments != NULL && (nSegments > 0)) { |
| 51 | |
| 52 | - _cmsParametricCurvesCollection *c; |
| 53 | + const _cmsParametricCurvesCollection *c; |
| 54 | |
| 55 | p ->SegInterp = (cmsInterpParams**) _cmsCalloc(ContextID, nSegments, sizeof(cmsInterpParams*)); |
| 56 | if (p ->SegInterp == NULL) goto Error; |
| 57 | @@ -714,7 +714,7 @@ cmsToneCurve* CMSEXPORT cmsBuildParametricToneCurve(cmsContext ContextID, cmsInt |
| 58 | cmsCurveSegment Seg0; |
| 59 | int Pos = 0; |
| 60 | cmsUInt32Number size; |
| 61 | - _cmsParametricCurvesCollection* c = GetParametricCurveByType(ContextID, Type, &Pos); |
| 62 | + const _cmsParametricCurvesCollection* c = GetParametricCurveByType(ContextID, Type, &Pos); |
| 63 | |
| 64 | _cmsAssert(Params != NULL); |
| 65 | |
| 66 | diff --git a/third_party/lcms/src/cmshalf.c b/third_party/lcms/src/cmshalf.c |
| 67 | index cdd4e37b7..cceb6f987 100644 |
| 68 | --- a/third_party/lcms/src/cmshalf.c |
| 69 | +++ b/third_party/lcms/src/cmshalf.c |
| 70 | @@ -31,7 +31,7 @@ |
| 71 | // This code is inspired in the paper "Fast Half Float Conversions" |
| 72 | // by Jeroen van der Zijp |
| 73 | |
| 74 | -static cmsUInt32Number Mantissa[2048] = { |
| 75 | +static const cmsUInt32Number Mantissa[2048] = { |
| 76 | |
| 77 | 0x00000000, 0x33800000, 0x34000000, 0x34400000, 0x34800000, 0x34a00000, |
| 78 | 0x34c00000, 0x34e00000, 0x35000000, 0x35100000, 0x35200000, 0x35300000, |
| 79 | @@ -377,7 +377,7 @@ static cmsUInt32Number Mantissa[2048] = { |
| 80 | 0x387fc000, 0x387fe000 |
| 81 | }; |
| 82 | |
| 83 | -static cmsUInt16Number Offset[64] = { |
| 84 | +static const cmsUInt16Number Offset[64] = { |
| 85 | 0x0000, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, |
| 86 | 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, |
| 87 | 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, |
| 88 | @@ -391,7 +391,7 @@ static cmsUInt16Number Offset[64] = { |
| 89 | 0x0400, 0x0400, 0x0400, 0x0400 |
| 90 | }; |
| 91 | |
| 92 | -static cmsUInt32Number Exponent[64] = { |
| 93 | +static const cmsUInt32Number Exponent[64] = { |
| 94 | 0x00000000, 0x00800000, 0x01000000, 0x01800000, 0x02000000, 0x02800000, |
| 95 | 0x03000000, 0x03800000, 0x04000000, 0x04800000, 0x05000000, 0x05800000, |
| 96 | 0x06000000, 0x06800000, 0x07000000, 0x07800000, 0x08000000, 0x08800000, |
| 97 | @@ -405,7 +405,7 @@ static cmsUInt32Number Exponent[64] = { |
| 98 | 0x8e000000, 0x8e800000, 0x8f000000, 0xc7800000 |
| 99 | }; |
| 100 | |
| 101 | -static cmsUInt16Number Base[512] = { |
| 102 | +static const cmsUInt16Number Base[512] = { |
| 103 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
| 104 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
| 105 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
| 106 | @@ -460,7 +460,7 @@ static cmsUInt16Number Base[512] = { |
| 107 | 0xfc00, 0xfc00 |
| 108 | }; |
| 109 | |
| 110 | -static cmsUInt8Number Shift[512] = { |
| 111 | +static const cmsUInt8Number Shift[512] = { |
| 112 | 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, |
| 113 | 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, |
| 114 | 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, |