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.
* 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()
* 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
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.
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.
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.
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)) ...
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.
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.
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.
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.
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.
* 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
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.
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.