gdi32: Constification.

Kusanagi Kouichi slash at ac.auone-net.jp
Tue Apr 3 07:53:29 CDT 2012


Signed-off-by: Kusanagi Kouichi <slash at ac.auone-net.jp>
---
 dlls/gdi32/freetype.c |  184 +++++++++++++++++++++++++------------------------
 1 file changed, 93 insertions(+), 91 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 72b74be..6bddee0 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -261,7 +261,7 @@ typedef struct tagFace {
     WCHAR *StyleName;
     WCHAR *FullName;
     char *file;
-    void *font_data_ptr;
+    const void *font_data_ptr;
     DWORD font_data_size;
     FT_Long face_index;
     FONTSIGNATURE fs;
@@ -271,7 +271,7 @@ typedef struct tagFace {
     BOOL vertical;
     Bitmap_Size size;     /* set if face is a bitmap */
     BOOL external; /* TRUE if we should manually add this font to the registry */
-    struct tagFamily *family;
+    const struct tagFamily *family;
     /* Cached data for Enum */
     struct enum_data *cached_enum_data;
 } Face;
@@ -311,7 +311,7 @@ typedef struct tagHFONTLIST {
 
 typedef struct {
     struct list entry;
-    Face *face;
+    const Face *face;
     GdiFont *font;
 } CHILD_FONT;
 
@@ -443,7 +443,7 @@ static const WCHAR liberation_serif[] = {'L','i','b','e','r','a','t','i','o','n'
 static const WCHAR times_new_roman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0};
 static const WCHAR SymbolW[] = {'S','y','m','b','o','l','\0'};
 
-static const WCHAR *default_serif_list[] =
+static const WCHAR * const default_serif_list[] =
 {
     times_new_roman,
     liberation_serif,
@@ -451,7 +451,7 @@ static const WCHAR *default_serif_list[] =
     NULL
 };
 
-static const WCHAR *default_fixed_list[] =
+static const WCHAR * const default_fixed_list[] =
 {
     courier_new,
     liberation_mono,
@@ -459,7 +459,7 @@ static const WCHAR *default_fixed_list[] =
     NULL
 };
 
-static const WCHAR *default_sans_list[] =
+static const WCHAR * const default_sans_list[] =
 {
     arial,
     liberation_sans,
@@ -897,7 +897,7 @@ static const struct list *get_face_list_from_family(const Family *family)
         return family->replacement;
 }
 
-static Face *find_face_from_filename(const WCHAR *file_name, const WCHAR *face_name)
+static const Face *find_face_from_filename(const WCHAR *file_name, const WCHAR *face_name)
 {
     Family *family;
     Face *face;
@@ -964,7 +964,7 @@ static Family *find_family_from_any_name(const WCHAR *name)
 
 static void DumpSubstList(void)
 {
-    FontSubst *psub;
+    const FontSubst *psub;
 
     LIST_FOR_EACH_ENTRY(psub, &font_subst_list, FontSubst, entry)
     {
@@ -1131,7 +1131,7 @@ static void LoadSubstList(void)
  * and string_len members.  The string is owned by FreeType so
  * don't free it.  Returns TRUE if the name is found else FALSE.
  */
-static BOOL get_name_table_entry(FT_Face ft_face, FT_SfntName *req)
+static BOOL get_name_table_entry(const FT_Face ft_face, FT_SfntName *req)
 {
     FT_SfntName name;
     FT_UInt num_names, name_index;
@@ -1161,7 +1161,7 @@ static BOOL get_name_table_entry(FT_Face ft_face, FT_SfntName *req)
     return FALSE;
 }
 
-static WCHAR *get_face_name(FT_Face ft_face, FT_UShort name_id, FT_UShort language_id)
+static WCHAR *get_face_name(const FT_Face ft_face, FT_UShort name_id, FT_UShort language_id)
 {
     WCHAR *ret = NULL;
     FT_SfntName name;
@@ -1566,7 +1566,7 @@ static void get_family_names( FT_Face ft_face, WCHAR **name, WCHAR **english, BO
     }
 }
 
-static Family *get_family( FT_Face ft_face, BOOL vertical )
+static Family *get_family( const FT_Face ft_face, BOOL vertical )
 {
     Family *family;
     WCHAR *name, *english_name;
@@ -1599,10 +1599,10 @@ static Family *get_family( FT_Face ft_face, BOOL vertical )
     return family;
 }
 
-static inline FT_Fixed get_font_version( FT_Face ft_face )
+static inline FT_Fixed get_font_version( const FT_Face ft_face )
 {
     FT_Fixed version = 0;
-    TT_Header *header;
+    const TT_Header *header;
 
     header = pFT_Get_Sfnt_Table( ft_face, ft_sfnt_head );
     if (header) version = header->Font_Revision;
@@ -1610,7 +1610,7 @@ static inline FT_Fixed get_font_version( FT_Face ft_face )
     return version;
 }
 
-static inline DWORD get_ntm_flags( FT_Face ft_face )
+static inline DWORD get_ntm_flags( const FT_Face ft_face )
 {
     DWORD flags = 0;
     FT_ULong table_size = 0;
@@ -1625,7 +1625,7 @@ static inline DWORD get_ntm_flags( FT_Face ft_face )
     return flags;
 }
 
-static inline int get_bitmap_internal_leading( FT_Face ft_face )
+static inline int get_bitmap_internal_leading( const FT_Face ft_face )
 {
     int internal_leading = 0;
     FT_WinFNT_HeaderRec winfnt_header;
@@ -1636,9 +1636,9 @@ static inline int get_bitmap_internal_leading( FT_Face ft_face )
     return internal_leading;
 }
 
-static inline void get_fontsig( FT_Face ft_face, FONTSIGNATURE *fs )
+static inline void get_fontsig( const FT_Face ft_face, FONTSIGNATURE *fs )
 {
-    TT_OS2 *os2;
+    const TT_OS2 *os2;
     FT_UInt dummy;
     CHARSETINFO csi;
     FT_WinFNT_HeaderRec winfnt_header;
@@ -1703,11 +1703,11 @@ static inline void get_fontsig( FT_Face ft_face, FONTSIGNATURE *fs )
 #define ADDFONT_FORCE_BITMAP  0x02
 #define ADDFONT_ADD_TO_CACHE  0x04
 
-static Face *create_face( FT_Face ft_face, FT_Long face_index, const char *file, void *font_data_ptr, DWORD font_data_size,
+static Face *create_face( const FT_Face ft_face, FT_Long face_index, const char *file, void *font_data_ptr, DWORD font_data_size,
                           DWORD flags, BOOL vertical )
 {
     Face *face = HeapAlloc( GetProcessHeap(), 0, sizeof(*face) );
-    My_FT_Bitmap_Size *size = (My_FT_Bitmap_Size *)ft_face->available_sizes;
+    const My_FT_Bitmap_Size * const size = (My_FT_Bitmap_Size *)ft_face->available_sizes;
 
     face->StyleName = towstr( CP_ACP, ft_face->style_name );
     face->FullName = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES );
@@ -1761,7 +1761,7 @@ static Face *create_face( FT_Face ft_face, FT_Long face_index, const char *file,
     return face;
 }
 
-static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr, DWORD font_data_size,
+static void AddFaceToList(const FT_Face ft_face, const char *file, void *font_data_ptr, DWORD font_data_size,
                           FT_Long face_index, DWORD flags, BOOL vertical)
 {
     Face *face;
@@ -1786,7 +1786,7 @@ static FT_Face new_ft_face( const char *file, void *font_data_ptr, DWORD font_da
                             FT_Long face_index, BOOL allow_bitmap )
 {
     FT_Error err;
-    TT_OS2 *pOS2;
+    const TT_OS2 *pOS2;
     FT_Face ft_face;
 
     if (file)
@@ -1916,9 +1916,9 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
 
 static void DumpFontList(void)
 {
-    Family *family;
-    Face *face;
-    struct list *family_elem_ptr, *face_elem_ptr;
+    const Family *family;
+    const Face *face;
+    const struct list *family_elem_ptr, *face_elem_ptr;
 
     LIST_FOR_EACH(family_elem_ptr, &font_list) {
         family = LIST_ENTRY(family_elem_ptr, Family, entry); 
@@ -2007,7 +2007,7 @@ static void LoadReplaceList(void)
     }
 }
 
-static const WCHAR *font_links_list[] =
+static const WCHAR * const font_links_list[] =
 {
     Lucida_Sans_Unicode,
     Microsoft_Sans_Serif,
@@ -2065,9 +2065,9 @@ static void populate_system_links(const WCHAR *name, const WCHAR *const *values)
 {
     const WCHAR *value;
     int i;
-    FontSubst *psub;
-    Family *family;
-    Face *face;
+    const FontSubst *psub;
+    const Family *family;
+    const Face *face;
     const char *file;
     WCHAR *fileW;
 
@@ -2162,8 +2162,8 @@ static BOOL init_system_links(void)
     static const WCHAR tahoma_ttf[] = {'t','a','h','o','m','a','.','t','t','f',0};
     static const WCHAR System[] = {'S','y','s','t','e','m',0};
     static const WCHAR MS_Shell_Dlg[] = {'M','S',' ','S','h','e','l','l',' ','D','l','g',0};
-    Face *face;
-    FontSubst *psub;
+    const Face *face;
+    const FontSubst *psub;
     UINT i, j;
 
     if(RegOpenKeyW(HKEY_LOCAL_MACHINE, system_link, &hkey) == ERROR_SUCCESS)
@@ -2302,7 +2302,7 @@ skip_internal:
 static BOOL ReadFontDir(const char *dirname, BOOL external_fonts)
 {
     DIR *dir;
-    struct dirent *dent;
+    const struct dirent *dent;
     char path[MAX_PATH];
 
     TRACE("Loading fonts from %s\n", debugstr_a(dirname));
@@ -2504,13 +2504,13 @@ static void update_reg_entries(void)
     HKEY winnt_key = 0, win9x_key = 0, external_key = 0;
     LPWSTR valueW;
     DWORD len, len_fam;
-    Family *family;
-    Face *face;
-    struct list *family_elem_ptr, *face_elem_ptr;
+    const Family *family;
+    const Face *face;
+    const struct list *family_elem_ptr, *face_elem_ptr;
     WCHAR *file;
     static const WCHAR TrueType[] = {' ','(','T','r','u','e','T','y','p','e',')','\0'};
     static const WCHAR spaceW[] = {' ', '\0'};
-    char *path;
+    const char *path;
 
     if(RegCreateKeyExW(HKEY_LOCAL_MACHINE, winnt_font_reg_key,
                        0, NULL, 0, KEY_ALL_ACCESS, NULL, &winnt_key, NULL) != ERROR_SUCCESS) {
@@ -2899,7 +2899,8 @@ static BOOL create_fot( const WCHAR *resource, const WCHAR *font_file, const str
     DWORD size, written;
     BYTE *ptr, *start;
     BYTE import_name_len, res_name_len, non_res_name_len, font_file_len;
-    char *font_fileA, *last_part, *ext;
+    char *font_fileA;
+    const char *last_part, *ext;
     IMAGE_DOS_HEADER dos;
     IMAGE_OS2_HEADER ne =
     {
@@ -3561,7 +3562,7 @@ static BOOL move_to_front(const WCHAR *name)
     return FALSE;
 }
 
-static BOOL set_default(const WCHAR **name_list)
+static BOOL set_default(const WCHAR * const *name_list)
 {
     while (*name_list)
     {
@@ -3628,10 +3629,10 @@ BOOL WineEngInit(void)
 }
 
 
-static LONG calc_ppem_for_height(FT_Face ft_face, LONG height)
+static LONG calc_ppem_for_height(const FT_Face ft_face, LONG height)
 {
-    TT_OS2 *pOS2;
-    TT_HoriHeader *pHori;
+    const TT_OS2 *pOS2;
+    const TT_HoriHeader *pHori;
 
     LONG ppem;
 
@@ -3721,11 +3722,11 @@ static void unmap_font_file( struct font_mapping *mapping )
 
 static LONG load_VDMX(GdiFont*, LONG);
 
-static FT_Face OpenFontFace(GdiFont *font, Face *face, LONG width, LONG height)
+static FT_Face OpenFontFace(GdiFont *font, const Face *face, LONG width, LONG height)
 {
     FT_Error err;
     FT_Face ft_face;
-    void *data_ptr;
+    const void *data_ptr;
     DWORD data_size;
 
     TRACE("%s/%p, %ld, %d x %d\n", debugstr_a(face->file), face->font_data_ptr, face->face_index, width, height);
@@ -3773,7 +3774,7 @@ static FT_Face OpenFontFace(GdiFont *font, Face *face, LONG width, LONG height)
 }
 
 
-static int get_nearest_charset(const WCHAR *family_name, Face *face, int *cp)
+static int get_nearest_charset(const WCHAR *family_name, const Face *face, int *cp)
 {
   /* Only get here if lfCharSet == DEFAULT_CHARSET or we couldn't find
      a single face with the requested charset.  The idea is to check if
@@ -3865,7 +3866,7 @@ static void free_font(GdiFont *font)
 }
 
 
-static DWORD get_font_data( GdiFont *font, DWORD table, DWORD offset, LPVOID buf, DWORD cbData)
+static DWORD get_font_data( const GdiFont *font, DWORD table, DWORD offset, LPVOID buf, DWORD cbData)
 {
     FT_Face ft_face = font->ft_face;
     FT_ULong len;
@@ -4031,7 +4032,7 @@ static LONG load_VDMX(GdiFont *font, LONG height)
     return ppem;
 }
 
-static BOOL fontcmp(const GdiFont *font, FONT_DESC *fd)
+static BOOL fontcmp(const GdiFont *font, const FONT_DESC *fd)
 {
     if(font->font_desc.hash != fd->hash) return TRUE;
     if(memcmp(&font->font_desc.matrix, &fd->matrix, sizeof(fd->matrix))) return TRUE;
@@ -4070,7 +4071,7 @@ static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pma
     GdiFont *ret;
     FONT_DESC fd;
     HFONTLIST *hflist;
-    struct list *font_elem_ptr, *hfontlist_elem_ptr;
+    const struct list *font_elem_ptr, *hfontlist_elem_ptr;
 
     fd.lf = *plf;
     fd.matrix = *pmat;
@@ -4141,10 +4142,11 @@ static void add_to_cache(GdiFont *font)
 static BOOL create_child_font_list(GdiFont *font)
 {
     BOOL ret = FALSE;
-    SYSTEM_LINKS *font_link;
-    CHILD_FONT *font_link_entry, *new_child;
-    FontSubst *psub;
-    WCHAR* font_name;
+    const SYSTEM_LINKS *font_link;
+    const CHILD_FONT *font_link_entry;
+    CHILD_FONT *new_child;
+    const FontSubst *psub;
+    const WCHAR* font_name;
 
     psub = get_font_subst(&font_subst_list, font->name, -1);
     font_name = psub ? psub->to.name : font->name;
@@ -4189,7 +4191,7 @@ static BOOL create_child_font_list(GdiFont *font)
     return ret;
 }
 
-static BOOL select_charmap(FT_Face ft_face, FT_Encoding encoding)
+static BOOL select_charmap(const FT_Face ft_face, FT_Encoding encoding)
 {
     FT_Error ft_err = FT_Err_Invalid_CharMap_Handle;
 
@@ -4273,12 +4275,12 @@ static BOOL freetype_DeleteDC( PHYSDEV dev )
 /*************************************************************
  * freetype_SelectFont
  */
-static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont )
+static HFONT freetype_SelectFont( const PHYSDEV dev, HFONT hfont )
 {
     struct freetype_physdev *physdev = get_freetype_dev( dev );
     GdiFont *ret;
-    Face *face, *best, *best_bitmap;
-    Family *family, *last_resort_family;
+    const Face *face, *best, *best_bitmap;
+    const Family *family, *last_resort_family;
     const struct list *family_elem_ptr, *face_list, *face_elem_ptr;
     INT height, width = 0;
     unsigned int score = 0, new_score;
@@ -4288,7 +4290,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont )
     CHARSETINFO csi;
     HFONTLIST *hflist;
     FMAT2 dcmat;
-    FontSubst *psub = NULL;
+    const FontSubst *psub = NULL;
     DC *dc = get_dc_ptr( dev->hdc );
     const SYSTEM_LINKS *font_link;
 
@@ -4387,8 +4389,8 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont )
 
     family = NULL;
     if(lf.lfFaceName[0] != '\0') {
-        CHILD_FONT *font_link_entry;
-        LPWSTR FaceName = lf.lfFaceName;
+        const CHILD_FONT *font_link_entry;
+        LPCWSTR FaceName = lf.lfFaceName;
 
         psub = get_font_subst(&font_subst_list, FaceName, lf.lfCharSet);
 
@@ -4729,8 +4731,8 @@ done:
 
 static void dump_gdi_font_list(void)
 {
-    GdiFont *gdiFont;
-    struct list *elem_ptr;
+    const GdiFont *gdiFont;
+    const struct list *elem_ptr;
 
     TRACE("---------- gdiFont Cache ----------\n");
     LIST_FOR_EACH(elem_ptr, &gdi_font_list) {
@@ -4765,7 +4767,7 @@ BOOL WineEngDestroyFontInstance(HFONT handle)
     GdiFont *gdiFont;
     HFONTLIST *hflist;
     BOOL ret = FALSE;
-    struct list *font_elem_ptr, *hfontlist_elem_ptr;
+    const struct list *font_elem_ptr, *hfontlist_elem_ptr;
     int i = 0;
 
     GDI_CheckNotLock();
@@ -4831,7 +4833,7 @@ static INT load_script_name( UINT id, WCHAR buffer[LF_FACESIZE] )
 {
     HRSRC rsrc;
     HGLOBAL hMem;
-    WCHAR *p;
+    const WCHAR *p;
     int i;
 
     id += IDS_FIRST_SCRIPT;
@@ -5018,7 +5020,7 @@ static void create_full_name(WCHAR *full_name, const WCHAR *family_name, const W
     strcatW(full_name, style_name);
 }
 
-static BOOL family_matches(Family *family, const LOGFONTW *lf)
+static BOOL family_matches(const Family *family, const LOGFONTW *lf)
 {
     const struct list *face_list, *face_elem_ptr;
 
@@ -5028,7 +5030,7 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
     LIST_FOR_EACH(face_elem_ptr, face_list)
     {
         WCHAR full_family_name[LF_FULLFACESIZE];
-        Face *face = LIST_ENTRY(face_elem_ptr, Face, entry);
+        const Face * const face = LIST_ENTRY(face_elem_ptr, Face, entry);
 
         if (strlenW(family->FamilyName) + strlenW(face->StyleName) + 2 > LF_FULLFACESIZE)
         {
@@ -5044,7 +5046,7 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
     return FALSE;
 }
 
-static BOOL face_matches(const WCHAR *family_name, Face *face, const LOGFONTW *lf)
+static BOOL face_matches(const WCHAR *family_name, const Face *face, const LOGFONTW *lf)
 {
     WCHAR full_family_name[LF_FULLFACESIZE];
 
@@ -5061,7 +5063,7 @@ static BOOL face_matches(const WCHAR *family_name, Face *face, const LOGFONTW *l
     return !strcmpiW(lf->lfFaceName, full_family_name);
 }
 
-static BOOL enum_face_charsets(const Family *family, Face *face, struct enum_charset_list *list,
+static BOOL enum_face_charsets(const Family *family, Face *face, const struct enum_charset_list *list,
                                FONTENUMPROCW proc, LPARAM lparam)
 {
     ENUMLOGFONTEXW elf;
@@ -5106,9 +5108,9 @@ static BOOL enum_face_charsets(const Family *family, Face *face, struct enum_cha
 /*************************************************************
  * freetype_EnumFonts
  */
-static BOOL freetype_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lparam )
+static BOOL freetype_EnumFonts( const PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lparam )
 {
-    Family *family;
+    const Family *family;
     Face *face;
     const struct list *family_elem_ptr, *face_list, *face_elem_ptr;
     LOGFONTW lf;
@@ -5164,7 +5166,7 @@ static BOOL freetype_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc,
     return TRUE;
 }
 
-static void FTVectorToPOINTFX(FT_Vector *vec, POINTFX *pt)
+static void FTVectorToPOINTFX(const FT_Vector *vec, POINTFX *pt)
 {
     pt->x.value = vec->x >> 6;
     pt->x.fract = (vec->x & 0x3f) << 10;
@@ -5473,7 +5475,7 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph)
  */
 static DWORD freetype_GetGlyphIndices( PHYSDEV dev, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
     int i;
     WORD default_char;
     BOOL got_default = FALSE;
@@ -6407,7 +6409,7 @@ static BOOL get_text_metrics(GdiFont *font, LPTEXTMETRICW ptm)
     return TRUE;
 }
 
-static BOOL face_has_symbol_charmap(FT_Face ft_face)
+static BOOL face_has_symbol_charmap(const FT_Face ft_face)
 {
     int i;
 
@@ -6424,13 +6426,13 @@ static BOOL get_outline_text_metrics(GdiFont *font)
     BOOL ret = FALSE;
     FT_Face ft_face = font->ft_face;
     UINT needed, lenfam, lensty;
-    TT_OS2 *pOS2;
-    TT_HoriHeader *pHori;
-    TT_Postscript *pPost;
+    const TT_OS2 *pOS2;
+    const TT_HoriHeader *pHori;
+    const TT_Postscript *pPost;
     FT_Fixed x_scale, y_scale;
     WCHAR *family_nameW, *style_nameW;
     static const WCHAR spaceW[] = {' ', '\0'};
-    char *cp;
+    const char *cp;
     INT ascent, descent;
 
     TRACE("font=%p\n", font);
@@ -6729,7 +6731,7 @@ end:
 static DWORD freetype_GetGlyphOutline( PHYSDEV dev, UINT glyph, UINT format,
                                        LPGLYPHMETRICS lpgm, DWORD buflen, LPVOID buf, const MAT2 *lpmat )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
     DWORD ret;
 
     if (!physdev->font)
@@ -6750,7 +6752,7 @@ static DWORD freetype_GetGlyphOutline( PHYSDEV dev, UINT glyph, UINT format,
  */
 static BOOL freetype_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
     BOOL ret;
 
     if (!physdev->font)
@@ -6771,7 +6773,7 @@ static BOOL freetype_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics )
  */
 static UINT freetype_GetOutlineTextMetrics( PHYSDEV dev, UINT cbSize, OUTLINETEXTMETRICW *potm )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
     UINT ret = 0;
 
     if (!physdev->font)
@@ -6872,7 +6874,7 @@ static BOOL freetype_GetCharWidth( PHYSDEV dev, UINT firstChar, UINT lastChar, L
     GLYPHMETRICS gm;
     FT_UInt glyph_index;
     GdiFont *linked_font;
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -6904,7 +6906,7 @@ static BOOL freetype_GetCharABCWidths( PHYSDEV dev, UINT firstChar, UINT lastCha
     GLYPHMETRICS gm;
     FT_UInt glyph_index;
     GdiFont *linked_font;
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -6940,7 +6942,7 @@ static BOOL freetype_GetCharABCWidthsI( PHYSDEV dev, UINT firstChar, UINT count,
     GLYPHMETRICS gm;
     FT_UInt glyph_index;
     GdiFont *linked_font;
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -6991,7 +6993,7 @@ static BOOL freetype_GetTextExtentExPoint( PHYSDEV dev, LPCWSTR wstr, INT count,
     TEXTMETRICW tm;
     FT_UInt glyph_index;
     GdiFont *linked_font;
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -7040,7 +7042,7 @@ static BOOL freetype_GetTextExtentExPointI( PHYSDEV dev, const WORD *indices, IN
     INT nfit = 0, ext;
     GLYPHMETRICS gm;
     TEXTMETRICW tm;
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -7081,7 +7083,7 @@ static BOOL freetype_GetTextExtentExPointI( PHYSDEV dev, const WORD *indices, IN
  */
 static DWORD freetype_GetFontData( PHYSDEV dev, DWORD table, DWORD offset, LPVOID buf, DWORD cbData )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -7102,7 +7104,7 @@ static DWORD freetype_GetFontData( PHYSDEV dev, DWORD table, DWORD offset, LPVOI
 static INT freetype_GetTextFace( PHYSDEV dev, INT count, LPWSTR str )
 {
     INT n;
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -7124,7 +7126,7 @@ static INT freetype_GetTextFace( PHYSDEV dev, INT count, LPWSTR str )
  */
 static UINT freetype_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD flags )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!physdev->font)
     {
@@ -7138,7 +7140,7 @@ static UINT freetype_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD
 BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph)
 {
     GdiFont *font = dc->gdiFont, *linked_font;
-    struct list *first_hfont;
+    const struct list *first_hfont;
     BOOL ret;
 
     GDI_CheckNotLock();
@@ -7160,7 +7162,7 @@ BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph)
  * Can be called with NULL gs to calculate the buffer size. Returns
  * the number of ranges found.
  */
-static DWORD get_font_unicode_ranges(FT_Face face, GLYPHSET *gs)
+static DWORD get_font_unicode_ranges(const FT_Face face, GLYPHSET *gs)
 {
     DWORD num_ranges = 0;
 
@@ -7222,7 +7224,7 @@ static DWORD get_font_unicode_ranges(FT_Face face, GLYPHSET *gs)
  */
 static DWORD freetype_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphset )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
     DWORD size, num_ranges;
 
     if (!physdev->font)
@@ -7247,7 +7249,7 @@ static DWORD freetype_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphset )
  */
 static BOOL freetype_FontIsLinked( PHYSDEV dev )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
     BOOL ret;
 
     if (!physdev->font)
@@ -7330,7 +7332,7 @@ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
  */
 static BOOL freetype_GdiRealizationInfo( PHYSDEV dev, void *ptr )
 {
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
     realization_info_t *info = ptr;
 
     if (!physdev->font)
@@ -7457,7 +7459,7 @@ static DWORD freetype_GetKerningPairs( PHYSDEV dev, DWORD cPairs, KERNINGPAIR *k
     USHORT i, nTables;
     USHORT *glyph_to_char;
     GdiFont *font;
-    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    const struct freetype_physdev * const physdev = get_freetype_dev( dev );
 
     if (!(font = physdev->font))
     {
-- 
1.7.9.5




More information about the wine-patches mailing list