usp10: Fix the spelling of some index array variables and function.

Indices is the plural used by related APIs so use it for consistency.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Francois Gouget 2019-12-11 02:58:34 +01:00 committed by Alexandre Julliard
parent 48e9595c32
commit 490b245a20
4 changed files with 42 additions and 42 deletions

View File

@ -1149,7 +1149,7 @@ BOOL BIDI_DetermineLevels(
return TRUE; return TRUE;
} }
/* reverse cch indexes */ /* reverse cch indices */
static void reverse(int *pidx, int cch) static void reverse(int *pidx, int cch)
{ {
int temp; int temp;
@ -1185,7 +1185,7 @@ static void reverse(int *pidx, int cch)
Note: this should be applied a line at a time Note: this should be applied a line at a time
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
int BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) int BIDI_ReorderV2lLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse)
{ {
int ich = 0; int ich = 0;
@ -1200,19 +1200,19 @@ int BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
} }
else if (plevel[ich] > level) else if (plevel[ich] > level)
{ {
ich += BIDI_ReorderV2lLevel(level + 1, pIndexs + ich, plevel + ich, ich += BIDI_ReorderV2lLevel(level + 1, pIndices + ich, plevel + ich,
cch - ich, fReverse) - 1; cch - ich, fReverse) - 1;
} }
} }
if (fReverse) if (fReverse)
{ {
reverse(pIndexs, ich); reverse(pIndices, ich);
} }
return ich; return ich;
} }
/* Applies the reorder in reverse. Taking an already reordered string and returning the original */ /* Applies the reorder in reverse. Taking an already reordered string and returning the original */
int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) int BIDI_ReorderL2vLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse)
{ {
int ich = 0; int ich = 0;
int newlevel = -1; int newlevel = -1;
@ -1229,7 +1229,7 @@ int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
} }
if (fReverse) if (fReverse)
{ {
reverse(pIndexs, ich); reverse(pIndices, ich);
} }
if (newlevel >= 0) if (newlevel >= 0)
@ -1239,7 +1239,7 @@ int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
if (plevel[ich] < level) if (plevel[ich] < level)
break; break;
else if (plevel[ich] > level) else if (plevel[ich] > level)
ich += BIDI_ReorderL2vLevel(level + 1, pIndexs + ich, plevel + ich, ich += BIDI_ReorderL2vLevel(level + 1, pIndices + ich, plevel + ich,
cch - ich, fReverse) - 1; cch - ich, fReverse) - 1;
} }

View File

@ -805,7 +805,7 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
} }
} }
/* renumber trailing indexes */ /* renumber trailing indices */
for (i = target_index; i < chars && i >= 0; i += cluster_dir) for (i = target_index; i < chars && i >= 0; i += cluster_dir)
{ {
if (pwLogClust[i] != target_glyph) if (pwLogClust[i] != target_glyph)
@ -1971,7 +1971,7 @@ static void SecondReorder_Like_Tamil(const WCHAR *chars, const IndicSyllable *s,
} }
static inline void shift_syllable_glyph_indexs(IndicSyllable *glyph_index, INT index, INT shift) static inline void shift_syllable_glyph_indices(IndicSyllable *glyph_index, INT index, INT shift)
{ {
if (shift == 0) if (shift == 0)
return; return;
@ -2005,7 +2005,7 @@ static void Apply_Indic_BasicForm(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
if (nextIndex > GSUB_E_NOGLYPH) if (nextIndex > GSUB_E_NOGLYPH)
{ {
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust); UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
shift_syllable_glyph_indexs(glyph_index,index,*pcGlyphs - prevCount); shift_syllable_glyph_indices(glyph_index,index,*pcGlyphs - prevCount);
index = nextIndex; index = nextIndex;
} }
else else
@ -2040,7 +2040,7 @@ static void Apply_Indic_PreBase(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa,
if (nextIndex > GSUB_E_NOGLYPH) if (nextIndex > GSUB_E_NOGLYPH)
{ {
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust); UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
shift_syllable_glyph_indexs(glyph_index, index + glyph_index->start + g_offset, (*pcGlyphs - prevCount)); shift_syllable_glyph_indices(glyph_index, index + glyph_index->start + g_offset, (*pcGlyphs - prevCount));
g_offset += (*pcGlyphs - prevCount); g_offset += (*pcGlyphs - prevCount);
} }
@ -2060,7 +2060,7 @@ static void Apply_Indic_Rphf(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WC
if (nextIndex > GSUB_E_NOGLYPH) if (nextIndex > GSUB_E_NOGLYPH)
{ {
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust); UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
shift_syllable_glyph_indexs(glyph_index,glyph_index->ralf,*pcGlyphs - prevCount); shift_syllable_glyph_indices(glyph_index,glyph_index->ralf,*pcGlyphs - prevCount);
} }
} }
} }
@ -2108,7 +2108,7 @@ static void Apply_Indic_PostBase(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa
if (nextIndex > GSUB_E_NOGLYPH) if (nextIndex > GSUB_E_NOGLYPH)
{ {
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust); UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
shift_syllable_glyph_indexs(glyph_index,index+glyph_index->start+g_offset, (*pcGlyphs - prevCount)); shift_syllable_glyph_indices(glyph_index,index+glyph_index->start+g_offset, (*pcGlyphs - prevCount));
g_offset += (*pcGlyphs - prevCount); g_offset += (*pcGlyphs - prevCount);
} }
else if (!modern) else if (!modern)
@ -2138,70 +2138,70 @@ static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa,
BOOL pref = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "pref") != NULL); BOOL pref = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "pref") != NULL);
BOOL blwf = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "blwf") != NULL); BOOL blwf = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "blwf") != NULL);
BOOL half = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "half") != NULL); BOOL half = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "half") != NULL);
IndicSyllable glyph_indexs; IndicSyllable glyph_indices;
for (c = 0; c < syllable_count; c++) for (c = 0; c < syllable_count; c++)
{ {
int old_end; int old_end;
memcpy(&glyph_indexs, &syllables[c], sizeof(IndicSyllable)); memcpy(&glyph_indices, &syllables[c], sizeof(IndicSyllable));
shift_syllable_glyph_indexs(&glyph_indexs, -1, overall_shift); shift_syllable_glyph_indices(&glyph_indices, -1, overall_shift);
old_end = glyph_indexs.end; old_end = glyph_indices.end;
if (locl) if (locl)
{ {
TRACE("applying feature locl\n"); TRACE("applying feature locl\n");
Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, locl); Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, locl);
} }
if (nukt) if (nukt)
{ {
TRACE("applying feature nukt\n"); TRACE("applying feature nukt\n");
Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, nukt); Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, nukt);
} }
if (akhn) if (akhn)
{ {
TRACE("applying feature akhn\n"); TRACE("applying feature akhn\n");
Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, akhn); Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, akhn);
} }
if (rphf) if (rphf)
Apply_Indic_Rphf(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs); Apply_Indic_Rphf(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices);
if (rkrf) if (rkrf)
{ {
TRACE("applying feature rkrf\n"); TRACE("applying feature rkrf\n");
Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, rkrf); Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, rkrf);
} }
if (pref) if (pref)
Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, modern, "pref"); Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, modern, "pref");
if (blwf) if (blwf)
{ {
if (!modern) if (!modern)
Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, "blwf"); Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, "blwf");
Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, modern, "blwf"); Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, modern, "blwf");
} }
if (half) if (half)
Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, "half"); Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, "half");
if (pstf) if (pstf)
{ {
TRACE("applying feature pstf\n"); TRACE("applying feature pstf\n");
Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, pstf); Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, pstf);
} }
if (vatu) if (vatu)
{ {
TRACE("applying feature vatu\n"); TRACE("applying feature vatu\n");
Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, vatu); Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, vatu);
} }
if (cjct) if (cjct)
{ {
TRACE("applying feature cjct\n"); TRACE("applying feature cjct\n");
Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, cjct); Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, cjct);
} }
if (second_reorder) if (second_reorder)
second_reorder(pwChars, &syllables[c], pwOutGlyphs, &glyph_indexs, lexical); second_reorder(pwChars, &syllables[c], pwOutGlyphs, &glyph_indices, lexical);
overall_shift += glyph_indexs.end - old_end; overall_shift += glyph_indices.end - old_end;
} }
} }

