Commit cdd47c3d authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

usp10: Avoid LPCWSTR.

And cleanup some style issues along the way. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAric Stewart <aric@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent af617aac
...@@ -159,7 +159,7 @@ static inline void dump_types(const char* header, WORD *types, int start, int en ...@@ -159,7 +159,7 @@ static inline void dump_types(const char* header, WORD *types, int start, int en
} }
/* Convert the libwine information to the direction enum */ /* Convert the libwine information to the direction enum */
static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIPT_CONTROL *c) static void classify(const WCHAR *string, WORD *chartype, DWORD count, const SCRIPT_CONTROL *c)
{ {
static const enum directions dir_map[16] = static const enum directions dir_map[16] =
{ {
...@@ -183,14 +183,14 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP ...@@ -183,14 +183,14 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP
unsigned i; unsigned i;
for (i = 0; i < uCount; ++i) for (i = 0; i < count; ++i)
{ {
chartype[i] = dir_map[get_char_typeW(lpString[i]) >> 12]; chartype[i] = dir_map[get_char_typeW(string[i]) >> 12];
switch (chartype[i]) switch (chartype[i])
{ {
case ES: case ES:
if (!c->fLegacyBidiClass) break; if (!c->fLegacyBidiClass) break;
switch (lpString[i]) switch (string[i])
{ {
case '-': case '-':
case '+': chartype[i] = NI; break; case '+': chartype[i] = NI; break;
...@@ -198,7 +198,7 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP ...@@ -198,7 +198,7 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP
} }
break; break;
case PDF: case PDF:
switch (lpString[i]) switch (string[i])
{ {
case 0x202A: chartype[i] = LRE; break; case 0x202A: chartype[i] = LRE; break;
case 0x202B: chartype[i] = RLE; break; case 0x202B: chartype[i] = RLE; break;
...@@ -988,7 +988,8 @@ static void resolveResolved(unsigned baselevel, const WORD * pcls, WORD *plevel, ...@@ -988,7 +988,8 @@ static void resolveResolved(unsigned baselevel, const WORD * pcls, WORD *plevel,
} }
} }
static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, LPCWSTR lpString, int uCount, struct list *set) static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, const WORD *pLevel,
const WCHAR *string, unsigned int uCount, struct list *set)
{ {
int run_start, run_end, i; int run_start, run_end, i;
int run_count = 0; int run_count = 0;
...@@ -1034,7 +1035,7 @@ static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel ...@@ -1034,7 +1035,7 @@ static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel
for (j = 0; j < current_isolated->length; j++) for (j = 0; j < current_isolated->length; j++)
{ {
current_isolated->item[j].pcls = &pcls[runs[k].start+j]; current_isolated->item[j].pcls = &pcls[runs[k].start+j];
current_isolated->item[j].ch = lpString[runs[k].start+j]; current_isolated->item[j].ch = string[runs[k].start + j];
} }
run_end = runs[k].end; run_end = runs[k].end;
...@@ -1064,7 +1065,7 @@ search: ...@@ -1064,7 +1065,7 @@ search:
for (m = 0; l < current_isolated->length; l++, m++) for (m = 0; l < current_isolated->length; l++, m++)
{ {
current_isolated->item[l].pcls = &pcls[runs[j].start+m]; current_isolated->item[l].pcls = &pcls[runs[j].start+m];
current_isolated->item[l].ch = lpString[runs[j].start+m]; current_isolated->item[l].ch = string[runs[j].start + m];
} }
TRACE("[%i -- %i]",runs[j].start, runs[j].end); TRACE("[%i -- %i]",runs[j].start, runs[j].end);
...@@ -1127,8 +1128,8 @@ search: ...@@ -1127,8 +1128,8 @@ search:
* BIDI_DeterminLevels * BIDI_DeterminLevels
*/ */
BOOL BIDI_DetermineLevels( BOOL BIDI_DetermineLevels(
LPCWSTR lpString, /* [in] The string for which information is to be returned */ const WCHAR *lpString, /* [in] The string for which information is to be returned */
INT uCount, /* [in] Number of WCHARs in string. */ unsigned int uCount, /* [in] Number of WCHARs in string. */
const SCRIPT_STATE *s, const SCRIPT_STATE *s,
const SCRIPT_CONTROL *c, const SCRIPT_CONTROL *c,
WORD *lpOutLevels, /* [out] final string levels */ WORD *lpOutLevels, /* [out] final string levels */
...@@ -1287,15 +1288,14 @@ int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B ...@@ -1287,15 +1288,14 @@ int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
return ich; return ich;
} }
BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c, BOOL BIDI_GetStrengths(const WCHAR *string, unsigned int count, const SCRIPT_CONTROL *c, WORD *strength)
WORD* lpStrength)
{ {
int i; unsigned int i;
classify(lpString, lpStrength, uCount, c);
for ( i = 0; i < uCount; i++) classify(string, strength, count, c);
for (i = 0; i < count; i++)
{ {
switch(lpStrength[i]) switch (strength[i])
{ {
case L: case L:
case LRE: case LRE:
...@@ -1304,7 +1304,7 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c, ...@@ -1304,7 +1304,7 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
case AL: case AL:
case RLE: case RLE:
case RLO: case RLO:
lpStrength[i] = BIDI_STRONG; strength[i] = BIDI_STRONG;
break; break;
case PDF: case PDF:
case EN: case EN:
...@@ -1313,14 +1313,14 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c, ...@@ -1313,14 +1313,14 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
case AN: case AN:
case CS: case CS:
case BN: case BN:
lpStrength[i] = BIDI_WEAK; strength[i] = BIDI_WEAK;
break; break;
case B: case B:
case S: case S:
case WS: case WS:
case ON: case ON:
default: /* Neutrals and NSM */ default: /* Neutrals and NSM */
lpStrength[i] = BIDI_NEUTRAL; strength[i] = BIDI_NEUTRAL;
} }
} }
return TRUE; return TRUE;
......
...@@ -36,12 +36,12 @@ ...@@ -36,12 +36,12 @@
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe); WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
static void debug_output_string(LPCWSTR str, int cChar, lexical_function f) static void debug_output_string(const WCHAR *str, unsigned int char_count, lexical_function f)
{ {
int i; int i;
if (TRACE_ON(uniscribe)) if (TRACE_ON(uniscribe))
{ {
for (i = 0; i < cChar; i++) for (i = 0; i < char_count; ++i)
{ {
switch (f(str[i])) switch (f(str[i]))
{ {
...@@ -80,8 +80,8 @@ static inline BOOL is_joiner( int type ) ...@@ -80,8 +80,8 @@ static inline BOOL is_joiner( int type )
return (type == lex_ZWJ || type == lex_ZWNJ); return (type == lex_ZWJ || type == lex_ZWNJ);
} }
static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next, static int consonant_header(const WCHAR *input, unsigned int cChar,
lexical_function lex) unsigned int start, unsigned int next, lexical_function lex)
{ {
if (!is_consonant( lex(input[next]) )) return -1; if (!is_consonant( lex(input[next]) )) return -1;
next++; next++;
...@@ -104,8 +104,8 @@ static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next, ...@@ -104,8 +104,8 @@ static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next,
return -1; return -1;
} }
static INT parse_consonant_syllable(LPCWSTR input, INT cChar, INT start, static int parse_consonant_syllable(const WCHAR *input, unsigned int cChar,
INT *main, INT next, lexical_function lex) unsigned int start, unsigned int *main, unsigned int next, lexical_function lex)
{ {
int check; int check;
int headers = 0; int headers = 0;
...@@ -152,8 +152,8 @@ static INT parse_consonant_syllable(LPCWSTR input, INT cChar, INT start, ...@@ -152,8 +152,8 @@ static INT parse_consonant_syllable(LPCWSTR input, INT cChar, INT start,
return next; return next;
} }
static INT parse_vowel_syllable(LPCWSTR input, INT cChar, INT start, static int parse_vowel_syllable(const WCHAR *input, unsigned int cChar,
INT next, lexical_function lex) unsigned int start, unsigned int next, lexical_function lex)
{ {
if ((next < cChar) && lex(input[next]) == lex_Nukta) if ((next < cChar) && lex(input[next]) == lex_Nukta)
next++; next++;
...@@ -181,7 +181,8 @@ static INT parse_vowel_syllable(LPCWSTR input, INT cChar, INT start, ...@@ -181,7 +181,8 @@ static INT parse_vowel_syllable(LPCWSTR input, INT cChar, INT start,
return next; return next;
} }
static INT Indic_process_next_syllable( LPCWSTR input, INT cChar, INT start, INT* main, INT next, lexical_function lex ) static int Indic_process_next_syllable(const WCHAR *input, unsigned int cChar,
unsigned int start, unsigned int *main, unsigned int next, lexical_function lex)
{ {
if (lex(input[next])==lex_Vowel) if (lex(input[next])==lex_Vowel)
{ {
...@@ -208,7 +209,8 @@ static INT Indic_process_next_syllable( LPCWSTR input, INT cChar, INT start, INT ...@@ -208,7 +209,8 @@ static INT Indic_process_next_syllable( LPCWSTR input, INT cChar, INT start, INT
return parse_consonant_syllable(input, cChar, start, main, next, lex); return parse_consonant_syllable(input, cChar, start, main, next, lex);
} }
static BOOL Consonant_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) static BOOL Consonant_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical, BOOL modern)
{ {
if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant) if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant)
{ {
...@@ -225,7 +227,8 @@ static BOOL Consonant_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCac ...@@ -225,7 +227,8 @@ static BOOL Consonant_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCac
return FALSE; return FALSE;
} }
static BOOL Consonant_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) static BOOL Consonant_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical, BOOL modern)
{ {
if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant) if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant)
{ {
...@@ -242,7 +245,8 @@ static BOOL Consonant_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCa ...@@ -242,7 +245,8 @@ static BOOL Consonant_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCa
return FALSE; return FALSE;
} }
static BOOL Consonant_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) static BOOL Consonant_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical, BOOL modern)
{ {
if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant) if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant)
{ {
...@@ -259,14 +263,16 @@ static BOOL Consonant_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCach ...@@ -259,14 +263,16 @@ static BOOL Consonant_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCach
return FALSE; return FALSE;
} }
static BOOL Consonant_is_ralf(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical) static BOOL Consonant_is_ralf(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical)
{ {
if ((lexical(pwChar[s->start])==lex_Ra) && s->end > s->start && lexical(pwChar[s->start+1]) == lex_Halant) if ((lexical(pwChar[s->start])==lex_Ra) && s->end > s->start && lexical(pwChar[s->start+1]) == lex_Halant)
return (SHAPE_does_GSUB_feature_apply_to_chars(hdc, psa, psc, &pwChar[s->start], 1, 2, "rphf") > 0); return (SHAPE_does_GSUB_feature_apply_to_chars(hdc, psa, psc, &pwChar[s->start], 1, 2, "rphf") > 0);
return FALSE; return FALSE;
} }
static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, IndicSyllable *s, lexical_function lex, BOOL modern) static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
const WCHAR *input, IndicSyllable *s, lexical_function lex, BOOL modern)
{ {
int i; int i;
BOOL blwf = FALSE; BOOL blwf = FALSE;
...@@ -314,11 +320,12 @@ static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LP ...@@ -314,11 +320,12 @@ static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LP
return s->base; return s->base;
} }
void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) void Indic_ParseSyllables(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const WCHAR *input, unsigned int cChar,
IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern)
{ {
unsigned int center = 0;
int index = 0; int index = 0;
int next = 0; int next = 0;
int center = 0;
*syllable_count = 0; *syllable_count = 0;
......
...@@ -860,7 +860,7 @@ static WCHAR mirror_char( WCHAR ch ) ...@@ -860,7 +860,7 @@ static WCHAR mirror_char( WCHAR ch )
return ch + wine_mirror_map[wine_mirror_map[ch >> 8] + (ch & 0xff)]; return ch + wine_mirror_map[wine_mirror_map[ch >> 8] + (ch & 0xff)];
} }
static inline DWORD decode_surrogate_pair(LPCWSTR str, INT index, INT end) static DWORD decode_surrogate_pair(const WCHAR *str, unsigned int index, unsigned int end)
{ {
if (index < end-1 && IS_SURROGATE_PAIR(str[index],str[index+1])) if (index < end-1 && IS_SURROGATE_PAIR(str[index],str[index+1]))
{ {
......
...@@ -247,10 +247,10 @@ typedef void (*reorder_function)(LPWSTR pwChar, IndicSyllable *syllable, lexical ...@@ -247,10 +247,10 @@ typedef void (*reorder_function)(LPWSTR pwChar, IndicSyllable *syllable, lexical
int USP10_FindGlyphInLogClust(const WORD* pwLogClust, int cChars, WORD target) DECLSPEC_HIDDEN; int USP10_FindGlyphInLogClust(const WORD* pwLogClust, int cChars, WORD target) DECLSPEC_HIDDEN;
BOOL BIDI_DetermineLevels( LPCWSTR lpString, INT uCount, const SCRIPT_STATE *s, BOOL BIDI_DetermineLevels(const WCHAR *string, unsigned int count, const SCRIPT_STATE *s,
const SCRIPT_CONTROL *c, WORD *lpOutLevels, WORD *lpOutOverrides ) DECLSPEC_HIDDEN; const SCRIPT_CONTROL *c, WORD *levels, WORD *overrides) DECLSPEC_HIDDEN;
BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c, BOOL BIDI_GetStrengths(const WCHAR *string, unsigned int count,
WORD* lpStrength) 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 *pIndexs, 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 *pIndexs, 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;
...@@ -264,7 +264,8 @@ HRESULT SHAPE_GetFontLanguageTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p ...@@ -264,7 +264,8 @@ HRESULT SHAPE_GetFontLanguageTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
HRESULT SHAPE_GetFontFeatureTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags) DECLSPEC_HIDDEN; HRESULT SHAPE_GetFontFeatureTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags) DECLSPEC_HIDDEN;
void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChars, IndicSyllable **syllables, int *syllable_count, lexical_function lexical_f, reorder_function reorder_f, BOOL modern) DECLSPEC_HIDDEN; void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChars, IndicSyllable **syllables, int *syllable_count, lexical_function lexical_f, reorder_function reorder_f, BOOL modern) DECLSPEC_HIDDEN;
void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) DECLSPEC_HIDDEN; void Indic_ParseSyllables(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, const WCHAR *input, unsigned int cChar,
IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) DECLSPEC_HIDDEN;
void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) DECLSPEC_HIDDEN; void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment