1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-17 16:44:00 +00:00

1048 Commits

Author SHA1 Message Date
Nick Briggs
2cb51ad326 Silence warnings for incompatible pointer type assignments in stack pointer save/restore defines
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.
2023-02-17 17:01:27 -08:00
Nick Briggs
98a8d8be49 Add diagnostics for odd-sized stack free blocks and guard blocks, silence alignment upgrade warnings
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 *).
2023-02-17 17:01:27 -08:00
Nick Briggs
4cc267856b Correct types in array header and sequence descriptors to match Lisp datatypes
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.
2023-02-17 17:01:27 -08:00
Nick Briggs
ff7cf4f139 Use compile-time constant SMALLP_ZERO instead of GetSmallp(0) call 2023-02-17 17:01:27 -08:00
Nick Briggs
a7fba8d4bd Clean up various warnings
Number of items to be sorted (prepare_sort_buf, file_sort) is size_t
  Get consts in correct place arguments for comparison routines dsk_filecmp, unix_filecmp
  Use compile-time constant SMALLP_MINUSONE/SMALLP_ZERO instead of calling GetSmallp()
  ERRSETJMP(-1) should be ERRSETJMP(SMALLP_MINUSONE) as it must return a LispPTR
  Call GetPosSmallp() when argument is unsigned (correct type conversion warning)
2023-02-17 17:01:27 -08:00
Nick Briggs
d5490ed807 Rearrange/resize FINFO and FPROP structures to avoid compiler added padding 2023-02-17 17:01:27 -08:00
Nick Briggs
feb546c639 Correct syntax error (missing semicolon) in OPDISP branch table declaration 2023-02-17 17:01:27 -08:00
Nick Briggs
cdf6024452 Add compile-time constants for SMALLP values 0 and -1 2023-02-17 17:01:27 -08:00
Nick Briggs
96b3bddf12 Resolve warning: arithmetic on a pointer to void is a GNU extension
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.
2023-02-17 17:01:27 -08:00
Nick Briggs
e5894e5b81 Remove unused variable 'before' in check_dtd_chain() 2023-02-17 17:01:27 -08:00
Nick Briggs
b53b5bd710 Resolve unused-variable warning for DOSLispKeyMap_101
DOSLispKeyMap_101 will not be referenced unless compiling with -DDOS so wrap the
declaration in an #ifdef DOS.
2023-02-17 17:01:27 -08:00
Nick Briggs
39b12b20ba Resolve "warning: cast from 'DLword *' to 'LispPTR *' increases required alignment from 2 to 4"
by casting through (void *) since we know that the CurrentStackPTR is maintained with 4-byte
   aligned pointers.
2023-02-17 17:01:27 -08:00
Nick Briggs
fff86c8050 Resolve warning: implicit conversion changes signedness: 'unsigned int' to 'int' by
making the conversion explicit.  The signedness conversion is necessary and expected.
2023-02-17 17:01:27 -08:00
Nick Briggs
dadb754e56 Resolve "warning: cast from 'DLword *' to 'LispPTR *' increases required alignment from 2 to 4"
by casting through (void *) since we know that the CurrentStackPTR is maintained with 4-byte
   aligned pointers.

Resolve type error for user_subr argument.
2023-02-17 17:01:27 -08:00
Nick Briggs
6fdb54f2c8 Minor cleanup of some casts. 2023-02-17 17:01:27 -08:00
Nick Briggs
336c13369a Add explanation for xxxL macro definitions to xc.c
Define alternative macros for CSTKPTR, PVAR, and IVAR that can be used
in an lvalue context, since CSTKPTR = ...; would generate
error: assignment to cast is illegal, lvalue casts are not supported

A similar issue drives the PCMAC/PCMACL defines, although there it is
that the rvalue is (pccache - 1) and the lvalue is (pccache)
2023-02-17 17:01:27 -08:00
Nick Briggs
b3f97a85c8 Move misplaced 'break' out of 'if' consequent 2023-02-17 17:01:27 -08:00
Nick Briggs
d95b82ac45 Add (LispPTR) cast to VAG2 macro as this would otherwise produce a signed integer 2023-02-17 17:01:27 -08:00
Nick Briggs
ddc09e09ba Avoid type conversion from float to double implied by comparison to double 0.0 constant 2023-02-17 17:01:27 -08:00
Nick Briggs
f51d269b1e Ensure pointers have appropriate type and alignment for data being referenced 2023-02-17 17:01:27 -08:00
Nick Briggs
96fcc9475a Correct parameter type declaration error for N_OP_ubfloat1
Ensure pointers have appropriate alignment for data being referenced
2023-02-17 17:01:27 -08:00
Nick Briggs
c10d339036 Correct various warning: implicit conversion changes signedness (15)
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
2023-02-17 17:01:27 -08:00
Nick Briggs
7aca8bf599 Resolve warning: enumeration values not explicitly handled in switch 2023-02-17 17:01:27 -08:00
Nick Briggs
4a61a3fa6b Remove unused/obsolete LispWindowFd references/definition 2023-02-17 17:01:27 -08:00
Nick Briggs
c57ae7666d Resolve warning: no previous extern declaration for non-static variable 2023-02-17 17:01:27 -08:00
Nick Briggs
296ccb3ec9 Resolve warning: variable 'clbp' may be uninitialized when used (it's not, but initialize anyway)
Resolve warning: no previous extern declaration for non-static variable (Current_Hot_X, Current_Hot_Y)
2023-02-17 17:01:27 -08:00
Nick Briggs
dc893dda99 Make local procedures map_code_pointers() and remimplicitkeyhash() static and remove from gccodedefs.h 2023-02-17 17:01:27 -08:00
Nick Briggs
26737f3cbf Resolve warning: no previous extern declaration for non-static variable in gccode.c 2023-02-17 17:01:27 -08:00
Nick Briggs
235246ded3 Resolve warning: no previous extern declaration for non-static variable by making locals static. 2023-02-17 17:01:27 -08:00
Nick Briggs
6603957a0b Move extern declaration for IOINTERRUPTFLAGS_word to lspglob.h and remove from initsout.c
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.
2023-02-17 17:01:27 -08:00
Nick Briggs
6158162b62 Make local variables static to resolve warning: no previous extern declaration for non-static variable 2023-02-17 17:01:27 -08:00
Nick Briggs
13cd97ad41 Resolve warning: no previous extern declaration for non-static variable in ufs.c 2023-02-17 17:01:27 -08:00
Nick Briggs
215d4ff8c7 Make local variables static to resolve warning: no previous extern declaration for non-static variable 2023-02-17 17:01:27 -08:00
Nick Briggs
4b0eea260f Resolve warning: no previous extern declaration for non-static variable.
Declare ether broadcast address constant.
2023-02-17 17:01:27 -08:00
Nick Briggs
97cca299be Remove unused variable and resolve warning: no previous extern declaration for non-static variable in xc.c 2023-02-17 17:01:27 -08:00
Nick Briggs
904f5b4d3d Resolve warning: no previous extern declaration for non-static variable in lineblt8.c 2023-02-17 17:01:27 -08:00
Nick Briggs
2b126bd083 Resolve warning: no previous extern declaration for non-static variable in timer.c
Remove unreferenced extern LispWindowFd
2023-02-17 17:01:27 -08:00
Nick Briggs
ea022aa61c Resolve warning: no previous extern declaration for non-static variable in llcolor.c 2023-02-17 17:01:27 -08:00
Nick Briggs
a06e4c949d Move temporary colormap variables to stack allocated in the only routine in which they are used 2023-02-17 17:01:27 -08:00
Nick Briggs
d84f85c7e0 Remove local variables no longer needed for debugging. 2023-02-17 17:01:27 -08:00
Nick Briggs
526e559c8d Declare module local variables static in loopsops.c 2023-02-17 17:01:27 -08:00
Nick Briggs
cb441fd8e5 Declare local table generic_X_keymap static and constant, and adjust reference to it. 2023-02-17 17:01:27 -08:00
Nick Briggs
f18295480f Resolve warning: no previous extern declaration for non-static variable in initkbd.c 2023-02-17 17:01:27 -08:00
Nick Briggs
9d40ecd77a Update commentary for LispKbdFd, remove unused LispWindowFd extern reference 2023-02-17 17:01:27 -08:00
Nick Briggs
ade2b1461a Correct declared type of LispWindowFd and LispKbdFd 2023-02-17 17:01:27 -08:00
Nick Briggs
ce97f136ec Declare unexported variables static and remove unused debug-related variables. 2023-02-17 17:01:27 -08:00
Nick Briggs
bb1b541014 Add extern declarations for globals defined in xlspwin.c 2023-02-17 17:01:27 -08:00
Nick Briggs
7e2620db20 Remove extraneous forward declaration of contextsw() 2023-02-17 17:01:27 -08:00
Nick Briggs
50f88d9f05 Fix typo in comments, upnt => punt 2023-02-17 17:01:27 -08:00
Nick Briggs
b85e7cac80 Use (void *) casts in adr68k.h functions, after ensuring correct pointer alignment, to eliminate spurious alignment warnings. 2023-02-17 17:01:27 -08:00