File rawcolordefs.h was completely missing.
Both llcolordefs.h and rawcolordefs.h must be included in subr.c if -DCOLOR
Make newColorizeFont8() local to rawcolor.c
* Remove useless VersionArray parameter in maintain_version()
The 2nd argument, FileName *varray, is only ever NULL, so
remove it and simplify the code.
* Remove useless and unused VersionArray cache mechanism
* Simplify setting of file times on file close
The futimes(fd, ...) function allows changing the times of a file with
reference to an open file descriptor which allows us to avoid trying to
find a pathname by which utimes(path, ...) would operate on the inode
corresponding to the fd we have just closed.
* Remove unnecessary temporary variable for VersionArray
* In get_version_array() do not mix array and pointer access to VersionArray
* Improve {DSK} device handling of files with many versions
Somewhat dynamically allocate the version array storage, in chunks of
VERSIONARRAYCHUNKLENGTH (currently 200) allowing for up to
VERSIONARRAYMAXLENGTH (currently 2000) entries before reporting an
error. These numbers could be adjusted, or the limit could be removed.
Sorts the version array in descending order of version number to
improve the performance of check_vless_link() which stats every file
in the version array until it finds one linked to the versionless name
(which should be the highest version). Sorting, and tracking the
number of active entries, also allows for future optimization of other
operations that currently walk through the version array.
* futimens() appears more widely available than futimes() - so use it
* Rework caching of version array for files
While enumerating the entries in a directory is relatively fast,
on some systems (macOS) stat() of a file is slow.
While there is not general agreement on the name in the stat structure
of the timespec field for the modification time, POSIX specifies it
as "st_mtim", and it is possible to #define st_mtim to be the
system-specific name in "version.h" (macOS: st_mtimespec).
* FindHighestVersion can make use of sorted order of filename/version cache
Since the list of filename and versions is maintained in descending order
by version number (see get_version_array) the highest version is trivially
located at index 0 of the filename array.
Where bit-fields are defined in a structure that represents a Lisp
DLword object the DLword type is now used as the base type instead of
"unsigned short".
* Fix compilation for maiko version 201
Version 201 does not have BIGVM, so SWA_FNHEAD requires swapx
which is defined in byteswapdefs.h
* Fix compilation for maiko version 201
Version 201 did not have NEWCDRCODING, so the implementation of
N_OP_rplcons requires definitions from gcdata.h and address.h
* Set up makeright etc. to allow for easier compilation of alternate versions
The makeright script and the makefile-* slices it depends are modified
to allow easily specifying the RELEASE version number of the Maiko emulator
to be built. The default version remains 351, but can be changed with e.g.
RELEASE=201 ./makeright x
The object directories and executables are NOT named with the version.
* Remove unnecessary include of gcdata.h from bbtsub.c
* Users of gcdata.h should include gchtfinddefs.h explicitly if they use gcdata.h macros
* Correct modify_big_reference_count entry parameter type to reflect dependence on GCENTRY size differences between releases
* Add MAIKO_RELEASE to CMake options for building
* Haiku OS port
* haiku with X11 backend
* haiku has stpncpy
* Haiku is not Linux.
* X not stable enough on Haiku
* Haiku : settimeofday is a no-op
* Haiku : no need to define settimeofday at all (pointed by nbriggs)
---------
Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Rather than adding/or-ing the STK_OFFSET constant into a stack offset
to convert it to a pointer in general Lisp memory and then converting
from that to a native address... use the functions specifically
present to do those conversions with embedded checks on stack offset
validity.
Pointer difference calculations on an inappropriate stack pointer could
result in a negative offset, not just an offset that is too large to fit
in 16 bits. Complain if either case occurs.
While packing is not guaranteed, and most compilers will combine
adjacent bit fields regardless of the alignment requirements of the
datatype that is being divided, here we can be clearer that we
expect packing into 16-bit fields and we do not require (and must not
have) 32-bit alignment of the collections of bitfields.
No functional difference. Replaces a few leftover references to a prior
project name for the C implementation of the Lisp Virtual Machine with the
current name.
The fix to allow compiling for Alpine Linux caused breakage on Solaris
because MAXNAMLEN is defined in <dirent.h> which was now NOT included.
Pending a conversion to POSIX NAME_MAX, include <dirent.h> in "locfile.h".
* Changes needed to compile maiko on Alpine Linux with clang. Switching to Alpine on github actions to streamline maiko release builds
* Changes needed to compile maiko on Alpine Linux with clang.
Switching to Alpine on github actions to streamline maiko release builds.
* ether_nethub.c missing a couple of includes, and incorrectly including
<sys/poll.h> instead of plain <poll.h>
* <dirent.h> does not define MAXNAMLEN on Alpine Linux, but "locfile.h"
compensates for this already, if it is modified to include <limits.h>,
so use this in "dirdefs.h".
---------
Co-authored-by: Nick Briggs <nicholas.h.briggs@gmail.com>
The Lisp implementation distinguishes between 0 and NIL as the result of
the gcscan1/gcscan2 opcodes, however the C implementation did not, since
NIL and 0 are indistinguishable.
CSTKPTR is "LispPTR *" while CurrentStackPTR is "DLword *", cast to "void *" to
silence the warning, add comment pointing out size difference to explain the
"- 1" vs "+ 2" adjustments when saving/restoring.
Creating a free block or guard block on the stack with an odd number of 16-bit words
will cause the system to break badly. Always check that and report an error.
Because the stack pointer is declared as "DLword *" (16-bit) for pointer arithmetic,
although it is always maintained as a pointer to a 32-bit boundary, the compiler generates
spurious warnings on casting the stack pointer to structures that require 32-bit alignment.
Silence those warnings by casting through (void *).
The "fillpointer" and "totalsize" fields of the array header and the "offst"
of the sequence descriptor were declared as LispPTR, an unsigned type that
represents an offset into the Lisp memory, however the Lisp datatype
declaration indicates that these are FIXP (int32_t) rather than pointers.
GCC treats the size of a void as 1 for the purposes of arithmetic on
a pointer to void. Since this was provoked by an explicit cast to
pointer to void we can replace it with a cast to pointer to char for
the same effect.
Correct various warning: implicit conversion loses integer precision (30)
Correct parameter type declaration error for N_OP_aset1()
Ensure that appropriate types and casts are used in aref_switch()
Remove requirement for declaring "int new" when using aset_switch() macro
Initialize MaxTypeNumber_word from address of value cell of \MaxTypeNumber in initsout.c
Correctly extract value of \MaxTypeNumber where used in gcmaptable() (though gcmaptable() itself is unused at this time)
Update GetDTD() macro to return (void *), result will be cast to (struct dtd *) where it is needed. Alignment should always be sufficiently large.
createcell68k(typecode) returns a pointer that is aligned for the typecode
argument. Changing the return type to "void *" puts the onus on the caller
to cast the result to an appropriately aligned object. All current uses
in the maiko source ask for 4-byte objects (TYPE_FIXP, TYPE_FLOATP).