1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-14 07:30:21 +00:00

763 Commits

Author SHA1 Message Date
Nick Briggs
d91de66322 Correct -Wformat-pedantic warnings
Many of the warnings were newly visible after the DBPRINT macro
was modified, but the pedantic warnings also caught existing printf
family usage which was not strictly correct.

Mostly replacing 0x%x with %p for pointers, adding (void *) for
those and other pointers, %td for ptrdiff_t, but also changing
some function parameters from UNSIGNED (uintptr_t) to int
where that was the more appropriate type.
2022-08-11 15:38:07 -07:00
Nick Briggs
e72dd332a3 Missing include for kprintdefs.h causes error in tosret.h when compiling with OPTRACE enabled. 2022-08-11 14:22:35 -07:00
Nick Briggs
f7fd547360
Merge pull request #438 from Interlisp/combine-arith-files
Combine three small arithmetic opcode implementation files into one
2022-08-11 13:27:07 -07:00
Nick Briggs
b94cb8809b Combine three small arithmetic opcode implementation files into one
Combines arith2.c ... arith4.c files and their associated header files
into new arithops.c/arithopsdefs.h files, and adjusts the CMakeLists.txt,
and old-style makefile-tail.  Also updates  makefile-dos,
inlnPS2.h, and inlndos.h to reflect these changes, though these are not
used.
2022-08-10 20:16:59 -07:00
Nick Briggs
6010df35fe
Merge pull request #437 from Interlisp/combine-array-files
Combine six small array opcode implementation files into one
2022-08-10 20:13:38 -07:00
Nick Briggs
601d6e9142 Combine six small array opcode implementation files into one
Combines the array..array6 files and their associated header files
into new arrayops.c/arrayopsdefs.h files, and adjusts the CMakeLists.txt
and old-style makefile-tail to reflect these changes.
2022-08-10 12:54:06 -07:00
Nick Briggs
3d9f090e70
Cleanup of includes and related changes based on include-what-you-use diagnostics (#436)
Remove unused #define PERCENT_OF_SCREEN in MyWindow.h
Move structures for dir.c to dirdefs.h where they are used
Resolve S_CHAR vs S_CHARACTER in favor of S_CHARACTER and cleanup #defines
Fix  = vs == bug in FSDEBUG code in dir.c
Eliminate duplicate/unused constant definitions in gcr.c
Declare static internal function bytecmp in mkatom.c
Update many source and include files to include headers for what they use
2022-08-10 11:07:57 -07:00
Nick Briggs
4bd1f4b49a
Ensure compiler sees debug printf even if won't be executed (#433)
If the debugging printf macros are elided by the preprocessor
rather than being removed by the compiler's optimizer then
the debugging statements may get out-of-date as variables are
modified.  Wrap the non-debug case in "if (0) ..." instead.
2022-08-09 18:11:05 -07:00
Nick Briggs
681f3b2592
Update github workflow runners list (#435)
Github is deprecating the MacOS-10.15 environment as MacOS-12 is coming
online (currently beta), so this runner must be updated to MacOS-11

Ubuntu 22.04 LTS is now available so add that to the builds.

Ubuntu 18.04 LTS should be supported until April 2023.
2022-08-03 11:03:18 -07:00
Nick Briggs
c3f79872f1
Update memory allocator function (#434)
* Missing include unistd.h for getpagesize()

* Update from valloc() to posix_memalign() for large aligned allocations
2022-08-03 09:59:08 -07:00
Nick Briggs
a15de4df10
quick_stack_check() should return a result indicating status (#432) 2022-07-24 21:49:39 -07:00
Bruce Mitchener
430da79e73
Remove a dead store. (#431) 2022-07-22 11:54:19 -07:00
Bruce Mitchener
259658fa2c
No need for NULL mode arg to open when not creating a file. (#430) 2022-07-22 11:53:49 -07:00
Nick Briggs
317f081409
Add missing uraidextdefs.h to CMakeLists.txt (#429) 2022-07-22 10:29:00 -07:00
Nick Briggs
5fa05ac3d7
Cleanup types in URaid and move declarations to separate include file (#428) 2022-07-20 10:45:37 -07:00
Nick Briggs
9a10f63fe6
some cleanups in the arithmetic operations code (#427)
* arithmetic opcode implementations should return LispPTR rather than int

* all callers of ERROR_EXIT() have return type LispPTR, therefore ERROR_EXIT should too

* N_[I]GETNUMBER, [N_]ARITH_SWITCH need (int) casts for some large constants that would otherwise be unsigned

* Expand use of macro N_ARITH_BODY_1_UNSIGNED and correct types

* Remove unused macros N_ARITH_BODY_1 and N_ARITH_BODY_1_UNSIGNED

* Cast to correct type for storing to TopOfStack, and return type of TIMER_EXIT()
2022-07-20 10:28:21 -07:00
Nick Briggs
77957d421a
fix some compiler warnings (#423)
* Pedantic C compilers want an extern declaration separate from initialization

* Remove duplicate definitions for fns in initdspdefs.h from display.h

* Remove misleading comments on structure member offsets and reorder to minimize padding
2022-07-20 10:18:59 -07:00
Nick Briggs
e81345218a
Prevent X11 error when resuming after call to RAID when -noscroll is in use (#426)
The device_before_raid() call that disables X11 scrolling and bit-gravity
selection needs to avoid referring to the scrollbars and other ancillary
windows that have not been initialized when the "-noscroll" option was
given at startup.
2022-07-16 07:32:19 -07:00
Nick Briggs
b27bd2fbab
Fix ldeinit segmentation fault on keyboard/mouse input (#425)
Keyboard, cursor, and mouse pointers are not initialized in
ldeinit.  Do not process X events as they will cause a segmentation
fault referencing the uninitialized pointers.
2022-07-14 13:34:36 -07:00
Nick Briggs
b5f51d58f1 Correct missing htons() on port number for TCPop connect maiko-220603-b5f51d58 2022-06-03 18:32:36 -07:00
Nick Briggs
60af445afa
If SHELL is not set, fall back to /bin/sh so CHAT(SHELL) might work. (#424) 2022-05-28 12:37:43 -07:00
Nick Briggs
a18f09d788
Create missing directories when opening directory/file on {UNIX} device for output (#422)
Prior to this change there was no mechanism within Medley to create a new directory
on a {UNIX} style device.  This change makes the {UNIX} directory creation happen in
the same manner that {DSK} directory creation is done.  Opening a file with access
OUTPUT, BOTH, or APPEND, which would create the file if it does not exist, will also
create any missing directories in the path.
2022-05-24 16:08:26 -07:00
Nick Briggs
2bf7047709
Correct usage of stat.st_mode result for testing S_IFREG and S_IFDIR (#421)
stat.st_mode cannot be tested for whether a node is S_IFDIR with
    if (stat.st_mode & S_IFDIR) ...
since S_IFDIR bit (0040000) is a subset of S_IFSOCK (0140000) bits.
A correct check is
    if ((stat.st_mode & S_IFMT) == S_IFDIR) ...
or alternatively, since the convenience macros are defined on all modern systems
    if (S_ISDIR(stat.st_mode)) ...
2022-03-29 18:15:21 -07:00
Nick Briggs
90b967c8d3
Implement DELFILE for (empty) directories on the {unix} device (#409)
If the argument to DELFILE represents a directory on the {unix} device
either directly or through resolving to a full pathname via the connected
host/directory, and the directory is empty, then the directory will be deleted
and the deleted directory name will be returned.  Will error if the
directory is not empty, and return NIL if the argument does not name a directory
or file.
2022-03-18 18:20:35 -07:00
Frank Halasz
b005501427
Cosmetic fix: Use DOCKER_NAMESPACE instead of DOCKER_OWNER in workflows. Matches the corresponding change in Medley workflows (where it was more than cosmetic). (#419) 2022-02-12 18:04:36 -08:00
Frank Halasz
20046b265b
Taking source builds out of buildReleaseInclDocker workflow (#418)
Github does this automatically when release published
maiko-220212-20046b26
2022-02-12 13:44:50 -08:00
Frank Halasz
e6a974a2a7
Fix for maiko buildReleaseInclDocker workflow failures. Dockerfile out of sync. (#416)
* Adding new workflow that builds maiko releaases for Linux/amd64, Linux/arm64, Linux/arm7, Macos/amd64.  (Not Macos/arm64 as yet.) Also builds and pushes to DockerHub docker images for Linux/amd64 and Linux/arm64.  Delete old buildDocker.yml workflow.

* Adding latest version of buildReleaseInclDocker.yml; builds release and docker images for all major platforms except MacOs arm64.

* Adding Dockerfile.  Was out of sync with final dev version at fghalasz/maiko
maiko-220212-e6a974a2
2022-02-12 09:36:04 -08:00
Frank Halasz
8ea2c76110
Fgh004: Adding new workflow that builds maiko releases and docker images (#415)
* Adding new workflow that builds maiko releaases for Linux/amd64, Linux/arm64, Linux/arm7, Macos/amd64.  (Not Macos/arm64 as yet.) Also builds and pushes to DockerHub docker images for Linux/amd64 and Linux/arm64.  Delete old buildDocker.yml workflow.

* Adding latest version of buildReleaseInclDocker.yml; builds release and docker images for all major platforms except MacOs arm64.
maiko-220117-5eba2c3a
2022-02-11 14:21:19 -08:00
Nick Briggs
3e7c71c0c0 Use pointer format and don't cast address to int for ethernet debuggging 2022-01-22 17:04:39 -08:00
Nick Briggs
f2a3715930
Remove support for GET-NATIVE-ADDR-FROM-LISP-PTR and GET-LISP-PTR-FROM-NATIVE-ADDR (#414)
Since the native addresses for objects within the Lisp memory may be at locations
that can't be represented in 32-bits conversion between a native address and a
Lisp FIXP can't be supported.  For now, return NIL for conversion in either direction.

There are no known users of these two subrs.  Should it be necessary to reimplement them
at some future time the representation will need to be something that can hold 64 bits.
2022-01-22 16:02:26 -08:00
Nick Briggs
f15d8eca09 Use correct size for %x format for LispPTR in debug output for GC array problems. 2022-01-22 15:21:20 -08:00
Nick Briggs
008ce703e7 Use inttypes.h to provide uintptr_t/intptr_t of machine dependent size for UNSIGNED/INT declarations 2022-01-22 15:16:36 -08:00
Nick Briggs
fa08a08648 Update possible names for clang-tidy to include version 13 2022-01-22 14:03:14 -08:00
Nick Briggs
bb0b011f90 Remove debugging printf(.) that was left in unixcomm.c maiko-220109 2022-01-03 22:48:23 -08:00
Nick Briggs
6bccbfbcf3
Clean up issues in Unix_handlecomm preventing clean process exit (#413)
When Medley closes a stream open to a process it uses a "unixcomm"
command (3) which should close() the communication channel open with
the process and give it a chance to handle that and exit cleanly
before using a SIGKILL on it.  We can't determine apriori whether the
process is going to cooperate, so we're stuck trying for up to 0.1s
(arbitrary choice!)  waiting for the process to exit, then it gets a
SIGKILL, and we wait up to 0.1s again to see that it really exited.
2021-12-23 10:46:37 -08:00
Nick Briggs
e3af3b03b9 Remove unused "readsock" field from Unix job table. maiko-211222 2021-12-21 21:33:03 -08:00
Nick Briggs
880747f2dc Add m68k to directories that .gitignore ignores for build artifacts 2021-12-09 21:15:48 -08:00
Nick Briggs
c7fd28a438 Removed unused (and unimplemented) stackcheck() and stackoverflow() routines
These routines were stubs that did nothing and were not called from anywhere
so lack value in even providing a template or hook for a fuller implementation.
Also note that "stackcheck" conflicts with a predefined symbol in some runtime
libraries.  Should these be implemented in the future they should use a
maiko-specific name.
2021-12-09 14:57:45 -08:00
Nick Briggs
e1efc860c4 Prefer typedef over #define where it can be used for type definitions 2021-12-09 14:48:52 -08:00
Nick Briggs
26fe840edf
Convert "mkvdate" into a shell script instead of compiled C code (#411)
For all	systems other than DOS, use a simple shell script to create
the vdate.c (contains version date) that goes into every build.
2021-12-09 12:36:12 -08:00
Nick Briggs
212a0fa9c6
Add some support for cross-compilation to MC68000 AmigaOS (#412)
Add m68k to recognized CPUs (machinetype)
Add amigaos to recognized operating systems (osversion)
Add ability to override "config.guess" output w/ LDEARCH= to osversion
Add platform.h clauses to recognize AmigaOS 3 using gcc to cross-compile
2021-12-08 12:03:04 -08:00
Nick Briggs
65bbcb7d9d
Remove makepathname() (#410)
makepathname() is only ever called with one of two constant string
arguments, in one case (DOS) such that it only does a strncpy(...),
and the other case (non-DOS) expanding "~" to the current user's home
directory. Additional code duplicates realpath() functionality but is
never used.
maiko-211203
2021-11-26 19:53:26 -08:00
Nick Briggs
987cf4c7c6
Correct error for missing byteswap macros in tosfns.h EVAL implementation (#407)
Commit c46fcce307018df6554805050ceb634d72e737c9 fixed a warning for
incompatible pointers to nnewframe() but did not consider that the
order of the DLwords is swapped depending on the endianness of the
system it is running on.  Add the necessary GETBASEWORD() macros to
access the items when constructing the pointer.
maiko-211107
2021-11-06 18:36:25 -07:00
Nick Briggs
c46fcce307
Fix "warning: incompatible pointer types" in EVAL implementation (#406)
nnewframe() as called from the EVAL implementation expects to be passed
the address of an array of two DLwords.  Do that, and compose the 32-bit
result correctly rather than passing the address of a (32-bit) LispPTR
and then having to swapx() that result to get the expected value.
2021-11-04 20:18:27 -07:00
Nick Briggs
de5ea2110f
Correct integer type warnings (#405)
* Correct warning: cast to smaller integer type -- X_init/lispbitmap

* Fixes to INTRSAFE, INTRSAFE0 and ensure TIMEOUT, TIMEOUT0 used appropriately

INTRSAFE and INTRSAFE0 must clear errno before executing the library or system
call because not all library calls set errno on success.
Avoid casting pointers or larger integer values down to smaller ints before
comparing to 0 or -1, and use NULL (a pointer) rather than 0.

Fix cases where the result of the library call is a pointer rather than an int
to use TIMEOUT0 instead of TIMEOUT, testing for NULL rather than -1
on timeout (errno == EINTR)

* Remove useless validity check of LASTVMEMFILEPAGE_word pointer

* Convert pointer arithmetic type in drawline from int to ptrdiff_t

* Add NOTE warning about a 32-bit vs 64-bit issue affecting currently unused GET_NATIVE_ADDR_FROM_LISP_PTR
2021-11-04 09:08:55 -07:00
Nick Briggs
6c241f1eaa Make opcode_table (names of opcodes) visible as useful debug aid. 2021-10-29 10:02:47 -07:00
Nick Briggs
19688bc314
Drop setuid privilege correctly. (#401) 2021-10-29 09:52:51 -07:00
Nick Briggs
c39b751f42
Rework make_atom() to allow removal of parse_number() (#404)
No calls to make_atom() depend on the ability to parse the atom's
pname as a number.  Additionally, the parse_number() implementation
used here was non-functional.

We remove parse_number() and adjust the parameter list of make_atom()
to remove the non_numericp flag.
2021-10-29 09:51:32 -07:00
Nick Briggs
75c668f1cd
The pointers Atomspace, Spospspace, Snegspace, Arrayspace can be removed (#402)
These pointers are neither initialized nor referenced anywhere in the code.
maiko-211022 maiko-211010
2021-10-10 16:55:33 -07:00
Nick Briggs
a25368714f
Use SHELL rather than /bin/csh when forking shells. Issue Interlisp/medley#384 (#400)
As long as $(SHELL) names an executable that appears in /etc/shells (as determined
by the getusershell() function) use that.  It used to always use /bin/csh, but some
modern distros do not ship with csh installed.  Using the user's preferred shell
seems like a better choice, while allowing the choice from /etc/shells gives some
additional flexibility.
2021-10-08 17:58:29 -07:00