diff --git a/README.md b/README.md index ea4b4c9..f625df7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Bug reports, feature requests, fixes and improvements, support for additional pl ## Development Platforms -We are developing on FreeBSD, Linux, MacOS, and Solaris currently +We are developing on FreeBSD, Linux, macOS, and Solaris currently on arm7l, arm64, PowerPC, SPARC, i386, and x86_64 hardware. @@ -33,14 +33,14 @@ $ cd maiko/bin $ ./makeright x ``` -* The build will (attempt to) detect the OS-type and cpu-type. It will build binaries `lde` and `ldex` in `../ostype.cputype` (with .o files in `..ostype.cputype-x`. For example, Linux on a 64-bit x86 will use `linux.x86_64`, while MacOS 11 on a (new M1) Mac will use `darwin.aarch64`. +* The build will (attempt to) detect the OS-type and cpu-type. It will build binaries `lde` and `ldex` in `../ostype.cputype` (with .o files in `..ostype.cputype-x`. For example, Linux on a 64-bit x86 will use `linux.x86_64`, while macOS 11 on a (new M1) Mac will use `darwin.aarch64`. * If you prefer using `gcc` over `clang`, you will need to edit the makefile fragment for your configuration (`makefile-ostype.cputype-x`) and comment out the line (with a #) that defines `CC` for `clang` and uncomment the line (delete the #) for the line that defines `CC` for `gcc`. * There is a cmake configuration (TBD To Be Described here). -### Building For MacOS +### Building For macOS -* Running on MacOS requires an X server, and building on a Mac requires X client libraries. -An X-server for MacOS (and X11 client libraries) can be freely obtained at https://www.xquartz.org/releases +* Running on macOS requires an X server, and building on a Mac requires X client libraries. +An X-server for macOS (and X11 client libraries) can be freely obtained at https://www.xquartz.org/releases ### Building for Windows 10 diff --git a/docs/NEWCDRCODING.md b/docs/NEWCDRCODING.md index 4fe5a07..6aa4870 100644 --- a/docs/NEWCDRCODING.md +++ b/docs/NEWCDRCODING.md @@ -6,9 +6,9 @@ It is treated as an on-page indicator bit and a 3-bit scaled offset. Certain combinations are treated specially. -on-page| offset | interpretation --------|--------|---------------------------------------------------------------------------- - 1 | 0 | CDR is NIL - 1 | 1 - 7 | CDR is at 2*offset (counted in 32-bit cells) on same page - 0 | 0 | CDR is indirect, CDR(car) - 0 | 1 - 7 | CDR is not a cons cell but is in the car of cell at 2*offset on same page +| on-page | offset | interpretation | +|---------|---------|---------------------------------------------------------------------------| +| 1 | 0 | CDR is NIL | +| 1 | 1 - 7 | CDR is at 2*offset (counted in 32-bit cells) on same page | +| 0 | 0 | CDR is indirect, CDR(car) | +| 0 | 1 - 7 | CDR is not a cons cell but is in the car of cell at 2*offset on same page | diff --git a/inc/conspagedefs.h b/inc/conspagedefs.h index 49b79f2..56dacbd 100644 --- a/inc/conspagedefs.h +++ b/inc/conspagedefs.h @@ -2,6 +2,6 @@ #define CONSPAGEDEFS_H 1 #include "lispemul.h" /* for LispPTR */ struct conspage *next_conspage(void); -LispPTR N_OP_cons(int cons_car, int cons_cdr); +LispPTR N_OP_cons(LispPTR cons_car, LispPTR cons_cdr); LispPTR cons(LispPTR cons_car, LispPTR cons_cdr); #endif diff --git a/inc/lsptypes.h b/inc/lsptypes.h index 60a0b4b..ff07eaa 100644 --- a/inc/lsptypes.h +++ b/inc/lsptypes.h @@ -403,7 +403,7 @@ struct dtd { LispPTR dtd_typespecs; LispPTR dtd_ptrs ; int dtd_oldcnt; - int dtd_nextpage ; + LispPTR dtd_nextpage ; DLword dtd_supertype ; DLword dtd_typeentry ; }; diff --git a/inc/medleyfp.h b/inc/medleyfp.h index a6dc94b..fbfca2b 100644 --- a/inc/medleyfp.h +++ b/inc/medleyfp.h @@ -41,12 +41,12 @@ extern volatile sig_atomic_t FP_error; #elif defined(DOS) #include -#define FPCLEAR +#define FPCLEAR do {} while (0) #define FPTEST(result) (_getrealerror() & ( I87_ZERO_DIVIDE | I87_OVERFLOW | I87_UNDERFLOW)) #else #include -#define FPCLEAR +#define FPCLEAR do {} while (0) #define FPTEST(result) (!isfinite(result)) #endif /* FLTINT */ diff --git a/inc/xdefs.h b/inc/xdefs.h index aecf5fa..be21578 100755 --- a/inc/xdefs.h +++ b/inc/xdefs.h @@ -49,8 +49,8 @@ extern volatile sig_atomic_t XNeedSignal; XLocked--; \ } while (0) #else -#define XLOCK -#define XUNLOCK(dsp) +#define XLOCK do {} while (0) +#define XUNLOCK(dsp) do {} while (0) #endif /* LOCK_X_UPDATES */ #endif /* XDEFS_H */ diff --git a/src/asmbbt.c b/src/asmbbt.c index 4974a68..22a6cf6 100644 --- a/src/asmbbt.c +++ b/src/asmbbt.c @@ -23,20 +23,7 @@ #include "version.h" #include "lispemul.h" -#include "lspglob.h" -#include "lispmap.h" -#include "lsptypes.h" -#include "emlglob.h" -#include "adr68k.h" -#include "address.h" -#include "arith.h" -#include "stack.h" -#include "cell.h" -#include "gcdata.h" - #include "bb.h" -#include "bitblt.h" -#include "pilotbbt.h" void bitblt(DLword *srcbase, DLword *dstbase, int sx, int dx, int w, int h, int srcbpl, int dstbpl, int backwardflg, int src_comp, int op, int gray, int num_gray, int curr_gray_line) { diff --git a/src/car-cdr.c b/src/car-cdr.c index d0f791e..1033382 100644 --- a/src/car-cdr.c +++ b/src/car-cdr.c @@ -129,10 +129,14 @@ LispPTR cdr(LispPTR datum) Edited by : Naoyuki Mitani */ /**********************************************************************/ - +/** + * Replace car of x with y + * + * @param x [in,out] LispPTR to object in which car will be replaced. + * @param y [in] LispPTR to object that will become new car of x. + * @return x, modified, or NIL if x is not a list. + */ LispPTR rplaca(LispPTR x, LispPTR y) -/* car of x will be smashed */ -/* y is a newly car object */ { ConsCell *x_68k; ConsCell *temp; @@ -182,10 +186,15 @@ LispPTR rplaca(LispPTR x, LispPTR y) static ConsCell *find_cdrable_pair(LispPTR carpart, LispPTR cdrpart); /* below... */ static ConsCell *find_close_cell(struct conspage *page, LispPTR oldcell); #endif +/** + * Replace cdr of x with y + * + * @param x [in,out] LispPTR to object in which cdr will be replaced. + * @param y [in] LispPTR to object that will become new cdr of x. + * @return x, modified, or errors if x is not a list. + */ LispPTR rplacd(LispPTR x, LispPTR y) -/* cdr of x will be smashed */ -/* y is a newly cdr object */ { ConsCell *x_68k; ConsCell *temp68k; diff --git a/src/conspage.c b/src/conspage.c index 561bcfb..c503085 100644 --- a/src/conspage.c +++ b/src/conspage.c @@ -114,12 +114,10 @@ static void init_conspage(struct conspage *base, unsigned int link) /**********************************************************************/ struct conspage *next_conspage(void) { - extern struct dtd *ListpDTD; - struct conspage *page1; /* Allocated 1st MDS page */ struct conspage *page2; /* Allocated 2nd MDS page */ struct conspage *pg, *priorpg; - int next, prior; + LispPTR next, prior; #ifdef NEWCDRCODING /* Allocate 2 conspages and get 1st page base */ @@ -292,15 +290,13 @@ static ConsCell *find_free_cons_cell(void) { */ /**********************************************************************/ -LispPTR N_OP_cons(int cons_car, int cons_cdr) { - extern struct dtd *ListpDTD; - +LispPTR N_OP_cons(LispPTR cons_car, LispPTR cons_cdr) { struct conspage *new_conspage; ConsCell *new_cell; #ifndef NEWCDRCODING ConsCell *temp_cell; #endif - int new_page; /* hold the return val of nextconspage ,DL->int */ + LispPTR new_page; /* hold the return val of nextconspage */ GCLOOKUP(cons_cdr &= POINTERMASK, ADDREF); GCLOOKUP(cons_car, ADDREF); @@ -430,7 +426,7 @@ LispPTR N_OP_cons(int cons_car, int cons_cdr) { #ifdef NEWCDRCODING if (254 < ((new_page & 0xff) + ((new_cell->cdr_code & 7) << 1))) error("in CONS, cdr code too big."); -#endif /* NEWCDROCDING */ +#endif /* NEWCDRCODING */ return (new_page); } /* N_OP_cons() end */ diff --git a/src/gcrcell.c b/src/gcrcell.c index 3b69ead..17040c7 100644 --- a/src/gcrcell.c +++ b/src/gcrcell.c @@ -76,6 +76,9 @@ #include "lispemul.h" // for LispPTR, ConsCell, NIL, POINTERMASK, DLword #include "lspglob.h" // for ListpDTD #include "lsptypes.h" // for dtd, GetDTD, GetTypeNumber, TYPE_ARRAYBLOCK +#ifdef DTDDEBUG +#include "testtooldefs.h" +#endif #ifdef NEWCDRCODING #undef CONSPAGE_LAST diff --git a/src/initkbd.c b/src/initkbd.c index d8af8b1..e250b78 100644 --- a/src/initkbd.c +++ b/src/initkbd.c @@ -453,9 +453,7 @@ void keyboardtype(int fd) type = KB_SUN2; else if (strcmp("jle", key) == 0) type = KB_JLE; - else if (strcmp("X", key) == 0) - type = KB_X; - else if (strcmp("x", key) == 0) + else if (strcmp("X", key) == 0 || strcmp("x", key) == 0) type = KB_X; else type = KB_SUN3; /* default */ diff --git a/src/loopsops.c b/src/loopsops.c index 6b7c765..3544905 100644 --- a/src/loopsops.c +++ b/src/loopsops.c @@ -31,7 +31,7 @@ #include "lspglob.h" #include "lsptypes.h" // for GetDTD, GetTypeNumber, dtd, Listp, GETWORD #include "stack.h" // for frameex1, fnhead, BF_MARK, FX_MARK, STK_SAFE -#include "version.h" // for UNSIGNED, BIGVM + struct LCIVCacheEntry; struct LCInstance; diff --git a/src/rawcolor.c b/src/rawcolor.c index 9e2659e..9019c6d 100644 --- a/src/rawcolor.c +++ b/src/rawcolor.c @@ -33,9 +33,14 @@ #include "arith.h" #include "bitblt.h" #include "lldsp.h" - #include "bbtsubdefs.h" +#include "gcarraydefs.h" +#include "testtooldefs.h" +#include "lsthandldefs.h" +#include "car-cdrdefs.h" +#include "keyeventdefs.h" + #define IMIN(x, y) (((x) > (y)) ? (y) : (x)) #define IMAX(x, y) (((x) > (y)) ? (x) : (y)) @@ -94,9 +99,9 @@ LispPTR SLOWBLTCHAR_index; #define FReplaceSmallp(place, val, puntcase) \ { \ if ((0 <= (val)) && ((val) <= MAX_SMALL)) \ - (LispPTR)(place) = (LispPTR)(S_POSITIVE | (val)); \ + (place) = (LispPTR)(S_POSITIVE | (val)); \ else if (MIN_SMALL <= val) \ - (LispPTR)(place) = (LispPTR)(S_NEGATIVE | (0xffff & (val))); \ + (place) = (LispPTR)(S_NEGATIVE | (0xffff & (val))); \ else { \ puntcase; \ } \ @@ -125,7 +130,7 @@ LispPTR COLORSCREEN_index; /* if it's 0xffffffff, not yet initialized */ /* */ /************************************************************************/ -C_slowbltchar(LispPTR *args) +void C_slowbltchar(LispPTR *args) { Stream *n_dstream; DISPLAYDATA *n_dd; @@ -210,8 +215,8 @@ C_slowbltchar(LispPTR *args) w = *(DLword *)NativeAligned2FromLAddr(n_dd->ddcharimagewidths + Char8Code(charcode)); h = src_h; - (short)dst_x = (short)curx; - (short)dst_y = (short)cury - (short)n_csinfo->CHARSETDESCENT; + dst_x = (short)curx; + dst_y = (short)cury - (short)n_csinfo->CHARSETDESCENT; { /* clipping */ short left, right, bottom, top; diff --git a/src/return.c b/src/return.c index 0872753..0b8a23b 100644 --- a/src/return.c +++ b/src/return.c @@ -94,7 +94,7 @@ void contextsw(DLword fxnum, DLword bytenum, DLword flags) printf("contextsw : %d \n", fxnum); #endif - if (!(fxnum == SubovFXP)) { + if (fxnum != SubovFXP) { /* interrupt disable during executing [special] function invoked by contextsw(\KEYHANDLER,\RESETSTACK,FAULT) */ diff --git a/src/subr.c b/src/subr.c index 7c9ee9e..8a3b931 100644 --- a/src/subr.c +++ b/src/subr.c @@ -62,7 +62,6 @@ #include "unixcommdefs.h" // for Unix_handlecomm #include "uraidextdefs.h" // for Uraid_mess #include "uutilsdefs.h" // for suspend_lisp, check_unix_password, unix_fu... -#include "version.h" // for UNSIGNED #include "vmemsavedefs.h" // for lisp_finish, vmem_save0 extern LispPTR *PENDINGINTERRUPT68k; diff --git a/src/vesainit.c b/src/vesainit.c index c9572cf..3c24827 100644 --- a/src/vesainit.c +++ b/src/vesainit.c @@ -232,7 +232,7 @@ void VESA_enter(DspInterface dsp) TPRINT(("Enter VESA_enter\n")); VESA_setmode(dsp->graphicsmode, TRUE); - if (!((VESA_describemode(dsp->graphicsmode) == 0))) { + if (VESA_describemode(dsp->graphicsmode) != 0) { _setvideomode(_DEFAULTMODE); _clearscreen(_GCLEARSCREEN); fprintf(stderr, "Can't set VESA mode %o.\n", dsp->graphicsmode); diff --git a/src/xbbt.c b/src/xbbt.c index c04f224..27026e8 100644 --- a/src/xbbt.c +++ b/src/xbbt.c @@ -13,7 +13,6 @@ #include // for XFlush, XPutImage #include "devif.h" // for (anonymous), MRegion, DspInterface #include "lispemul.h" // for DLword -#include "version.h" #include "xbbtdefs.h" // for clipping_Xbitblt #include "xdefs.h" // for XLOCK, XUNLOCK diff --git a/src/xlspwin.c b/src/xlspwin.c index e1ac015..04975a4 100644 --- a/src/xlspwin.c +++ b/src/xlspwin.c @@ -22,7 +22,6 @@ #include "devif.h" // for (anonymous), MRegion, OUTER_SB_WIDTH, Defin... #include "keyboard.h" // for RING, KBEVENT, KB_ALLUP, KEYEVENTSIZE, MAXK... #include "lispemul.h" // for DLword, ATOM_T, LispPTR, NIL, T -#include "version.h" #include "xbitmaps.h" // for LISP_CURSOR, default_cursor, horizscroll_cu... #include "xcursordefs.h" // for set_Xcursor, init_Xcursor #include "xdefs.h" // for XLOCK, XUNLOCK diff --git a/src/xrdopt.c b/src/xrdopt.c index 1539b4f..55a1c3b 100644 --- a/src/xrdopt.c +++ b/src/xrdopt.c @@ -9,7 +9,7 @@ /* */ /************************************************************************/ -#include "version.h" +#include "version.h" // for MAIKO_ENABLE_ETHERNET #include // for XPointer, True, XParseGeometry, XResource... #include // for XrmoptionSepArg, XrmGetResource, Xrmoptio... @@ -20,7 +20,6 @@ #include // for strncpy, strcat, strcpy, strcmp #include // for u_char #include // for access, R_OK -#include "version.h" // for MAIKO_ENABLE_ETHERNET #include "xdefs.h" // for WINDOW_NAME #include "xrdoptdefs.h" // for print_Xusage, read_Xoption diff --git a/src/z2.c b/src/z2.c index d5b846f..c33ce64 100644 --- a/src/z2.c +++ b/src/z2.c @@ -32,7 +32,6 @@ #include "lspglob.h" #include "lsptypes.h" // for Listp, GetTypeNumber, TYPE_LISTP #include "vars3defs.h" // for cadr -#include "version.h" #include "z2defs.h" // for N_OP_classoc, N_OP_clfmemb, N_OP_restlist /* N_OP_classoc() OP 33Q */