ieframe: Fix a few incorrect pointer/integer casts on x64.

Michael Stefaniuc mstefani at redhat.com
Wed Aug 31 03:19:59 CDT 2011


Hello Octavian,

in general please use the ULongToHandle*() / HandleToULong() macro
family instead of the explicit casting.

Octavian Voicu wrote:
> ---
>  dlls/ieframe/iexplore.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/dlls/ieframe/iexplore.c b/dlls/ieframe/iexplore.c
> index 99e3003..82c2e79 100644
> --- a/dlls/ieframe/iexplore.c
> +++ b/dlls/ieframe/iexplore.c
> @@ -937,7 +937,7 @@ static HDDEDATA WINAPI dde_proc(UINT type, UINT uFmt, HCONV hConv, HSZ hsz1, HSZ
>      switch(type) {
>      case XTYP_CONNECT:
>          TRACE("XTYP_CONNECT %p\n", hsz1);
> -        return (HDDEDATA)!DdeCmpStringHandles(hsz1, ddestr_openurl);
> +        return (HDDEDATA)(INT_PTR)!DdeCmpStringHandles(hsz1, ddestr_openurl);
>  
>      case XTYP_EXECUTE: {
>          WCHAR *url;
> @@ -961,7 +961,7 @@ static HDDEDATA WINAPI dde_proc(UINT type, UINT uFmt, HCONV hConv, HSZ hsz1, HSZ
>              break;
>          }
>  
> -        ret = (HDDEDATA)open_dde_url(url);
> +        ret = (HDDEDATA)(ULONG_PTR)open_dde_url(url);
This is the only user of open_dde_url() so that helper might as well
return a HDDEDATA instead of an ULONG. But that's something for Jacek to
decide.

>  
>          heap_free(url);
>          return ret;
> @@ -999,7 +999,7 @@ static void init_dde(void)
>      if(!ddestr_openurl)
>          WARN("Failed to create string handle: %u\n", DdeGetLastError(dde_inst));
>  
> -    res = (ULONG)DdeNameService(dde_inst, ddestr_iexplore, 0, DNS_REGISTER);
> +    res = (UINT)(UINT_PTR)DdeNameService(dde_inst, ddestr_iexplore, 0, DNS_REGISTER);
>      if(res != DMLERR_NO_ERROR)
>          WARN("DdeNameService failed: %u\n", res);
>  }

thanks
bye
	michael



More information about the wine-devel mailing list