Instant saving of 0.5K - use of stdcall calling convention to

reduce code overhead associated with managing the stack


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@694 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
eccles 2002-08-19 23:18:19 +00:00
parent 7a2cf3e5b8
commit 34db30b2ce
17 changed files with 154 additions and 118 deletions

View file

@ -39,7 +39,7 @@ char plugins_temp_dir[NSIS_MAX_STRLEN]="";
extern HWND m_curwnd;
static WIN32_FIND_DATA *file_exists(char *buf)
static WIN32_FIND_DATA * NSISCALL file_exists(char *buf)
{
HANDLE h;
static WIN32_FIND_DATA fd;
@ -56,7 +56,7 @@ static WIN32_FIND_DATA *file_exists(char *buf)
// based loosely on code from Tim Kosse
// in win9x this isn't necessary (RegDeleteKey() can delete a tree of keys),
// but in win2k you need to do this manually.
static LONG myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyifempty)
static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyifempty)
{
HKEY key;
int retval=RegOpenKeyEx(thiskey,lpSubKey,0,KEY_ALL_ACCESS,&key);
@ -82,15 +82,15 @@ static LONG myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyifempty)
extern char g_all_user_var_flag;
static int ExecuteEntry(entry *entries, int pos);
static int NSISCALL ExecuteEntry(entry *entries, int pos);
static int resolveaddr(int v)
static int NSISCALL resolveaddr(int v)
{
if (v<0) return myatoi(g_usrvars[-(v+1)]); // if <0, that means we
return v;
}
int ExecuteCodeSegment(entry *entries, int pos, HWND hwndProgress)
int NSISCALL ExecuteCodeSegment(entry *entries, int pos, HWND hwndProgress)
{
while (pos >= 0)
{
@ -124,7 +124,7 @@ int ExecuteCodeSegment(entry *entries, int pos, HWND hwndProgress)
// returns EXEC_ERROR on error
// returns 0, advance position by 1
// otherwise, returns new_position+1
static int ExecuteEntry(entry *entries, int pos)
static int NSISCALL ExecuteEntry(entry *entries, int pos)
{
static char buf[NSIS_MAX_STRLEN],buf2[NSIS_MAX_STRLEN],buf3[NSIS_MAX_STRLEN],buf4[NSIS_MAX_STRLEN];
int *parms=entries[pos].offsets;
@ -1301,7 +1301,7 @@ static int ExecuteEntry(entry *entries, int pos)
log_printf2("settings logging to %d",parms[1]);
log_dolog=parms[1];
log_printf2("logging set to %d",parms[1]);
if (!g_log_file && log_dolg) build_g_logfile();
if (!g_log_file && log_dolog) build_g_logfile();
}
else
{