Added Int64Fmt

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6931 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2017-10-15 16:57:26 +00:00
parent 1a039ca71f
commit 8de72ec7b1
8 changed files with 30 additions and 17 deletions

View file

@ -683,7 +683,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
#ifdef NSIS_SUPPORT_INTOPTS
case EW_INTCMP:
{
UINT supp64=sizeof(void*) > 4, opu=supp64 ? (BYTE) parm5 : parm5, op64=supp64 ? (INT16) parm5 < 0 : FALSE;
UINT supp64=sizeof(void*) > 4, opu=supp64 ? (BYTE) parm5 : parm5, op64=supp64 ? (SHORT) parm5 < 0 : FALSE;
INT_PTR v=GetIntPtrFromParm(0), v2=GetIntPtrFromParm(1); // Note: This needs to be INT64 if supp64 is ever set to true for 32-bit builds!
if (!opu) { // signed:
if (op64) {
@ -735,9 +735,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
break;
case EW_INTFMT: {
TCHAR *buf0=GetStringFromParm(0x01);
wsprintf(var0,
buf0,
GetIntPtrFromParm(2)); // TODO: BUGBUG64: This sign-extends from INT32 to INT64, do we want that?
INT_PTR val=GetIntPtrFromParm(2), op64=sizeof(void*) > 4 && parm3;
wsprintf(var0,buf0,op64 ? val : (UINT)val);
}
break;
#endif//NSIS_SUPPORT_INTOPTS

View file

@ -98,7 +98,7 @@ enum
#ifdef NSIS_SUPPORT_INTOPTS
EW_INTCMP, // IntCmp: 6 [val1, val2, equal, val1<val2, val1>val2, flags] where flags: bit 0x01 is set for unsigned operations and bit 0x8000 is set for 64-bit operations
EW_INTOP, // IntOp: 4 [output, input1, input2, op] where op: 0=add, 1=sub, 2=mul, 3=div, 4=bor, 5=band, 6=bxor, 7=bnot input1, 8=lor, 9=land 10=mod, 11=shl, 12=sar, 13=shr (bneg is implemented with bxor in compiler)
EW_INTFMT, // IntFmt: [output, format, input]
EW_INTFMT, // IntFmt: 4 [output, format, input, 64-bit]
#endif
#ifdef NSIS_SUPPORT_STACK
EW_PUSHPOP, // Push/Pop/Exchange: 3 [variable/string, ?pop:push, ?exch]

View file

@ -507,7 +507,7 @@ HRESULT NSISCALL UTF16LEBOM(HANDLE h, INT_PTR ForWrite)
if (0 == orgpos)
{
BYTE bom[2];
if (myReadFile(h, bom, 2) && (0xfeff == *(UINT16*) &bom[0]))
if (myReadFile(h, bom, 2) && (0xfeff == *(USHORT*) &bom[0]))
{
return S_OK;
}