Fix AssertFail parameter type in Platformwindows.Mod.

This commit is contained in:
David Brown 2016-10-18 18:52:10 +01:00
parent 300b67a572
commit a4c372253b
3 changed files with 34 additions and 34 deletions

View file

@ -130,22 +130,22 @@ extern void Heap_InitHeap();
#define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber
#define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi
#define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread);
#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h)
#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h)
#define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)
#define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n)
#define Platform_err() (INTEGER)GetLastError()
#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)
#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)
#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0)
#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0)
#define Platform_exit(code) ExitProcess((UINT)code)
#define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)
#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h)
#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h)
#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address)
#define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime
#define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n)
#define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);
#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)
#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart
#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)
#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi)
#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart
#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li)
#define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st)
#define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)
#define Platform_getpid() (INTEGER)GetCurrentProcessId()
@ -161,13 +161,13 @@ extern void Heap_InitHeap();
#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_processInfo() PROCESS_INFORMATION pi = {0};
#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)
#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)
#define Platform_seekcur() FILE_CURRENT
#define Platform_seekend() FILE_END
#define Platform_seekset() FILE_BEGIN
#define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n)
#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h)
#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)
#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h)
#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r)
#define Platform_sleep(ms) Sleep((DWORD)ms)
#define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft)
#define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si);
@ -182,7 +182,7 @@ extern void Heap_InitHeap();
#define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL)
#define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL)
#define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)
#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)
#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0)
BOOLEAN Platform_TooManyFiles (int16 e)
{

View file

@ -130,22 +130,22 @@ extern void Heap_InitHeap();
#define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber
#define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi
#define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread);
#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h)
#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h)
#define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)
#define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n)
#define Platform_err() (INTEGER)GetLastError()
#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)
#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)
#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0)
#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0)
#define Platform_exit(code) ExitProcess((UINT)code)
#define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)
#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h)
#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h)
#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address)
#define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime
#define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n)
#define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);
#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)
#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart
#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)
#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi)
#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart
#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li)
#define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st)
#define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)
#define Platform_getpid() (INTEGER)GetCurrentProcessId()
@ -161,13 +161,13 @@ extern void Heap_InitHeap();
#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_processInfo() PROCESS_INFORMATION pi = {0};
#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)
#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)
#define Platform_seekcur() FILE_CURRENT
#define Platform_seekend() FILE_END
#define Platform_seekset() FILE_BEGIN
#define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n)
#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h)
#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)
#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h)
#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r)
#define Platform_sleep(ms) Sleep((DWORD)ms)
#define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft)
#define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si);
@ -182,7 +182,7 @@ extern void Heap_InitHeap();
#define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL)
#define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL)
#define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)
#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)
#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0)
BOOLEAN Platform_TooManyFiles (int16 e)
{

View file

@ -336,7 +336,7 @@ END New;
PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)";
PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((address)h)";
PROCEDURE Close*(h: FileHandle): ErrorCode;
BEGIN
@ -346,7 +346,7 @@ END Close;
PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi";
PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)";
PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((address)h, &bhfi)";
PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime";
PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime";
PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber";
@ -405,7 +405,7 @@ END MTimeAsClock;
PROCEDURE -largeInteger "LARGE_INTEGER li";
PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart";
PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)";
PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((address)h, &li)";
PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode;
BEGIN
@ -417,7 +417,7 @@ END Size;
PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER
"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)";
"(INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)";
PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode;
VAR result: INTEGER; lengthread: SYSTEM.INT32;
@ -436,7 +436,7 @@ END ReadBuf;
PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER
"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)";
"(INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0)";
PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode;
BEGIN
@ -445,7 +445,7 @@ END Write;
PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)";
PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((address)h)";
PROCEDURE Sync*(h: FileHandle): ErrorCode;
BEGIN
@ -455,7 +455,7 @@ END Sync;
PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER)
"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)";
"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r)";
PROCEDURE -seekset(): INTEGER "FILE_BEGIN";
PROCEDURE -seekcur(): INTEGER "FILE_CURRENT";
@ -471,9 +471,9 @@ END Seek;
PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)";
PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((address)h)";
PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER)
"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart";
"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart";
PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode;
VAR rc: INTEGER; oldpos: LONGINT;
@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER);
BEGIN exit(code) END Exit;
PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)';
PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)';
PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((address)Platform_StdOut, s, s__len-1, 0,0)';
PROCEDURE -errc (c: CHAR) 'WriteFile((address)Platform_StdOut, &c, 1, 0,0)';
PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch;
PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln;
@ -575,7 +575,7 @@ BEGIN
exit(SYSTEM.VAL(INTEGER,code));
END Halt;
PROCEDURE AssertFail*(code: LONGINT);
PROCEDURE AssertFail*(code: SYSTEM.INT32);
BEGIN
errstring("Assertion failure.");
IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END;