View File

@ -3748,7 +3748,7 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
*/ */
HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *logtovis) HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *logtovis)
{ {
int* indexs; int* indices;
int ich; int ich;
TRACE("(%d, %p, %p, %p)\n", runs, level, vistolog, logtovis); TRACE("(%d, %p, %p, %p)\n", runs, level, vistolog, logtovis);
@ -3756,31 +3756,31 @@ HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *log
if (!level || (!vistolog && !logtovis)) if (!level || (!vistolog && !logtovis))
return E_INVALIDARG; return E_INVALIDARG;
if (!(indexs = heap_calloc(runs, sizeof(*indexs)))) if (!(indices = heap_calloc(runs, sizeof(*indices))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (vistolog) if (vistolog)
{ {
for( ich = 0; ich < runs; ich++) for( ich = 0; ich < runs; ich++)
indexs[ich] = ich; indices[ich] = ich;
ich = 0; ich = 0;
while (ich < runs) while (ich < runs)
ich += BIDI_ReorderV2lLevel(0, indexs+ich, level+ich, runs - ich, FALSE); ich += BIDI_ReorderV2lLevel(0, indices+ich, level+ich, runs - ich, FALSE);
memcpy(vistolog, indexs, runs * sizeof(*vistolog)); memcpy(vistolog, indices, runs * sizeof(*vistolog));
} }
if (logtovis) if (logtovis)
{ {
for( ich = 0; ich < runs; ich++) for( ich = 0; ich < runs; ich++)
indexs[ich] = ich; indices[ich] = ich;
ich = 0; ich = 0;
while (ich < runs) while (ich < runs)
ich += BIDI_ReorderL2vLevel(0, indexs+ich, level+ich, runs - ich, FALSE); ich += BIDI_ReorderL2vLevel(0, indices+ich, level+ich, runs - ich, FALSE);
memcpy(logtovis, indexs, runs * sizeof(*logtovis)); memcpy(logtovis, indices, runs * sizeof(*logtovis));
} }
heap_free(indexs); heap_free(indices);
return S_OK; return S_OK;
} }

View File

@ -253,8 +253,8 @@ BOOL BIDI_DetermineLevels(const WCHAR *string, unsigned int count, const SCRIPT_
const SCRIPT_CONTROL *c, WORD *levels, WORD *overrides) DECLSPEC_HIDDEN; const SCRIPT_CONTROL *c, WORD *levels, WORD *overrides) DECLSPEC_HIDDEN;
BOOL BIDI_GetStrengths(const WCHAR *string, unsigned int count, BOOL BIDI_GetStrengths(const WCHAR *string, unsigned int count,
const SCRIPT_CONTROL *c, WORD *strength) DECLSPEC_HIDDEN; const SCRIPT_CONTROL *c, WORD *strength) DECLSPEC_HIDDEN;
INT BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN; INT BIDI_ReorderV2lLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
INT BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN; INT BIDI_ReorderL2vLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
void SHAPE_ContextualShaping(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) DECLSPEC_HIDDEN; void SHAPE_ContextualShaping(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) DECLSPEC_HIDDEN;
void SHAPE_ApplyDefaultOpentypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, INT cChars, WORD *pwLogClust) DECLSPEC_HIDDEN; void SHAPE_ApplyDefaultOpentypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, INT cChars, WORD *pwLogClust) DECLSPEC_HIDDEN;
void SHAPE_ApplyOpenTypePositions(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WORD* pwGlyphs, INT cGlyphs, int *piAdvance, GOFFSET *pGoffset ) DECLSPEC_HIDDEN; void SHAPE_ApplyOpenTypePositions(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WORD* pwGlyphs, INT cGlyphs, int *piAdvance, GOFFSET *pGoffset ) DECLSPEC_HIDDEN;