1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 15:57:13 +00:00

432 Commits

Author SHA1 Message Date
Bruce Mitchener
7f7952cbad
Remove USETIMEFN define. (#143)
In the past, we didn't use `gettimeofday()` on all non-DOS platforms
because it wasn't available, so we had to fall back to `time()`.
Those days are long gone and we have `gettimeofday()` on all non-DOS
platforms.

This also removes some code that used `times()` when it used `time()`.
This leaves us using `getrusage()` on all non-DOS platforms. This,
much like `gettimeofday()`, is now available everywhere. Not all of
the fields used here are guaranteed by POSIX, but the ones used
here shouldn't be an issue for now.
2020-12-30 14:38:58 -08:00
Bruce Mitchener
7a74d6e66f
Control VM config via RELEASE. (#136)
When `RELEASE` is set, then `inc/version.h` configures some
defines appropriately, including `BIGATOMS`, `BIGVM`, and
`NEWCDRCODING`. There's no need to manage it directly on
the compiler command line.
2020-12-30 14:32:31 -08:00
Bruce Mitchener
3eb8d36a49
README: Add discussion of platform support. (#146) 2020-12-30 09:59:22 -08:00
Larry Masinter
c395b816d8
Merge pull request #145 from Interlisp/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2020-12-29 15:42:04 -08:00
Larry Masinter
fef8be9f5c
Create CODE_OF_CONDUCT.md
as per Discussion#111
2020-12-29 11:00:24 -08:00
Bruce Mitchener
3e2a2d76ec
fcntl(..., F_SETFL, ...) return value only signals error. (#141)
The return value of `fcntl` when passed `F_SETFL` isn't guaranteed
to return the flags passed in as its return value. It will be `-1`
in the event of an error, but no other value is to be relied upon.

Fortunately, we weren't relying upon the value apart from
occasionally checking for an error.

This is as it is specified in https://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.html

Closes interlisp/medley#87.
2020-12-28 17:59:27 -08:00
Bruce Mitchener
01926fc232
NEW_STORAGE is no longer new. (#135)
* Always follow NEW_STORAGE code paths.

This removes the code paths for the pre-NEW_STORAGE code.

* Remove NEW_STORAGE from build system.

The code no longer refers to `NEW_STORAGE`, so we can remove
this from the build system.
2020-12-28 10:10:43 -08:00
Bruce Mitchener
14402131e7
Reduce number of -Wshorten-64-to-32 warnings. (#138) 2020-12-28 00:19:26 -08:00
Bruce Mitchener
999851e60c
Use SEEK_SET for third arg to *seek() functions. (#139)
Instead of sometimes passing `0` to `lseek` and friends, we should
use the standard symbolic constant `SEEK_SET`.
2020-12-28 00:18:41 -08:00
Bruce Mitchener
a986b1e57a
Remove unused fptovp_scratch variable. (#140) 2020-12-28 00:10:23 -08:00
Bruce Mitchener
023cf609f2
init_Xcursor takes Window, not int for window. (#137)
`Window` is an X11 typedef for `unsigned long` (via `XID`). We should
pass it as that, not an `int`, to avoid 64 bit conversion issues.
2020-12-28 07:19:30 +00:00
Bruce Mitchener
0880b2f3dd
Remove UNSAFE flag. (#134)
This flag was for SunOS 3 and 4 on sun3 hardware (68k).

It enabled some unsafe optimizations via assembler. This hasn't
actually been built since the DOS port (since the header for this
was renamed, but the code in `xc.c` wasn't updated).

The optimizations here made assumptions that were specific to the
68k hardware and register allocation. They aren't likely to be
of much use moving forward, and we've got plenty of safe performance
improvements from the last 30 years of hardware advances.
2020-12-26 20:53:47 +00:00
Bruce Mitchener
e295a34484
Remove inlnMIPS.h. (#133)
We removed support for MIPs platforms, so this code is unused.
2020-12-26 10:43:35 -08:00
Larry Masinter
100b0968cf Merge branch 'master' of https://github.com/interlisp/maiko into cygwin3 2020-12-25 11:15:18 -08:00
Nick Briggs
ac48a9bf9d
Fix typo in environment variable name that broke interprocess communications (issue Interlisp/medley#106) (#132) 2020-12-24 10:02:20 -08:00
Larry Masinter
db281a361c Merge branch 'master' of https://github.com/interlisp/maiko into cygwin3 2020-12-24 17:17:29 +00:00
Bruce Mitchener
bf2855be58
Use the real gethostid on Solaris. (#121)
* Use the real gethostid on Solaris.

Solaris has this, so we might as well use it like we do on other
platforms. This value is used in response to queries from it from
Lisp.

* Improve undefining of HAS_GETHOSTID.

Enable it on Solaris in `inc/version.h`. This file already
disables it on DOS, so no need to do so again in `src/initsout.c`.
2020-12-23 19:55:58 -08:00
Larry Masinter
e452a97e22 setup for cygwin (compiles but crashes) 2020-12-24 01:55:27 +00:00
Larry Masinter
e801373222 X11 definitions moved for MacPorts X11 2020-12-23 11:01:10 -08:00
Bruce Mitchener
3ef2d12115
Use memset instead of bzero. (#131) 2020-12-23 10:34:27 -08:00
Bruce Mitchener
985f2c43fe
Remove prototypes for getenv. Use stdlib.h. (#122)
This also removes some casts to `char *` that were present but
not needed, since `getenv()` is defined to return `char *`.
2020-12-23 15:44:16 +00:00
Bruce Mitchener
530aa4ce6d
Simplify including sun/fbio.h. (#130)
Both sides of this #ifdef were the same, so just collapse it.

This code isn't actually relevant any longer, but this removes
an OS-specific #ifdef, making inspection of platform specific
code a bit easier.
2020-12-23 15:34:14 +00:00
Bruce Mitchener
16019c24eb
Don't use dirent's d_reclen as if it were d_namlen. (#128)
This code was treating the `d_reclen` incorrectly from some of the
original old porting work. It is not the same as `d_namlen` and
`d_namlen` is not widely supported or standard. It should be using
`strlen(d_name)`.

This addresses an issue mentioned in interlisp/medley#103.
2020-12-22 23:26:56 -08:00
Bruce Mitchener
72948ae0fd
Clean up medleyfp.h. (#127)
* Include <ieeefp.h> for Solaris.
* Remove sections for sparc and Sun i386 for non-Solaris.
* Have Linux use the same code as FreeBSD and macOS.
* Make the FreeBSD / Linux / macOS code path the default, if nothing
  special is defined since it is the modern way.
* Remove fpstatus_() usage from the ancient days.
2020-12-22 23:23:26 -08:00
Bruce Mitchener
0c8ae869b9
Remove comment reference to SIGNED_CHARS define. (#126)
None exists or is used, so no need to discuss it.
2020-12-22 23:17:28 -08:00
Bruce Mitchener
9aeac67592
Only include stropts.h on Solaris. (#125) 2020-12-22 23:09:42 -08:00
Bruce Mitchener
1b9a90add6
Remove XWINDOWS define from FreeBSD, Linux, and macOS builds. (#124)
The right define is `XWINDOW` which is already defined via the
build system.
2020-12-22 23:08:00 -08:00
Bruce Mitchener
4ef79b54a5
Remove unused prototype for getpass(). (#123)
This function wasn't actually used here, which is good since it
is long deprecated.
2020-12-22 23:06:14 -08:00
Bruce Mitchener
a6ef508a7c
Remove ToMem macro. (#120)
We can always use `memcpy` to copy from a `hostent` struct to a
`sockaddr_in` struct as they will not be overlapping.
2020-12-22 22:57:40 -08:00
Bruce Mitchener
8b67b6b75a
Remove call to ieee_handler(). (#119)
When `FLTINT` is defined (which is currently only on SunOS), if
`OS5` was not defined, then it tried to use `ieee_handler` which
doesn't exist on Linux and friends. If we were to enable `FLTINT`
on more platforms, then we'd want to always be using more modern
signal handling and not `ieee_handler`.
2020-12-22 22:57:19 -08:00
Bruce Mitchener
33369268c1
Include termios as <termios.h>, not <sys/...>. (#118)
termios is available via `<termios.h>` on all supported platforms,
so variants of `<sys/termio.h>` and `<sys/termios.h>` are no
longer needed.
2020-12-22 22:56:54 -08:00
Larry Masinter
973db49422 Add a simple test.vm that runs opcode tests (fails on pi) 2020-12-22 12:39:17 -08:00
Bruce Mitchener
3c3a4a6292
Remove unused INTRCHECK def. (#117)
This was only defined for Solaris and wasn't used anywhere.
2020-12-22 17:34:10 +00:00
Bruce Mitchener
d3cb239091
Remove #ifdef DEMO. (#116) 2020-12-22 17:27:59 +00:00
Bruce Mitchener
254550d111
Remove empty, unreferenced bbt386i.h. (#115) 2020-12-21 22:25:26 -08:00
Bruce Mitchener
3246af571e
Remove dead entries from makefile-tail. (#114) 2020-12-21 22:17:46 -08:00
Bruce Mitchener
9a21f5339a
Remove XV11R4 and related defines. (#113)
We no longer have anything predicated upon the version of X11 that
we're using (and these versions are all ancient anyway).
2020-12-21 22:11:39 -08:00
Bruce Mitchener
37c410eb31
X*.h headers weren't cleaned up after renaming and merging. (#112)
* Check.h, Stipple.h, XCursors.h, XWaitCur.h, Xcursdef.h,
  Xdefcur.h, and Xicon.h were combined into xbitmaps.h.
* Xdisplay.h is not used and the contents are in MyWindow.h, which
  is used.
* XVersion.h and Xdeflt.h became xdefs.h. Remove 2 stragglers
  that were still including XVersion.h.
2020-12-21 19:13:30 -08:00
Nick Briggs
b901038367
Fix typo #ifdef RESWAPPEDDCODESTREAM -- should be RESWAPPEDCODESTREAM (#106) 2020-12-22 01:53:47 +00:00
Bruce Mitchener
bed68c8dda
Remove unused retfun function. (#111) 2020-12-21 18:09:14 +00:00
Bruce Mitchener
5835dbd9f6
Remove display name handling block ifdef'd for X11R1. (#110)
X11R1 was released in 1987 and superseded by X11R2 in 1988.

We should be able to safely remove this code. We set the
preprocessor variable on all platforms to indicate that we're
on X11R4 (or later, I guess).
2020-12-21 18:04:28 +00:00
Nick Briggs
ce7eb99b05
Remove unused CursorImage code and related pixmaps (#109) 2020-12-21 17:55:27 +00:00
Nick Briggs
fc0ae89fcf
Update FreeBSD makefile to use clang and new standard for configuring options (#105) 2020-12-20 17:06:59 -08:00
Bruce Mitchener
41d28e01b5
Fix timer.c compilation on non-x86_64 GNU/Linux. (#104)
`timer.c` uses `F_SETSIG` which is a GNU extension. As such, it
needs `_GNU_SOURCE` to be defined, but this was only done for
x86_64, not the other Linux platforms that we have build system
support for.

Closes interlisp/medley#97.
2020-12-20 17:42:37 +00:00
Bruce Mitchener
810e33125b
Update how we configure gcc / clang command lines. (#103)
* Move clang/gcc options into makefile-header.

This puts all of the shared options into a single place so that
we can easily update it.

* Add -fwrapv to the clang/gcc command lines.

This is a step along the way to fixing interlisp/medley#90.

Enabling `-fwrapv` will let overflow checks that rely upon undefined
behavior to work correctly. Without this, with modern versions of
clang and gcc, the overflow checks in the C code are eliminated
by the compiler, resulting in incorrect behavior on the part of
Maiko.

See the linked bug for details and discussion.

Hopefully, this usage of `-fwrapv` will go away once we're using
the correct compiler builtins to detect and handle overflow
correctly.
2020-12-19 20:16:31 -08:00
Bruce Mitchener
942b22886e
Remove CLX support. (#90)
CLX is a Common Lisp implementation of the X client library.

It has some code in C, which was present here as `src/socket.c`
and `src/socdvr.c`, exposed via opcodes in `src/subr.c`. This code
had been removed (with prejudice apparently) by commenting out
the code in `src/subr.c` with `#if NEVER`.

This code would've been used by the Medley system images, but
that code doesn't appear to be present. (There may or may not
be something related in `XMAS` in the Medley repository.)
2020-12-19 19:59:41 -08:00
Javier Olaechea
ecaf50c015
Replace calls to putenv with setenv (#99)
* Use setenv instead of putenv

* Replace sprintf with snprintf

* unixfork.c: Stack allocate tempstring
2020-12-19 19:51:41 -08:00
Nick Briggs
6fb4b9a189
Remove sccs id lines (#98)
* Remove static char *id = from all source files.

The same information is included in a comment in each source file.

* Remove unused template file 'id'
2020-12-19 19:08:52 -08:00
Bruce Mitchener
d5ff4011a9
Clean up extern int errno and errno.h inclusions. (#102)
Closes interlisp/medley#86.
2020-12-20 03:07:23 +00:00
Nick Briggs
ade0e7d4a6
Revert "integer multiply overflow wasn't catching all cases (#100)" (#101)
This reverts commit 761ab8cac6fd4e64f3ad6897c17e375acf5d75e5.
2020-12-19 10:00:57 -08:00