Commit 7f9b9df0 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

cmd: Enable compilation with long types.

parent 439600d5
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = cmd.exe MODULE = cmd.exe
IMPORTS = shell32 user32 advapi32 IMPORTS = shell32 user32 advapi32
......
...@@ -344,7 +344,7 @@ void WCMD_choice (const WCHAR * args) { ...@@ -344,7 +344,7 @@ void WCMD_choice (const WCHAR * args) {
} }
if (opt_timeout) if (opt_timeout)
WINE_FIXME("timeout not supported: %c,%d\n", opt_default, opt_timeout); WINE_FIXME("timeout not supported: %c,%ld\n", opt_default, opt_timeout);
if (have_console) if (have_console)
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), 0); SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), 0);
...@@ -396,7 +396,7 @@ void WCMD_choice (const WCHAR * args) { ...@@ -396,7 +396,7 @@ void WCMD_choice (const WCHAR * args) {
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode); SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode);
errorlevel = (ptr - opt_c) + 1; errorlevel = (ptr - opt_c) + 1;
WINE_TRACE("answer: %d\n", errorlevel); WINE_TRACE("answer: %ld\n", errorlevel);
heap_free(my_command); heap_free(my_command);
return; return;
} }
...@@ -427,12 +427,12 @@ static BOOL WCMD_AppendEOF(WCHAR *filename) ...@@ -427,12 +427,12 @@ static BOOL WCMD_AppendEOF(WCHAR *filename)
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (h == INVALID_HANDLE_VALUE) { if (h == INVALID_HANDLE_VALUE) {
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(filename), GetLastError()); WINE_ERR("Failed to open %s (%ld)\n", wine_dbgstr_w(filename), GetLastError());
return FALSE; return FALSE;
} else { } else {
SetFilePointer (h, 0, NULL, FILE_END); SetFilePointer (h, 0, NULL, FILE_END);
if (!WriteFile(h, &eof, 1, &bytes_written, NULL)) { if (!WriteFile(h, &eof, 1, &bytes_written, NULL)) {
WINE_ERR("Failed to append EOF to %s (%d)\n", wine_dbgstr_w(filename), GetLastError()); WINE_ERR("Failed to append EOF to %s (%ld)\n", wine_dbgstr_w(filename), GetLastError());
CloseHandle(h); CloseHandle(h);
return FALSE; return FALSE;
} }
...@@ -491,7 +491,7 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app ...@@ -491,7 +491,7 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app
in = CreateFileW(srcname, GENERIC_READ, 0, NULL, in = CreateFileW(srcname, GENERIC_READ, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (in == INVALID_HANDLE_VALUE) { if (in == INVALID_HANDLE_VALUE) {
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(srcname), GetLastError()); WINE_ERR("Failed to open %s (%ld)\n", wine_dbgstr_w(srcname), GetLastError());
return FALSE; return FALSE;
} }
...@@ -499,7 +499,7 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app ...@@ -499,7 +499,7 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app
out = CreateFileW(dstname, GENERIC_WRITE, 0, NULL, out = CreateFileW(dstname, GENERIC_WRITE, 0, NULL,
append?OPEN_EXISTING:CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); append?OPEN_EXISTING:CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (out == INVALID_HANDLE_VALUE) { if (out == INVALID_HANDLE_VALUE) {
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(dstname), GetLastError()); WINE_ERR("Failed to open %s (%ld)\n", wine_dbgstr_w(dstname), GetLastError());
CloseHandle(in); CloseHandle(in);
return FALSE; return FALSE;
} }
...@@ -526,12 +526,12 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app ...@@ -526,12 +526,12 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app
if (bytesread) { if (bytesread) {
ok = WriteFile(out, buffer, bytesread, &byteswritten, NULL); ok = WriteFile(out, buffer, bytesread, &byteswritten, NULL);
if (!ok || byteswritten != bytesread) { if (!ok || byteswritten != bytesread) {
WINE_ERR("Unexpected failure writing to %s, rc=%d\n", WINE_ERR("Unexpected failure writing to %s, rc=%ld\n",
wine_dbgstr_w(dstname), GetLastError()); wine_dbgstr_w(dstname), GetLastError());
} }
} }
} else { } else {
WINE_ERR("Unexpected failure reading from %s, rc=%d\n", WINE_ERR("Unexpected failure reading from %s, rc=%ld\n",
wine_dbgstr_w(srcname), GetLastError()); wine_dbgstr_w(srcname), GetLastError());
} }
} while (ok && bytesread > 0); } while (ok && bytesread > 0);
...@@ -2442,7 +2442,7 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) { ...@@ -2442,7 +2442,7 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
if (useNumbers) { if (useNumbers) {
WCHAR thisNum[20]; WCHAR thisNum[20];
WINE_TRACE("FOR /L provided range from %d to %d step %d\n", WINE_TRACE("FOR /L provided range from %ld to %ld step %ld\n",
numbers[0], numbers[2], numbers[1]); numbers[0], numbers[2], numbers[1]);
for (i=numbers[0]; for (i=numbers[0];
(numbers[1]<0)? i>=numbers[2] : i<=numbers[2]; (numbers[1]<0)? i>=numbers[2] : i<=numbers[2];
...@@ -4775,7 +4775,7 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) { ...@@ -4775,7 +4775,7 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
/* Open a key to HKEY_CLASSES_ROOT for enumerating */ /* Open a key to HKEY_CLASSES_ROOT for enumerating */
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"", 0, accessOptions, &key) != ERROR_SUCCESS) { if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"", 0, accessOptions, &key) != ERROR_SUCCESS) {
WINE_FIXME("Unexpected failure opening HKCR key: %d\n", GetLastError()); WINE_FIXME("Unexpected failure opening HKCR key: %ld\n", GetLastError());
return; return;
} }
......
...@@ -536,7 +536,7 @@ static void WCMD_dir_trailer(WCHAR drive) { ...@@ -536,7 +536,7 @@ static void WCMD_dir_trailer(WCHAR drive) {
driveName[0] = drive; driveName[0] = drive;
status = GetDiskFreeSpaceExW(driveName, &avail, &total, &freebytes); status = GetDiskFreeSpaceExW(driveName, &avail, &total, &freebytes);
WINE_TRACE("Writing trailer for '%s' gave %d(%d)\n", wine_dbgstr_w(driveName), WINE_TRACE("Writing trailer for '%s' gave %ld(%ld)\n", wine_dbgstr_w(driveName),
status, GetLastError()); status, GetLastError());
if (errorlevel==0 && !bare) { if (errorlevel==0 && !bare) {
...@@ -727,7 +727,7 @@ void WCMD_directory (WCHAR *args) ...@@ -727,7 +727,7 @@ void WCMD_directory (WCHAR *args)
p++; p++;
} }
p = p - 1; /* So when step on, move to '/' */ p = p - 1; /* So when step on, move to '/' */
WINE_TRACE("Result: showattrs %x, bits %x\n", showattrs, attrsbits); WINE_TRACE("Result: showattrs %lx, bits %lx\n", showattrs, attrsbits);
break; break;
default: default:
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
......
...@@ -132,7 +132,7 @@ void WINAPIV WCMD_output (const WCHAR *format, ...) { ...@@ -132,7 +132,7 @@ void WINAPIV WCMD_output (const WCHAR *format, ...) {
format, 0, 0, (LPWSTR)&string, 0, &ap); format, 0, 0, (LPWSTR)&string, 0, &ap);
va_end(ap); va_end(ap);
if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE) if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE)
WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(format)); WINE_FIXME("Could not format string: le=%lu, fmt=%s\n", GetLastError(), wine_dbgstr_w(format));
else else
{ {
WCMD_output_asis_len(string, len, GetStdHandle(STD_OUTPUT_HANDLE)); WCMD_output_asis_len(string, len, GetStdHandle(STD_OUTPUT_HANDLE));
...@@ -157,7 +157,7 @@ void WINAPIV WCMD_output_stderr (const WCHAR *format, ...) { ...@@ -157,7 +157,7 @@ void WINAPIV WCMD_output_stderr (const WCHAR *format, ...) {
format, 0, 0, (LPWSTR)&string, 0, &ap); format, 0, 0, (LPWSTR)&string, 0, &ap);
va_end(ap); va_end(ap);
if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE) if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE)
WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(format)); WINE_FIXME("Could not format string: le=%lu, fmt=%s\n", GetLastError(), wine_dbgstr_w(format));
else else
{ {
WCMD_output_asis_len(string, len, GetStdHandle(STD_ERROR_HANDLE)); WCMD_output_asis_len(string, len, GetStdHandle(STD_ERROR_HANDLE));
...@@ -181,7 +181,7 @@ WCHAR* WINAPIV WCMD_format_string (const WCHAR *format, ...) ...@@ -181,7 +181,7 @@ WCHAR* WINAPIV WCMD_format_string (const WCHAR *format, ...)
format, 0, 0, (LPWSTR)&string, 0, &ap); format, 0, 0, (LPWSTR)&string, 0, &ap);
va_end(ap); va_end(ap);
if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE) { if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE) {
WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(format)); WINE_FIXME("Could not format string: le=%lu, fmt=%s\n", GetLastError(), wine_dbgstr_w(format));
string = (WCHAR*)LocalAlloc(LMEM_FIXED, 2); string = (WCHAR*)LocalAlloc(LMEM_FIXED, 2);
*string = 0; *string = 0;
} }
...@@ -303,7 +303,7 @@ void WCMD_print_error (void) { ...@@ -303,7 +303,7 @@ void WCMD_print_error (void) {
status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error_code, 0, (LPWSTR) &lpMsgBuf, 0, NULL); NULL, error_code, 0, (LPWSTR) &lpMsgBuf, 0, NULL);
if (!status) { if (!status) {
WINE_FIXME ("Cannot display message for error %d, status %d\n", WINE_FIXME ("Cannot display message for error %ld, status %ld\n",
error_code, GetLastError()); error_code, GetLastError());
return; return;
} }
...@@ -1462,7 +1462,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects, ...@@ -1462,7 +1462,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
GetCurrentProcess(), GetCurrentProcess(),
&h, &h,
0, TRUE, DUPLICATE_SAME_ACCESS) == 0) { 0, TRUE, DUPLICATE_SAME_ACCESS) == 0) {
WINE_FIXME("Duplicating handle failed with gle %d\n", GetLastError()); WINE_FIXME("Duplicating handle failed with gle %ld\n", GetLastError());
} }
WINE_TRACE("Redirect %d (%p) to %d (%p)\n", handle, GetStdHandle(idx_stdhandles[idx]), idx, h); WINE_TRACE("Redirect %d (%p) to %d (%p)\n", handle, GetStdHandle(idx_stdhandles[idx]), idx, h);
...@@ -1664,7 +1664,7 @@ WCHAR *WCMD_LoadMessage(UINT id) { ...@@ -1664,7 +1664,7 @@ WCHAR *WCMD_LoadMessage(UINT id) {
static WCHAR msg[2048]; static WCHAR msg[2048];
if (!LoadStringW(GetModuleHandleW(NULL), id, msg, ARRAY_SIZE(msg))) { if (!LoadStringW(GetModuleHandleW(NULL), id, msg, ARRAY_SIZE(msg))) {
WINE_FIXME("LoadString failed with %d\n", GetLastError()); WINE_FIXME("LoadString failed with %ld\n", GetLastError());
lstrcpyW(msg, L"Failed!"); lstrcpyW(msg, L"Failed!");
} }
return msg; return msg;
...@@ -2442,7 +2442,7 @@ int __cdecl wmain (int argc, WCHAR *argvW[]) ...@@ -2442,7 +2442,7 @@ int __cdecl wmain (int argc, WCHAR *argvW[])
/* Pre initialize some messages */ /* Pre initialize some messages */
lstrcpyW(anykey, WCMD_LoadMessage(WCMD_ANYKEY)); lstrcpyW(anykey, WCMD_LoadMessage(WCMD_ANYKEY));
sprintf(osver, "%d.%d.%d", osv.dwMajorVersion, osv.dwMinorVersion, osv.dwBuildNumber); sprintf(osver, "%ld.%ld.%ld", osv.dwMajorVersion, osv.dwMinorVersion, osv.dwBuildNumber);
cmd = WCMD_format_string(WCMD_LoadMessage(WCMD_VERSION), osver); cmd = WCMD_format_string(WCMD_LoadMessage(WCMD_VERSION), osver);
lstrcpyW(version_string, cmd); lstrcpyW(version_string, cmd);
LocalFree(cmd); LocalFree(cmd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment