mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 11:02:24 +00:00
Tidy (#41)
* Deduplicate common constants into OPM and do some source format tidying. * Fix postpush buildall script to force checkout of updated buildall. * Show enlistment branch in makefiles * Support non-printables in string literals and tidy case alignment and constant literals. * Common code for MIN and MAX of integer types. * Common code for SInt/Int/LInt in ConstOp parameter preparation. * Common code for SInt/Int/LInt in Op parameter preparation. * Refactor SetIntType to work with byte size directly. Prepare to revert my incorrect VAL changes. * Original meaning of VAL restored. Many library files disabled until use of VAL in 64 bits fixed. * Make Reals.Mod independent of INTEGER size and add reals tests. * Implement fraction, IsInfinity and IsNaN in oocLowReal.Mod. * OPB little simplifications and ShorterSize/LongerSize functions. * Add test for alignment computability * Replace alignment constants with calculated alignment. * typ.size aware OPV.Convert * Add SYSTEM_INT64 and make tests name independent. * Remove SYSTEM.H includes (string.h and stdint.h). * Replace uses of uintptr_t and size_t with SYSTEM_ADDRESS. * Sad hack to make FreeBSD and OpenBSD happy with memcpy declaration. * Detect 64 bit on FreeBSD, and size_t defined on OpenBSD. * %zd not supportd by mingw, cast strnlen return to int. * Add debug for intermittent failure only on OpenBSD. * Add textTexts as a confidence test and tidy up a couple of other tests. * Update binary test process.
This commit is contained in:
parent
1f41d80b1e
commit
da88496c5f
224 changed files with 7494 additions and 8065 deletions
|
|
@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0)
|
|||
void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)())
|
||||
{
|
||||
while (n > 0) {
|
||||
P((LONGINT)(uintptr_t)(*((void**)(adr))));
|
||||
P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr))));
|
||||
adr = ((void**)adr) + 1;
|
||||
n--;
|
||||
}
|
||||
|
|
@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
|
|||
else if (typ == (LONGINT*)POINTER__typ) {
|
||||
/* element type is a pointer */
|
||||
x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT));
|
||||
p = (LONGINT*)(uintptr_t)x[-1];
|
||||
p = (LONGINT*)(SYSTEM_ADDRESS)x[-1];
|
||||
p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
|
||||
p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */
|
||||
while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;}
|
||||
|
|
@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
|
|||
while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
|
||||
nptr = nofelems * nofptrs; /* total number of pointers */
|
||||
x = Heap_NEWBLK(size + nptr * sizeof(LONGINT));
|
||||
p = (LONGINT*)(uintptr_t)x[- 1];
|
||||
p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1];
|
||||
p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
|
||||
p -= nptr - 1; n = 0; off = dataoff;
|
||||
while (n < nofelems) {i = 0;
|
||||
|
|
@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
|
|||
// (Ignore other signals)
|
||||
}
|
||||
|
||||
void SystemSetHandler(int s, uintptr_t h) {
|
||||
void SystemSetHandler(int s, SYSTEM_ADDRESS h) {
|
||||
if (s >= 2 && s <= 4) {
|
||||
int needtosetsystemhandler = handler[s-2] == 0;
|
||||
handler[s-2] = (SystemSignalHandler)h;
|
||||
|
|
@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
|
|||
}
|
||||
}
|
||||
|
||||
void SystemSetInterruptHandler(uintptr_t h) {
|
||||
void SystemSetInterruptHandler(SYSTEM_ADDRESS h) {
|
||||
EnsureConsoleCtrlHandler();
|
||||
SystemInterruptHandler = (SystemSignalHandler)h;
|
||||
}
|
||||
|
||||
void SystemSetQuitHandler(uintptr_t h) {
|
||||
void SystemSetQuitHandler(SYSTEM_ADDRESS h) {
|
||||
EnsureConsoleCtrlHandler();
|
||||
SystemQuitHandler = (SystemSignalHandler)h;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue