tabs to spaces

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2713 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-07-12 15:19:49 +00:00
parent 3f697a1217
commit e6dd2ada8a
17 changed files with 196 additions and 197 deletions

View file

@ -36,15 +36,15 @@ LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
while (r.top < ry)
{
int rv,gv,bv;
HBRUSH brush;
HBRUSH brush;
rv = (GetRValue(c2) * r.top + GetRValue(c1) * (ry-r.top)) / ry;
gv = (GetGValue(c2) * r.top + GetGValue(c1) * (ry-r.top)) / ry;
bv = (GetBValue(c2) * r.top + GetBValue(c1) * (ry-r.top)) / ry;
brush = CreateSolidBrush(RGB(rv,gv,bv));
// note that we don't need to do "SelectObject(hdc, brush)"
// because FillRect lets us specify the brush as a parameter.
FillRect(hdc, &r, brush);
DeleteObject(brush);
brush = CreateSolidBrush(RGB(rv,gv,bv));
// note that we don't need to do "SelectObject(hdc, brush)"
// because FillRect lets us specify the brush as a parameter.
FillRect(hdc, &r, brush);
DeleteObject(brush);
r.top+=4;
r.bottom+=4;
}

View file

@ -32,25 +32,25 @@ union installer_flags g_flags;
// but in win2k you need to do this manually.
static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyifempty)
{
HKEY key;
int retval=RegOpenKeyEx(thiskey,lpSubKey,0,KEY_ENUMERATE_SUB_KEYS,&key);
if (retval==ERROR_SUCCESS)
{
HKEY key;
int retval=RegOpenKeyEx(thiskey,lpSubKey,0,KEY_ENUMERATE_SUB_KEYS,&key);
if (retval==ERROR_SUCCESS)
{
// NB - don't change this to static (recursive function)
char buffer[MAX_PATH+1];
while (RegEnumKey(key,0,buffer,MAX_PATH+1)==ERROR_SUCCESS)
char buffer[MAX_PATH+1];
while (RegEnumKey(key,0,buffer,MAX_PATH+1)==ERROR_SUCCESS)
{
if (onlyifempty)
{
RegCloseKey(key);
RegCloseKey(key);
return !ERROR_SUCCESS;
}
if ((retval=myRegDeleteKeyEx(key,buffer,0)) != ERROR_SUCCESS) break;
}
RegCloseKey(key);
retval=RegDeleteKey(thiskey,lpSubKey);
}
return retval;
RegCloseKey(key);
retval=RegDeleteKey(thiskey,lpSubKey);
}
return retval;
}
#endif//NSIS_SUPPORT_REGISTRYFUNCTIONS
@ -454,26 +454,26 @@ static int NSISCALL ExecuteEntry(entry *entry_)
}
#undef overwriteflag
// Added by ramon 23 May 2003
#undef allowskipfilesflag
// Added by ramon 23 May 2003
#undef allowskipfilesflag
}
break;
#endif//NSIS_SUPPORT_FILE
#ifdef NSIS_SUPPORT_DELETE
case EW_DELETEFILE:
{
HANDLE h;
WIN32_FIND_DATA fd;
HANDLE h;
WIN32_FIND_DATA fd;
char *buf1=process_string_fromparm_tobuf(0x10);
mystrcpy(buf0,buf1);
log_printf2("Delete: \"%s\"",buf0);
trimslashtoend(buf0);
h=FindFirstFile(buf1,&fd);
if (h != INVALID_HANDLE_VALUE)
{
if (h != INVALID_HANDLE_VALUE)
{
do
{
if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
wsprintf(buf1,"%s\\%s",buf0,fd.cFileName);
if (fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
@ -503,8 +503,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
}
}
} while (FindNextFile(h,&fd));
FindClose(h);
}
FindClose(h);
}
}
break;
#endif//NSIS_SUPPORT_DELETE
@ -1038,12 +1038,12 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_COPYFILES: // CopyFile (added by NOP)
{
int res;
SHFILEOPSTRUCT op;
SHFILEOPSTRUCT op;
char *buf0=process_string_fromparm_tobuf(0x00);
char *buf1=process_string_fromparm_tobuf(0x11);
log_printf3("CopyFiles \"%s\"->\"%s\"",buf0,buf1);
op.hwnd=g_hwnd;
op.wFunc=FO_COPY;
op.hwnd=g_hwnd;
op.wFunc=FO_COPY;
buf0[mystrlen(buf0)+1]=0;
buf1[mystrlen(buf1)+1]=0;
@ -1052,16 +1052,16 @@ static int NSISCALL ExecuteEntry(entry *entry_)
op.pFrom=buf0;
op.pTo=buf1;
op.lpszProgressTitle=buf2;
op.fFlags=parm2;
op.fFlags=parm2;
update_status_text("",buf2);
res=SHFileOperation(&op);
if (res)
res=SHFileOperation(&op);
if (res)
{ // some of these changes were from Edgewise (wiked_edge@yahoo.com)
update_status_text_from_lang(LANG_COPYFAILED,"");
g_flags.exec_error++;
}
}
break;
}
}
break;
#endif//NSIS_SUPPORT_COPYFILES
#ifdef NSIS_SUPPORT_REBOOT
case EW_REBOOT:
@ -1219,8 +1219,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
p[0]=0;
if (RegOpenKeyEx((HKEY)rootkey,buf0,0,KEY_READ,&hKey) == ERROR_SUCCESS)
{
DWORD l = NSIS_MAX_STRLEN;
DWORD t;
DWORD l = NSIS_MAX_STRLEN;
DWORD t;
if (RegQueryValueEx(hKey,buf1,NULL,&t,p,&l ) != ERROR_SUCCESS ||
(t != REG_DWORD && t != REG_SZ && t != REG_EXPAND_SZ))

View file

@ -457,7 +457,7 @@ typedef struct
typedef struct
{
int which;
int offsets[MAX_ENTRY_OFFSETS]; // count and meaning of offsets depend on 'which'
int offsets[MAX_ENTRY_OFFSETS]; // count and meaning of offsets depend on 'which'
} entry;
enum

View file

@ -144,15 +144,15 @@ void NSISCALL trimslashtoend(char *buf)
char * NSISCALL scanendslash(const char *str)
{
char *s=CharPrev(str,str+mystrlen(str));
if (!*str) return (char*)str-1;
for (;;)
{
if (!*str) return (char*)str-1;
for (;;)
{
char *t;
if ('\\' == *s) return s;
t=CharPrev(str,s);
if (t==s) return (char*)str-1;
s=t;
}
if ('\\' == *s) return s;
t=CharPrev(str,s);
if (t==s) return (char*)str-1;
s=t;
}
}
int NSISCALL validpathspec(char *ubuf)
@ -326,12 +326,12 @@ BOOL NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
void NSISCALL myRegGetStr(HKEY root, const char *sub, const char *name, char *out)
{
HKEY hKey;
HKEY hKey;
*out=0;
if (RegOpenKeyEx(root,sub,0,KEY_READ,&hKey) == ERROR_SUCCESS)
{
DWORD l = NSIS_MAX_STRLEN;
DWORD t;
DWORD l = NSIS_MAX_STRLEN;
DWORD t;
if (RegQueryValueEx(hKey,name,NULL,&t,out,&l ) != ERROR_SUCCESS || (t != REG_SZ && t != REG_EXPAND_SZ)) *out=0;
out[NSIS_MAX_STRLEN-1]=0;
RegCloseKey(hKey);
@ -424,11 +424,11 @@ char * NSISCALL process_string(const char *in)
#ifndef NSIS_SUPPORT_NAMED_USERVARS
if (nVarIdx < VAR_CODES_START)
{
*out++ = nVarIdx;
*out++ = nVarIdx;
}
else if (nVarIdx == 255)
{
*out++ = *in++;
*out++ = *in++;
}
else
{
@ -544,7 +544,7 @@ char * NSISCALL process_string(const char *in)
if (nVarIdx == 255)
{
*out++ = *in++;
*out++ = *in++;
}
else if (nVarIdx == VAR_CODES_START)
{
@ -634,7 +634,7 @@ char * NSISCALL process_string(const char *in)
#endif
else // Normal char
{
*out++ = nVarIdx;
*out++ = nVarIdx;
}
#endif
} // while

View file

@ -67,8 +67,8 @@ void * NSISCALL mini_memcpy(void *out, const void *in, int len);
// Turn four chars into a dword
#ifdef __BIG_ENDIAN__ // Not very likely, but, still...
#define CHAR2_TO_WORD(a,b) (((WORD)(b))|((a)<<8))
#define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(c,d))|(CHAR2_TO_WORD(a,b)<<16))
#define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(c,d))|(CHAR2_TO_WORD(a,b)<<16))
#else
#define CHAR2_TO_WORD(a,b) (((WORD)(a))|((b)<<8))
#define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(a,b))|(CHAR2_TO_WORD(c,d)<<16))
#define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(a,b))|(CHAR2_TO_WORD(c,d)<<16))
#endif