Fix some compiler warnings

This commit is contained in:
Kovid Goyal 2019-09-11 17:22:31 +05:30
parent 043f9a5b88
commit 1b679ae5c8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -61,15 +61,6 @@ static void show_zip_error(LPCWSTR preamble, LPCWSTR msg, ZRESULT code) {
LocalFree(buf); LocalFree(buf);
} }
static void show_last_error_crt(LPCWSTR preamble) {
WCHAR buf[BUFSIZE];
int err = 0;
_get_errno(&err);
_wcserror_s(buf, BUFSIZE, err);
show_detailed_error(preamble, buf, err);
}
static void show_last_error(LPCWSTR preamble) { static void show_last_error(LPCWSTR preamble) {
WCHAR *msg = NULL; WCHAR *msg = NULL;
DWORD dw = GetLastError(); DWORD dw = GetLastError();
@ -444,7 +435,7 @@ static BOOL move_program() {
} }
// }}} // }}}
static BOOL ensure_not_running(LPCWSTR dest) { static BOOL ensure_not_running() {
DWORD processes[4096], needed, num; DWORD processes[4096], needed, num;
unsigned int i; unsigned int i;
WCHAR name[4*MAX_PATH] = L"<unknown>"; WCHAR name[4*MAX_PATH] = L"<unknown>";
@ -514,7 +505,7 @@ void makedirs(LPWSTR path) {
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{ {
(void)hPrevInstance; (void)pCmdLine; (void)nCmdShow;
LPVOID cdata = NULL; LPVOID cdata = NULL;
DWORD csz = 0; DWORD csz = 0;
int ret = 1, argc; int ret = 1, argc;
@ -584,7 +575,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
} }
if (existing) { if (existing) {
if (!ensure_not_running(fdest)) goto end; if (!ensure_not_running()) goto end;
} }
// Make a temp dir to unpack into // Make a temp dir to unpack into
@ -614,5 +605,3 @@ end:
if (launch) launch_calibre(); if (launch) launch_calibre();
return ret; return ret;
} }