usp10: Use heap_alloc_zero() instead of HeapAlloc() with HEAP_ZERO_MEMORY.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-03-09 10:37:06 +01:00 committed by Alexandre Julliard
parent 0bf31be76e
commit 77e5a2fba9
3 changed files with 19 additions and 19 deletions

View File

@ -2472,7 +2472,7 @@ static void GSUB_initialize_script_cache(ScriptCache *psc)
TRACE("initializing %i scripts in this font\n",psc->script_count); TRACE("initializing %i scripts in this font\n",psc->script_count);
if (psc->script_count) if (psc->script_count)
{ {
psc->scripts = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(LoadedScript) * psc->script_count); psc->scripts = heap_alloc_zero(psc->script_count * sizeof(*psc->scripts));
for (i = 0; i < psc->script_count; i++) for (i = 0; i < psc->script_count; i++)
{ {
int offset = GET_BE_WORD(script->ScriptRecord[i].Script); int offset = GET_BE_WORD(script->ScriptRecord[i].Script);
@ -2504,7 +2504,7 @@ static void GPOS_expand_script_cache(ScriptCache *psc)
TRACE("initializing %i scripts in this font\n",psc->script_count); TRACE("initializing %i scripts in this font\n",psc->script_count);
if (psc->script_count) if (psc->script_count)
{ {
psc->scripts = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(LoadedScript) * psc->script_count); psc->scripts = heap_alloc_zero(psc->script_count * sizeof(*psc->scripts));
for (i = 0; i < psc->script_count; i++) for (i = 0; i < psc->script_count; i++)
{ {
int offset = GET_BE_WORD(script->ScriptRecord[i].Script); int offset = GET_BE_WORD(script->ScriptRecord[i].Script);
@ -2602,7 +2602,7 @@ static void GSUB_initialize_language_cache(LoadedScript *script)
{ {
TRACE("Deflang %p, LangCount %i\n",script->default_language.gsub_table, script->language_count); TRACE("Deflang %p, LangCount %i\n",script->default_language.gsub_table, script->language_count);
script->languages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LoadedLanguage) * script->language_count); script->languages = heap_alloc_zero(script->language_count * sizeof(*script->languages));
for (i = 0; i < script->language_count; i++) for (i = 0; i < script->language_count; i++)
{ {
@ -2639,7 +2639,7 @@ static void GPOS_expand_language_cache(LoadedScript *script)
int i; int i;
script->language_count = count; script->language_count = count;
script->languages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LoadedLanguage) * script->language_count); script->languages = heap_alloc_zero(script->language_count * sizeof(*script->languages));
for (i = 0; i < script->language_count; i++) for (i = 0; i < script->language_count; i++)
{ {

View File

@ -708,21 +708,6 @@ typedef struct {
WORD target; WORD target;
} FindGlyph_struct; } FindGlyph_struct;
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size)
{
return HeapAlloc(GetProcessHeap(), 0, size);
}
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
}
static inline BOOL heap_free(void *mem)
{
return HeapFree(GetProcessHeap(), 0, mem);
}
/* TODO Fix font properties on Arabic locale */ /* TODO Fix font properties on Arabic locale */
static inline BOOL set_cache_font_properties(const HDC hdc, ScriptCache *sc) static inline BOOL set_cache_font_properties(const HDC hdc, ScriptCache *sc)
{ {

View File

@ -212,6 +212,21 @@ typedef struct {
enum {lex_Halant, lex_Composed_Vowel, lex_Matra_post, lex_Matra_pre, lex_Matra_above, lex_Matra_below, lex_ZWJ, lex_ZWNJ, lex_NBSP, lex_Modifier, lex_Vowel, lex_Consonant, lex_Generic, lex_Ra, lex_Vedic, lex_Anudatta, lex_Nukta}; enum {lex_Halant, lex_Composed_Vowel, lex_Matra_post, lex_Matra_pre, lex_Matra_above, lex_Matra_below, lex_ZWJ, lex_ZWNJ, lex_NBSP, lex_Modifier, lex_Vowel, lex_Consonant, lex_Generic, lex_Ra, lex_Vedic, lex_Anudatta, lex_Nukta};
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t size)
{
return HeapAlloc(GetProcessHeap(), 0, size);
}
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
}
static inline BOOL heap_free(void *mem)
{
return HeapFree(GetProcessHeap(), 0, mem);
}
static inline BOOL is_consonant( int type ) static inline BOOL is_consonant( int type )
{ {
return (type == lex_Ra || type == lex_Consonant); return (type == lex_Ra || type == lex_Consonant);