kernel32: Use FIELD_OFFSET instead of pointer cast.

This commit is contained in:
Gerald Pfeifer 2007-10-14 13:18:29 +02:00 committed by Alexandre Julliard
parent 3ab66cd00f
commit 1a0f1bc6ce
2 changed files with 5 additions and 5 deletions

View file

@ -174,7 +174,7 @@ static void call_timer_proc16( WORD timer )
context.SegGs = wine_get_gs();
context.SegCs = SELECTOROF( proc );
context.Eip = OFFSETOF( proc );
context.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + (WORD)&((STACK16FRAME*)0)->bp;
context.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp);
context.Eax = timer;
WOWCallback16Ex( 0, WCB16_REGS, 0, NULL, (DWORD *)&context );

View file

@ -462,7 +462,7 @@ void WINAPI __regs_QT_Thunk( CONTEXT86 *context )
context16.Eip = LOWORD(context->Edx);
/* point EBP to the STACK16FRAME on the stack
* for the call_to_16 to set up the register content on calling */
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + (WORD)&((STACK16FRAME*)0)->bp;
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp);
/*
* used to be (problematic):
@ -594,7 +594,7 @@ void WINAPI __regs_FT_Thunk( CONTEXT86 *context )
context16.SegGs = wine_get_gs();
context16.SegCs = HIWORD(callTarget);
context16.Eip = LOWORD(callTarget);
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + (WORD)&((STACK16FRAME*)0)->bp;
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp);
argsize = context->Ebp-context->Esp-0x40;
if (argsize > sizeof(newstack)) argsize = sizeof(newstack);
@ -760,7 +760,7 @@ void WINAPI __regs_Common32ThkLS( CONTEXT86 *context )
context16.Edi = LOWORD(context->Ecx);
context16.SegCs = HIWORD(context->Eax);
context16.Eip = LOWORD(context->Eax);
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + (WORD)&((STACK16FRAME*)0)->bp;
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp);
argsize = HIWORD(context->Edx) * 4;
@ -820,7 +820,7 @@ void WINAPI __regs_OT_32ThkLSF( CONTEXT86 *context )
context16.SegGs = wine_get_gs();
context16.SegCs = HIWORD(context->Edx);
context16.Eip = LOWORD(context->Edx);
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + (WORD)&((STACK16FRAME*)0)->bp;
context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp);
argsize = 2 * *(WORD *)context->Esp + 2;