patch #977897 by Anders - IntOp shr & shl

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3576 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-06-25 15:24:20 +00:00
parent d05b8bc6ad
commit d1f241e6c8
3 changed files with 9 additions and 5 deletions

View file

@ -648,6 +648,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case 8: v=v||v2; break;
case 9: v=v&&v2; break;
case 10: if (v2) v%=v2; else { v=0; exec_error++; } break;
case 11: v=v<<v2; break;
case 12: v=v>>v2; break;
}
myitoa(p,v);
}

View file

@ -4566,11 +4566,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_INTOP:
ent.which=EW_INTOP;
ent.offsets[0]=GetUserVarIndex(line, 1);
ent.offsets[3]=line.gettoken_enum(3,"+\0-\0*\0/\0|\0&\0^\0!\0||\0&&\0%\0~\0");
if (ent.offsets[0] < 0 || ent.offsets[3]<0 || ((ent.offsets[3] == 7 || ent.offsets[3]==11) && line.getnumtokens()>4)) PRINTHELP()
ent.offsets[3]=line.gettoken_enum(3,"+\0-\0*\0/\0|\0&\0^\0!\0||\0&&\0%\0<<\0>>\0~\0");
if (ent.offsets[0] < 0 || ent.offsets[3] < 0 ||
((ent.offsets[3] == 7 || ent.offsets[3] == 13) && line.getnumtokens() > 4))
PRINTHELP()
ent.offsets[1]=add_string(line.gettoken_str(2));
if (ent.offsets[3] != 7 && ent.offsets[3] != 11) ent.offsets[2]=add_string(line.gettoken_str(4));
if (ent.offsets[3] == 11) {
if (ent.offsets[3] != 7 && ent.offsets[3] != 13) ent.offsets[2]=add_string(line.gettoken_str(4));
if (ent.offsets[3] == 13) {
ent.offsets[3]=6;
ent.offsets[2]=add_string("0xFFFFFFFF");
}

View file

@ -106,7 +106,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_INSTDIR,"InstallDir",1,0,"default_install_directory",TP_GLOBAL},
{TOK_INSTPROGRESSFLAGS,"InstProgressFlags",0,-1,"[flag [...]]\n flag={smooth|colored}",TP_GLOBAL},
{TOK_INSTTYPE,"InstType",1,0,"[un.]install_type_name | /NOCUSTOM | /CUSTOMSTRING=str | /COMPONENTSONLYONCUSTOM",TP_GLOBAL},
{TOK_INTOP,"IntOp",3,1,"$(user_var: result) val1 OP [val2]\n OP=(+ - * / % | & ^ ~ ! || &&)",TP_CODE},
{TOK_INTOP,"IntOp",3,1,"$(user_var: result) val1 OP [val2]\n OP=(+ - * / % | & ^ ~ ! || && << >>)",TP_CODE},
{TOK_INTCMP,"IntCmp",3,2,"val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more]",TP_CODE},
{TOK_INTCMPU,"IntCmpU",3,2,"val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more]",TP_CODE},
{TOK_INTFMT,"IntFmt",3,0,"$(user_var: output) format_string input",TP_CODE},