Skip to content

Commit

Permalink
More typos and whitespace removal
Browse files Browse the repository at this point in the history
Many thanks to @GerHobbelt for reporting
  • Loading branch information
mm2 committed Sep 7, 2023
1 parent 41f1a85 commit bd92404
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 33 deletions.
8 changes: 4 additions & 4 deletions include/lcms2_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ typedef void (* _cmsTransformFn)(struct _cmstransform_struct *CMMcargo, //
typedef void (*_cmsTransform2Fn)(struct _cmstransform_struct *CMMcargo,
const void* InputBuffer,
void* OutputBuffer,
cmsUInt32Number PixelsPerLine,
cmsUInt32Number LineCount,
const cmsStride* Stride);
cmsUInt32Number PixelsPerLine,
cmsUInt32Number LineCount,
const cmsStride* Stride);

typedef cmsBool (* _cmsTransformFactory)(_cmsTransformFn* xform,
void** UserData,
Expand Down Expand Up @@ -648,7 +648,7 @@ typedef struct {
} cmsPluginTransform;

//----------------------------------------------------------------------------------------------------------
// Mutex
// Mutex

typedef void* (* _cmsCreateMutexFnPtrType)(cmsContext ContextID);
typedef void (* _cmsDestroyMutexFnPtrType)(cmsContext ContextID, void* mtx);
Expand Down
16 changes: 8 additions & 8 deletions plugins/fast_float/src/fast_8_matsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ XMatShaper8Data* SetMatShaper(cmsContext ContextID, cmsToneCurve* Curve1[3], cms
return p;
}

// A fast matrix-shaper evaluator for 8 bits. This is a bit ticky since I'm using 1.14 signed fixed point
// to accomplish some performance. Actually it takes 256x3 16 bits tables and 16385 x 3 tables of 8 bits,
// A fast matrix-shaper evaluator for 8 bits. This is a bit tricky since I'm using 1.14 signed fixed point
// to accomplish some performance. Actually it takes 256x3 16 bits tables and 16385 x 3 tables of 8 bits,
// in total about 50K, and the performance boost is huge!

static
Expand Down Expand Up @@ -313,8 +313,8 @@ cmsBool Optimize8MatrixShaper(_cmsTransform2Fn* TransformFn,
if (cmsStageInputChannels(Matrix1) == 1 && cmsStageOutputChannels(Matrix2) == 1)
{
// This is a gray to gray. Just multiply
factor = Data1->Double[0]*Data2->Double[0] +
Data1->Double[1]*Data2->Double[1] +
factor = Data1->Double[0]*Data2->Double[0] +
Data1->Double[1]*Data2->Double[1] +
Data1->Double[2]*Data2->Double[2];

if (fabs(1 - factor) < (1.0 / 65535.0)) IdentityMat = TRUE;
Expand All @@ -333,11 +333,11 @@ cmsBool Optimize8MatrixShaper(_cmsTransform2Fn* TransformFn,
}
}

// Allocate an empty LUT
// Allocate an empty LUT
Dest = cmsPipelineAlloc(ContextID, nChans, nChans);
if (!Dest) return FALSE;

// Assamble the new LUT
// Assemble the new LUT
cmsPipelineInsertStage(Dest, cmsAT_BEGIN, cmsStageDup(Curve1));

if (!IdentityMat) {
Expand All @@ -363,11 +363,11 @@ cmsBool Optimize8MatrixShaper(_cmsTransform2Fn* TransformFn,
_cmsStageToneCurvesData* mpeC2 = (_cmsStageToneCurvesData*) cmsStageData(Curve2);

// In this particular optimization, cache does not help as it takes more time to deal with
// the cache that with the pixel handling
// the cache than with the pixel handling
*dwFlags |= cmsFLAGS_NOCACHE;


// Setup the optimizarion routines
// Setup the optimization routines
*UserData = SetMatShaper(ContextID, mpeC1 ->TheCurves, &res, (cmsVEC3*) Data2 ->Offset, mpeC2->TheCurves);
*FreeUserData = FreeMatShaper;

Expand Down
2 changes: 1 addition & 1 deletion plugins/fast_float/src/fast_8_matsh_sse.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ cmsBool Optimize8MatrixShaperSSE(_cmsTransform2Fn* TransformFn,
_cmsStageToneCurvesData* mpeC2 = (_cmsStageToneCurvesData*) cmsStageData(Curve2);

// In this particular optimization, cache does not help as it takes more time to deal with
// the cache that with the pixel handling
// the cache than with the pixel handling
*dwFlags |= cmsFLAGS_NOCACHE;


Expand Down
2 changes: 1 addition & 1 deletion plugins/fast_float/src/fast_float_15mats.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ cmsBool OptimizeMatrixShaper15(_cmsTransform2Fn* TransformFn,
_cmsStageToneCurvesData* mpeC2 = (_cmsStageToneCurvesData*)cmsStageData(Curve2);

// In this particular optimization, cache does not help as it takes more time to deal with
// the cache that with the pixel handling
// the cache than with the pixel handling
*dwFlags |= cmsFLAGS_NOCACHE;

// Setup the optimizarion routines
Expand Down
12 changes: 6 additions & 6 deletions plugins/fast_float/src/fast_float_matsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ cmsBool OptimizeFloatMatrixShaper(_cmsTransform2Fn* TransformFn,
}
}

// Allocate an empty LUT
// Allocate an empty LUT
Dest = cmsPipelineAlloc(ContextID, nChans, nChans);
if (!Dest) return FALSE;

// Assamble the new LUT
// Assemble the new LUT
cmsPipelineInsertStage(Dest, cmsAT_BEGIN, cmsStageDup(Curve1));

if (!IdentityMat) {
Expand All @@ -331,12 +331,12 @@ cmsBool OptimizeFloatMatrixShaper(_cmsTransform2Fn* TransformFn,
else {
_cmsStageToneCurvesData* mpeC1 = (_cmsStageToneCurvesData*) cmsStageData(Curve1);
_cmsStageToneCurvesData* mpeC2 = (_cmsStageToneCurvesData*) cmsStageData(Curve2);
// In this particular optimization, cache does not help as it takes more time to deal with
// the cachthat with the pixel handling

// In this particular optimization, cache does not help as it takes more time to deal with
// the cache than with the pixel handling
*dwFlags |= cmsFLAGS_NOCACHE;

// Setup the optimizarion routines
// Setup the optimization routines
*UserData = SetMatShaper(ContextID, mpeC1 ->TheCurves, &res, (cmsVEC3*) Data2 ->Offset, mpeC2->TheCurves);
*FreeUserData = FreeMatShaper;

Expand Down
2 changes: 1 addition & 1 deletion src/cmsalpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ void _cmsHandleExtraChannels(_cmsTRANSFORM* p, const void* in,
if (nExtra == 0)
return;

// Compute the increments
// Compute the increments
if (!ComputeComponentIncrements(p->InputFormat, Stride->BytesPerPlaneIn, SourceStartingOrder, SourceIncrements))
return;
if (!ComputeComponentIncrements(p->OutputFormat, Stride->BytesPerPlaneOut, DestStartingOrder, DestIncrements))
Expand Down
2 changes: 1 addition & 1 deletion src/cmscgats.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ cmsFloat64Number ParseFloatNumber(const char *Buffer)
}


// Reads a string, special case to avoid infinite resursion on .include
// Reads a string, special case to avoid infinite recursion on .include
static
void InStringSymbol(cmsIT8* it8)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cmsio1.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ cmsPipeline* _cmsReadFloatOutputTag(cmsHPROFILE hProfile, cmsTagSignature tagFlo
return NULL;
}

// Create an output MPE LUT from agiven profile. Version mismatches are handled here
// Create an output MPE LUT from a given profile. Version mismatches are handled here
cmsPipeline* CMSEXPORT _cmsReadOutputLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent)
{
cmsTagTypeSignature OriginalType;
Expand Down
7 changes: 4 additions & 3 deletions src/cmsopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ cmsBool isFloatMatrixIdentity(const cmsMAT3* a)

return TRUE;
}

// if two adjacent matrices are found, multiply them.
static
cmsBool _MultiplyMatrix(cmsPipeline* Lut)
Expand Down Expand Up @@ -1771,7 +1772,7 @@ cmsBool OptimizeMatrixShaper(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
_cmsStageToneCurvesData* mpeC2 = (_cmsStageToneCurvesData*) cmsStageData(Curve2);

// In this particular optimization, cache does not help as it takes more time to deal with
// the cache that with the pixel handling
// the cache than with the pixel handling
*dwFlags |= cmsFLAGS_NOCACHE;

// Setup the optimizarion routines
Expand Down Expand Up @@ -1927,8 +1928,8 @@ cmsBool CMSEXPORT _cmsOptimizePipeline(cmsContext ContextID,
// Named color pipelines cannot be optimized
for (mpe = cmsPipelineGetPtrToFirstStage(*PtrLut);
mpe != NULL;
mpe = cmsStageNext(mpe)) {
if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE;
mpe = cmsStageNext(mpe)) {
if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE;
}

// Try to get rid of identities and trivial conversions.
Expand Down
4 changes: 2 additions & 2 deletions src/cmsps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ void EmitNGamma(cmsIOHANDLER* m, cmsUInt32Number n, cmsToneCurve* g[], const cha
_cmsIOPrintf(m, "/%s%d /%s%d load def\n", nameprefix, i, nameprefix, i-1);
}
else {
snprintf(buffer, sizeof(buffer), "%s%d", nameprefix, (int) i);
buffer[sizeof(buffer)-1] = '\0';
snprintf(buffer, sizeof(buffer), "%s%d", nameprefix, (int)i);
buffer[sizeof(buffer) - 1] = '\0';
Emit1Gamma(m, g[i], buffer);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmssamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ cmsBool BlackPointAsDarkerColorant(cmsHPROFILE hInput,
// Convert black to Lab
cmsDoTransform(xform, Black, &Lab, 1);

// Force it to be neutral, check for inconsistences
// Force it to be neutral, check for inconsistencies
Lab.a = Lab.b = 0;
if (Lab.L > 50 || Lab.L < 0) Lab.L = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/cmstypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ cmsBool RegisterTypesPlugin(cmsContext id, cmsPluginBase* Data, _cmsMemoryClient
return TRUE;
}

// Return handler for a given type or NULL if not found. Shared between normal types and MPE. It first tries the additons
// Return handler for a given type or NULL if not found. Shared between normal types and MPE. It first tries the additions
// made by plug-ins and then the built-in defaults.
static
cmsTagTypeHandler* GetHandler(cmsTagTypeSignature sig, _cmsTagTypeLinkedList* PluginLinkedList, _cmsTagTypeLinkedList* DefaultLinkedList)
Expand Down
2 changes: 1 addition & 1 deletion src/lcms2_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ struct _cmsContext_struct {
struct _cmsContext_struct* Next; // Points to next context in the new style
_cmsSubAllocator* MemPool; // The memory pool that stores context data

void* chunks[MemoryClientMax]; // array of pointers to client chunks. Memory itself is hold in the suballocator.
void* chunks[MemoryClientMax]; // array of pointers to client chunks. Memory itself is held in the suballocator.
// If NULL, then it reverts to global Context0

_cmsMemPluginChunkType DefaultMemoryManager; // The allocators used for creating the context itself. Cannot be overridden
Expand Down
4 changes: 2 additions & 2 deletions testbed/testcms2.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void TestMemoryLeaks(cmsBool ok)
static cmsPluginMemHandler DebugMemHandler = {{ cmsPluginMagicNumber, 2060, cmsPluginMemHandlerSig, NULL },
DebugMalloc, DebugFree, DebugRealloc, NULL, NULL, NULL };

// Returnds a pointer to the memhandler plugin
// Returns a pointer to the memhandler plugin
void* PluginMemHandler(void)
{
return (void*) &DebugMemHandler;
Expand Down Expand Up @@ -8640,7 +8640,7 @@ int CheckBadCGATS(void)

cmsSetLogErrorHandler(NULL);

hIT8 = cmsIT8LoadFromMem(0, bad_it8, strlen(bad_it8));
hIT8 = cmsIT8LoadFromMem(0, bad_it8, (cmsUInt32Number) strlen(bad_it8));

ResetFatalError();

Expand Down

0 comments on commit bd92404

Please sign in to comment.