V3 has been posted. Other comments are inlined below...
Hi,
thanks, but it seems I missed minor things last time:
- args = heap_alloc(sizeof(VARIANT) * cActuals + sizeof(DWORD) * 4 );
Try to be consistent with the spaces for each function call.
Sorry. That one came from a cut-and-paste of the i386 code and I missed fixing it.
case VT_R4: /* these must be 4-byte aligned, and put in 's' regs or stack, as they are single-floats */
if (scount < 16)
regs.sd.s[scount++] = V_R4(arg);
else
args[argspos++] = V_UI4(arg);
break;
...
case VT_VARIANT:
/* 8-byte align 'r' and/or stack: */
if (rcount < 3)
{
rcount += (rcount % 2);
}
else
{
rcount = 4;
argspos += (argspos % 2);
}
...
case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */
if (rcount < 4)
regs.r[rcount++] = V_BOOL(arg);
else
args[argspos++] = V_BOOL(arg);
break;
default:
if (rcount < 4)
regs.r[rcount++] = V_UI4(arg);
else
args[argspos++] = V_UI4(arg);
break;
}
Maybe one of those is not really conistent wrt curly brackets
That was actually intentional, as I made the 'if' in the VT_VARIANT case consistent with itself. All of the others cited needed no curly braces on either half of the 'if'. However, that one had to have curly braces on the 'else', so I made it consistent on the other side too and used curly braces throughout the 'if'. My usage of curly braces with respect to 'if' statements was to use them on both halves or neither half...
But since you want them removed, I have removed the extra curly braces on that one in the v3 post.
- case VT_CY:
V_UI8(pvargResult) = call_method(func, argspos, args, (DWORD*)®s );
break;
- default:
V_UI4(pvargResult) = call_method( func, argspos, args, (DWORD*)®s );
break;
space issue again, maybe somewhere else too?
Oops, I missed that one space. Fixed. I didn't spot any others. The rest appear correct or are at least consistent throughout.