diff options
author | Marti Maria <mmaria@abindustries.com> | 2022-03-25 11:19:19 +0100 |
---|---|---|
committer | Marti Maria <mmaria@abindustries.com> | 2022-03-25 11:19:19 +0100 |
commit | effdf1f9a59c15d8d684a7d75d2d511f63d1760c (patch) | |
tree | e3293de3e7bc1aa4d076cffc3f2ead515a7eb258 /src | |
parent | 9e97cac287f69bf71e35602dbfc372335679f9fa (diff) | |
download | lcms2-effdf1f9a59c15d8d684a7d75d2d511f63d1760c.tar.gz |
Make const some tables
Some tables and pointers can be made constant
Diffstat (limited to 'src')
-rw-r--r-- | src/cmsalpha.c | 2 | ||||
-rw-r--r-- | src/cmsgamma.c | 12 | ||||
-rw-r--r-- | src/cmshalf.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/cmsalpha.c b/src/cmsalpha.c index d0cd189..b34d82b 100644 --- a/src/cmsalpha.c +++ b/src/cmsalpha.c @@ -377,7 +377,7 @@ int FormatterPos(cmsUInt32Number frm) static cmsFormatterAlphaFn _cmsGetFormatterAlpha(cmsContext id, cmsUInt32Number in, cmsUInt32Number out) { -static cmsFormatterAlphaFn FormattersAlpha[6][6] = { +static const cmsFormatterAlphaFn FormattersAlpha[6][6] = { /* from 8 */ { copy8, from8to16, from8to16SE, from8toHLF, from8toFLT, from8toDBL }, /* from 16*/ { from16to8, copy16, from16to16, from16toHLF, from16toFLT, from16toDBL }, diff --git a/src/cmsgamma.c b/src/cmsgamma.c index 1c4a223..d797f0a 100644 --- a/src/cmsgamma.c +++ b/src/cmsgamma.c @@ -58,7 +58,7 @@ typedef struct _cmsParametricCurvesCollection_st { static cmsFloat64Number DefaultEvalParametricFn(cmsInt32Number Type, const cmsFloat64Number Params[], cmsFloat64Number R); // The built-in list -static _cmsParametricCurvesCollection DefaultCurves = { +static const _cmsParametricCurvesCollection DefaultCurves = { 10, // # of curve types { 1, 2, 3, 4, 5, 6, 7, 8, 108, 109 }, // Parametric curve ID { 1, 3, 4, 5, 7, 4, 5, 5, 1, 1 }, // Parameters by type @@ -162,7 +162,7 @@ cmsBool _cmsRegisterParametricCurvesPlugin(cmsContext ContextID, cmsPluginBase* // Search in type list, return position or -1 if not found static -int IsInSet(int Type, _cmsParametricCurvesCollection* c) +int IsInSet(int Type, const _cmsParametricCurvesCollection* c) { int i; @@ -175,9 +175,9 @@ int IsInSet(int Type, _cmsParametricCurvesCollection* c) // Search for the collection which contains a specific type static -_cmsParametricCurvesCollection *GetParametricCurveByType(cmsContext ContextID, int Type, int* index) +const _cmsParametricCurvesCollection *GetParametricCurveByType(cmsContext ContextID, int Type, int* index) { - _cmsParametricCurvesCollection* c; + const _cmsParametricCurvesCollection* c; int Position; _cmsCurvesPluginChunkType* ctx = ( _cmsCurvesPluginChunkType*) _cmsContextGetClientChunk(ContextID, CurvesPlugin); @@ -270,7 +270,7 @@ cmsToneCurve* AllocateToneCurveStruct(cmsContext ContextID, cmsUInt32Number nEnt // is placed in advance to maximize performance. if (Segments != NULL && (nSegments > 0)) { - _cmsParametricCurvesCollection *c; + const _cmsParametricCurvesCollection *c; p ->SegInterp = (cmsInterpParams**) _cmsCalloc(ContextID, nSegments, sizeof(cmsInterpParams*)); if (p ->SegInterp == NULL) goto Error; @@ -866,7 +866,7 @@ cmsToneCurve* CMSEXPORT cmsBuildParametricToneCurve(cmsContext ContextID, cmsInt cmsCurveSegment Seg0; int Pos = 0; cmsUInt32Number size; - _cmsParametricCurvesCollection* c = GetParametricCurveByType(ContextID, Type, &Pos); + const _cmsParametricCurvesCollection* c = GetParametricCurveByType(ContextID, Type, &Pos); _cmsAssert(Params != NULL); diff --git a/src/cmshalf.c b/src/cmshalf.c index 7a96959..57cb5b0 100644 --- a/src/cmshalf.c +++ b/src/cmshalf.c @@ -377,7 +377,7 @@ static const cmsUInt32Number Mantissa[2048] = { 0x387fc000, 0x387fe000 }; -static cmsUInt16Number Offset[64] = { +static const cmsUInt16Number Offset[64] = { 0x0000, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, |