From 31a9a495022fe5ab8ec8219fccdbd1d653f98c2a Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 21 Sep 2007 18:20:12 +0000 Subject: [PATCH] size optimization - better values for status_update git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5280 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 2 +- Source/exehead/Ui.c | 8 ++------ Source/script.cpp | 19 +++++++------------ 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index dae78728..1b6e1688 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -3216,7 +3216,7 @@ again: zero_offset=add_string("$0"); // SetDetailsPrint none - ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), add_intstring(16)); + ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), add_intstring(6)); if (ret != PS_OK) return ret; // StrCmp $PLUGINSDIR "" diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index d1e9cda4..7f9ce035 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -262,10 +262,6 @@ FORCE_INLINE int NSISCALL ui_doinstall(void) mystrcat(state_language, g_tmp); } - // initialize status update (SetDetailsPrint) flag - g_exec_flags.status_update = 6; - g_exec_flags_last_used.status_update = 6; - // set default language set_language(); @@ -1474,8 +1470,8 @@ void NSISCALL update_status_text(int strtab, const char *text) { mystrcat(tmp, text); } - if ((updateflag & 4)) my_SetWindowText(insthwnd2, tmp); - if ((updateflag & 2)) + if ((updateflag & 4) == 0) my_SetWindowText(insthwnd2, tmp); + if ((updateflag & 2) == 0) { new_item.mask = LVIF_TEXT; new_item.pszText = tmp; diff --git a/Source/script.cpp b/Source/script.cpp index 90bb1ca7..05b583f4 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -4559,24 +4559,19 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) { ent.which=EW_SETFLAG; ent.offsets[0]=FLAG_OFFSET(status_update); - int k=line.gettoken_enum(1,"lastused\0listonly\0textonly\0both\0none\0"); + int k=line.gettoken_enum(1,"both\0textonly\0listonly\0none\0lastused\0"); if (k<0) PRINTHELP() - if (k == 0) + if (k == 4) { ent.offsets[2]=1; } else { - if (k == 4) - { - k = 16; - } - else - { - k <<= 1; - } - - ent.offsets[1]=add_intstring(k); + // both 0 + // textonly 2 + // listonly 4 + // none 6 + ent.offsets[1]=add_intstring(k*2); } SCRIPT_MSG("SetDetailsPrint: %s\n",line.gettoken_str(1)); }