Instead of using a single macro that converts from a lisp pointer to
a native pointer to a 2-byte aligned item then perhaps casting to objects
that require 4-byte alignment... use separate functions for 2-byte and
4-byte aligned pointer results. The clients should be explicit about
which alignment they require, and the conversion functions can check
(perhaps in DEBUG mode) that the resulting pointer is on an appropriate
boundary.
This commit defines the functions but does not introduce any uses.
posix_memalign() does not guarantee initializing the allocated
memory to zero, which Lisp expects, so the code must memset() the
entire allocated region to zero. The effect of this is (generally) to
force the allocation of RAM to the process, which is wasteful, since
we normally start with only 4% of 256 MB in use for a full.sysout.
Allocating memory with mmap, using MAP_ANON, guarantees that the
memory is already zeroed (effectively mapping /dev/zero with copy-on-write)
so it is not necessary to touch it before use. This keeps the
pre-allocated RAM to a minimum.
Remove deprecated register attribute
Ensure correct type used to store result of system calls
Use memset to zero buffer vs byte-at-a-time stores
Use GetPosSmallP where appropriate
Remove deprecated register attribute
Use #ifdef SYM (vs #if SYM) when SYM may be undefined
Use ptrdiff_t rather than int for pointer differences
Correct signedness problems
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.
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.
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.
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
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.
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.