Reactos

[NTGDI][FREETYPE] Follow-up of #4901 (57702ed)

- Drop APIENTRYs for static functions.
- Use FIELD_OFFSET instead of offsetof.
- Delete unnecessary ASSERTs.
- Add annotations.
CORE-11848

+15 -23
+3 -3
win32ss/gdi/ntgdi/font.h
··· 23 23 FONT_ENTRY_MEM *Entry; 24 24 } FONT_ENTRY_COLL_MEM, *PFONT_ENTRY_COLL_MEM; 25 25 26 - #include <pshpack1.h> /* We don't like padding for these structures */ 26 + #include <pshpack1.h> /* We don't like padding for these structures for hashing */ 27 27 28 28 typedef struct _EMULATION_BOLD_ITALIC 29 29 { ··· 59 59 60 60 #include <poppack.h> 61 61 62 - C_ASSERT(offsetof(FONT_CACHE_ENTRY, GlyphIndex) % sizeof(DWORD) == 0); 63 - C_ASSERT(sizeof(FONT_CACHE_ENTRY) % sizeof(DWORD) == 0); 62 + C_ASSERT(FIELD_OFFSET(FONT_CACHE_ENTRY, GlyphIndex) % sizeof(DWORD) == 0); /* for hashing */ 63 + C_ASSERT(sizeof(FONT_CACHE_ENTRY) % sizeof(DWORD) == 0); /* for hashing */ 64 64 65 65 /* 66 66 * FONTSUBST_... --- constants for font substitutes
+12 -20
win32ss/gdi/ntgdi/freetype.c
··· 2059 2059 * TRUE on success, FALSE on failure. 2060 2060 * 2061 2061 */ 2062 - static BOOLEAN APIENTRY 2062 + static BOOLEAN 2063 2063 IntTranslateCharsetInfo(PDWORD Src, /* [in] 2064 2064 if flags == TCI_SRCFONTSIG: pointer to fsCsb of a FONTSIGNATURE 2065 2065 if flags == TCI_SRCCHARSET: a character set value ··· 3112 3112 return FALSE; 3113 3113 } 3114 3114 3115 - static DWORD APIENTRY 3116 - IntGetHash(LPCVOID pv, DWORD cdw) 3115 + static DWORD 3116 + IntGetHash(IN LPCVOID pv, IN DWORD cdw) 3117 3117 { 3118 3118 DWORD dwHash = cdw; 3119 3119 const DWORD *pdw = pv; ··· 3127 3127 return dwHash; 3128 3128 } 3129 3129 3130 - FT_BitmapGlyph APIENTRY 3131 - ftGdiGlyphCacheGet(const FONT_CACHE_ENTRY *pCache) 3130 + static FT_BitmapGlyph 3131 + ftGdiGlyphCacheGet(IN const FONT_CACHE_ENTRY *pCache) 3132 3132 { 3133 3133 PLIST_ENTRY CurrentEntry; 3134 3134 PFONT_CACHE_ENTRY FontEntry; ··· 3163 3163 } 3164 3164 3165 3165 /* no cache */ 3166 - FT_BitmapGlyph APIENTRY 3166 + static FT_BitmapGlyph 3167 3167 ftGdiGlyphSet( 3168 3168 FT_Face Face, 3169 3169 FT_GlyphSlot GlyphSlot, ··· 3206 3206 return BitmapGlyph; 3207 3207 } 3208 3208 3209 - FT_BitmapGlyph APIENTRY 3209 + static FT_BitmapGlyph 3210 3210 ftGdiGlyphCacheSet( 3211 - PFONT_CACHE_ENTRY Cache, 3212 - FT_GlyphSlot GlyphSlot) 3211 + IN OUT PFONT_CACHE_ENTRY Cache, 3212 + IN FT_GlyphSlot GlyphSlot) 3213 3213 { 3214 3214 FT_Glyph GlyphCopy; 3215 3215 INT error; ··· 4206 4206 return needed; 4207 4207 } 4208 4208 4209 - FT_BitmapGlyph 4210 - APIENTRY 4209 + static FT_BitmapGlyph 4211 4210 ftGdiGetRealGlyph( 4212 - PFONT_CACHE_ENTRY Cache) 4211 + IN OUT PFONT_CACHE_ENTRY Cache) 4213 4212 { 4214 4213 INT error; 4215 4214 FT_GlyphSlot glyph; ··· 4299 4298 Cache.lfHeight = plf->lfHeight; 4300 4299 4301 4300 Cache.Aspect.Emu.Bold = EMUBOLD_NEEDED(FontGDI->OriginalWeight, plf->lfWeight); 4302 - ASSERT(Cache.Aspect.Emu.Bold <= 1); 4303 - 4304 4301 Cache.Aspect.Emu.Italic = (plf->lfItalic && !FontGDI->OriginalItalic); 4305 - ASSERT(Cache.Aspect.Emu.Italic <= 1); 4306 4302 4307 4303 if (IntIsFontRenderingEnabled()) 4308 4304 Cache.Aspect.RenderMode = (BYTE)IntGetFontRenderMode(plf); ··· 5865 5861 } 5866 5862 5867 5863 /* Calculate width of the text. */ 5868 - BOOL 5869 - APIENTRY 5864 + static BOOL 5870 5865 ftGdiGetTextWidth( 5871 5866 LONGLONG *pTextWidth64, 5872 5867 LPCWSTR String, ··· 6079 6074 Cache.lfHeight = plf->lfHeight; 6080 6075 6081 6076 Cache.Aspect.Emu.Bold = EMUBOLD_NEEDED(FontGDI->OriginalWeight, plf->lfWeight); 6082 - ASSERT(Cache.Aspect.Emu.Bold <= 1); 6083 - 6084 6077 Cache.Aspect.Emu.Italic = (plf->lfItalic && !FontGDI->OriginalItalic); 6085 - ASSERT(Cache.Aspect.Emu.Italic <= 1); 6086 6078 6087 6079 if (IntIsFontRenderingEnabled()) 6088 6080 Cache.Aspect.RenderMode = (BYTE)IntGetFontRenderMode(plf);