gdi32/freetype: Properly handle loading of FT_Long-sized types (Valgrind)

Nikolay Sivov nsivov at codeweavers.com
Sun Jun 21 02:21:52 CDT 2015


On 06/21/2015 10:18 AM, Marc Bessières wrote:
> Hi Nicolay,
>
> May I ask you a question on your patch?
>
> Why is the last line of the below extract still using reg_load_dword, and not
> reg_load_ftlong, while the cast was removed?
> It doesn't seem good to me, or there is something special about the flags?
>
> Cheers,
> Marc
>
> @@ -1541,10 +1549,10 @@ static void load_face(HKEY hkey_face, WCHAR
> *face_name, Family *family, void *bu
>           else
>               face->FullName = NULL;
>
> -        reg_load_dword(hkey_face, face_index_value, (DWORD*)&face-
>> face_index);
> +        reg_load_ftlong(hkey_face, face_index_value, &face->face_index);
>           reg_load_dword(hkey_face, face_ntmflags_value, &face->ntmFlags);
> -        reg_load_dword(hkey_face, face_version_value, (DWORD*)&face-
>> font_version);
> -        reg_load_dword(hkey_face, face_flags_value, (DWORD*)&face->flags);
> +        reg_load_ftlong(hkey_face, face_version_value, &face->font_version);
> +        reg_load_dword(hkey_face, face_flags_value, &face->flags);
>
>
>

Hi, Marc.

The cast was removed because 'flags' is actually DWORD. Take a look at 
Face definition:

---
typedef struct tagFace {
...
     DWORD flags;          /* ADDFONT flags */
...
---



More information about the wine-devel mailing list