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

279 Commits

Author SHA1 Message Date
Nick Briggs
aa29914b2b rs232c.h does not directly reference Lisp_world and both rs232 implementations include lspglob.h for it 2023-02-17 17:01:27 -08:00
Nick Briggs
2b7228f37e Remove typedefs for function pointers and their uses. Methods which are defined but never used get (void) args until they are implemented. 2023-02-17 17:01:27 -08:00
Nick Briggs
4853f0e3f5 Fix missing prototype adding ttydefs.h, declare tty_baudtosymbol() as static. 2023-02-17 17:01:27 -08:00
Nick Briggs
80c9c796c5 Address "warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x"
* Update struct DevRec methods to take a "void *" parameter
   since they get called with different xxxInterface records
   depending on whether they are a keyboard, mouse, or display.
   Introduce GenericReturnVoid method implementation for use
   where needed with DevRec methods. (see mouseif.c)

 * Cast functions implementing DevRec methods as appropriate to match
   the method signature.

 * Update struct DspInterfaceRec methods cleardisplay,
   bitblt_to_screen, mouse_invisible, and mouse_visible to declare
   the parameters they require and all return unsigned long results
   (though it's not clear that this is actually the correct type).
   Requires updating dosmouse.c method implementations.

 * Update GenericReturnT and GenericPanic method implementations
   to have the signature required by the method slots they
   are used in.

 * Correct DOS-only section with incorrect arguments to device.exit
   call for the mouse.

 * Use include "dspifdefs.h" for prototypes for GenericReturnXXX method
   implementations.
2023-02-17 17:01:27 -08:00
Nick Briggs
d5acdf7ea4 Static analysis suggests savedS might be used uninitialized (pathlength > 150). It is or-ed into a result, so initialize to 0 2023-02-17 17:01:27 -08:00
Nick Briggs
a3ba41fba2 fix warning: a function declaration without a prototype is deprecated in all versions of C
make savestr() static and remove it from dlpidefs.h since it is not used outside of dlpi.c
2023-02-17 17:01:27 -08:00
Nick Briggs
6838c701cc fix warning: a function declaration without a prototype is deprecated in all versions of C 2023-02-17 17:01:27 -08:00
Nick Briggs
81d459be16 Substitute include <errno.h> for extern int errno. 2023-02-17 17:01:27 -08:00
Nick Briggs
36a7422ebc Correct malformed connectToHub prototype and definition 2023-02-17 17:01:27 -08:00
Nick Briggs
aa177fa40a Make typedefs for struct xxxRec/xxx clearer. 2023-02-17 17:01:27 -08:00
Nick Briggs
60e13a774d Net reduction of about 150 warnings when compiling with clang 15.0.6
devif.h, mnxdefs.h:
Update MRegion to reflect that width/height are unsigned.
Update ...EventMask fields in XWINDOW section of DspInterfaceRec to match parameter
   type used in XSelectInput() to which they are passed.
Add padding to explicitly align colors field (short among longs)

xbitmaps.h:
Reorder fields in LISP_CURSOR struct to avoid requiring padding for alignment
   constraints, and adjust initialization to match.
Declare cursors static const.
Move Lisp_Icon from xbitmaps.h to xmkicon.c

xinit.c, xinitdefs.h
Replace bound() (xwinmandefs.h) with static inline unsigned ubound() in xinit.c
Change signature of X_init() to use unsigned values for width, height, depth.
Add casts where necessary to avoid implicit signedness conversions.
Add extern declarations for all globals defined in xinit.c

xwinman.c, xwinmandefs.h
Remove bound() from xwinmandefs.h and use static inline unsigned ubound() in xwinman.c
Change signature of lisp_Xconfigure() to use unsigned width and height parameters.
Make GravSize unsigned to match its usage context.
Add casts where necessary to avoid implicit signedness conversions.
Add missing break to correct switch case fall-through warning.

dspif.c
Change LispDisplayRequestedWidth/Height to unsigned to reflect context of use.

xlspwin.c
Eliminate declaration for unused XEvent report.
Move global variable gcv, used only locally, to local variable in the procedures where needed.
Change various variables used in width/height calculation to unsigned to match usage context.
Add casts where necessary to avoid implicit signedness conversions.

xmkicon.c
Move Lisp_Icon from xbitmaps.h to xmkicon.c.
Move global XImage IconImage to local in function where it is required.
Add cast where necessary to avoid implicit signedness conversions.

xrdopt.c
Remove incorrect casts for signedness causing implicit sign conversion warnings.
Add extern declarations for all globals defined in xrdopt.c

xscroll.c
Replace bound() (xwinmandefs.h) with static inline signed sbound() in xscroll.c

initdsp.c, initdspdefs.h
Change signedness of various display variables from int to unsigned.
Change signature of init_display2() to unsigned display_max.
Add extern declarations for some globals defined in initdsp.c

xbbt.c
Add explicit casts for type warnings from MRegion width/height change.
Add explicit casts for type warnings in arguments to XPutImage().
2023-02-17 17:01:27 -08:00
Nick Briggs
6e38d50829
Improve implementation of word_swap_page() and remove unused code (#447)
word_swap_page() should only touch each 32-bit word once to change
  the byte order from ABCD to DCBA rather than twice doing a transform
  of the entire region from ABCD to BADC and then again to DCBA

  The compiler provided ntohl() usually gets favorable optimizations
  applied, so use it for the byte reordering.

  With word_swap_page() rewritten, byte_swap_word() is superfluous.
2022-10-30 15:49:32 -07:00
devhawala
82577ce951
Dodo Nethub support (#445)
* added support for XNS networking via Dodo-Nethub

* NetHub connection now optional (only if -nh-host is given); released NetHub-related changes to 'ether.c' to the public domain

* Added file using-dodo-networking-with-maiko.md

Documentation for building and using the Dodo-networking addition to Maiko

* Added support for running Maiko unter cygwin/x86_64-x

* Migrate Addr68k/NativeAlignment{2,4} in Nethub code, move timer/async defines to platform.h

* added missing include <netinet/in.h> for FreeBSD

* updated 'compile-flags' with added flags

* splitted ether.c in 3 (_common, _sunos, _nethub)

* reworks/modifications for nbriggs' pull-request review comments

* addintional additions for nbriggs' pull-request review comments

* get the Lisp packet lengths with 'LispInt2CInt'

* renamed variables in dblwordsSwap to indicate it's about double-words

* fixed wrong preprocessor directive unnoticed by clang

* added networking choice option to cmake build, fix to printf warning

- for cmake specify the networking to use with -DMAIKO_NETWORK_TYPE=<type>
- with <type> one of: NONE, SUN_DLPI, SUN_NIT, NETHUB
- e.g.: cmake .. -DMAIKO_NETWORK_TYPE=NETHUB

* integrated improvement to sendPacket() proposed by nbriggs

* integrated fix for SIGBUS on 32-bit big-endian, provided by nbriggs

* MAIKO_ENABLE_ETHERNET should not be unconditionally set on Solaris systems

* Receiving an ethernet packet is an ether interrupt but not an i/o interrupt.

Co-authored-by: dev hawala <devhawala@x.y>
Co-authored-by: Nick Briggs <nicholas.h.briggs@gmail.com>
2022-10-11 14:21:55 -07:00
Nick Briggs
cdffa541ef
Remove extra semicolons, convert #define x() {...} to do {...} while (0) style (#444)
* Remove extra semicolons, convert #define x() {...} to do {...} while (0) style

* Fix missing brace in INIT-specific definition of init_kbd_startup
2022-10-05 09:07:17 -07:00
Nick Briggs
c2070d9892 Remove definitions of Addr68k/StkOffset macros which have been replaced by inline functions. 2022-09-28 15:21:50 -07:00
Nick Briggs
344351acba Replace StkOffset related macros with StackOffset inline functions 2022-09-28 15:17:53 -07:00
Nick Briggs
94a41d2a5b Replace Addr68k related macros with NativeAligned inline functions 2022-09-01 14:15:35 -07:00
Nick Briggs
2c4ccf54c3 Replace Addr68k related macros with NativeAligned inline functions 2022-09-01 14:15:35 -07:00
Nick Briggs
903a7f64fc Replace Addr68k related macros with NativeAligned inline functions 2022-09-01 14:15:35 -07:00
Nick Briggs
a9dcff6fd6 Replace Addr68k related macros with NativeAligned inline functions 2022-09-01 14:15:35 -07:00
Nick Briggs
049568b0f8 Replace Addr68k related macros with NativeAligned inline functions 2022-09-01 14:15:35 -07:00
Nick Briggs
d4226c20f2 Replace Addr68k related macros with NativeAligned inline functions
Addr68k_from_LADDR always produced a 2-byte aligned pointer which
  was frequently cast to a type requiring 4-byte alignment.
  This commit changes Addr68k_from_LADDR uses to one of two new
  inline procedures, NativeAligned2FromLAddr or NativeAligned4FromLAddr,
  which produce a result with the appropriate alignment for the context.
  This permits checking for cases where the Lisp address is not
  appropriately aligned for the usage context, and localizes compiler
  warnings to these two procedures.

  Similarly, the Addr68k_from_StkOffset macros are replaced by
  NativeAligned2FromStackOffset and NativeAligned4FromStackOffset.

  NativeAligned4FromLPage replaces Addr68k_from_LPAGE as page address
  will always be at least 4-byte aligned.

  LAddrFromNative, LPageFromNative, and StackOffsetFromNative complete
  the set, replacing LADDR_from_68k, LPAGE_from_68k, and
  StkOffset_from_68K (note K not k) respectively.
2022-09-01 14:11:54 -07:00
Nick Briggs
889adcaa35 Add NativeAligned4FromStackOffset() and LPageFromNative() before using them 2022-09-01 12:53:24 -07:00
Nick Briggs
78f0d3c511 Convert from LADDR_from_68k to LAddrFromNative in inlnSPARC.h 2022-09-01 12:53:24 -07:00
Nick Briggs
ed77b2fb7b Convert to LAddrFromNative, NativeAligned2FromLAddr in return.h 2022-09-01 12:53:23 -07:00
Nick Briggs
7dc889249b Convert from LADDR_from_68k to LAddrFromNative in arith.h 2022-09-01 12:53:23 -07:00
Nick Briggs
ee777103ad Convert from Addr68k_from_LADDR/LADDR_from_68k to NativeAligned4FromLAddr/LAddrFromNative in stack.h 2022-09-01 12:53:23 -07:00
Nick Briggs
cde0be42f0 Replace Addr68k_from_LADDR by NativeAligned[x]FromLAddr() as appropriate in inlineC.h 2022-09-01 12:53:23 -07:00
Nick Briggs
010329f29d Convert to NativeAligned4FromLAddr/LPage in macros defined in cell.h 2022-09-01 12:53:23 -07:00
Nick Briggs
8a0804831e Once and only once for code in GetXXX68k() and GetXXXnew() macros 2022-09-01 12:53:23 -07:00
Nick Briggs
eae42d1a6d Switch from Addr68k_from_LADDR to NativeAligned4FromLAddr in arith.h 2022-09-01 12:53:23 -07:00
Nick Briggs
ed5e504b06 Resolve ~90 cast-align warnings generated by macros in my.h 2022-09-01 12:53:23 -07:00
Nick Briggs
215a22ea9f Introduce functions to convert between lisp addresses and native pointers
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.
2022-09-01 12:53:23 -07:00
Nick Briggs
d35b964393 Cleanup in eqf.c
Correct procedure declarations since N_OP_xxx function args are all LispPTRs
    Replace my.h defn of IsNumber() with Numberp() defn in lsptypes.h
2022-08-15 16:19:38 -07:00
Nick Briggs
58f6f68c7e Correct procedure declarations since N_OP_xxx function args are all LispPTRs 2022-08-15 16:18:37 -07:00
Nick Briggs
873d4927ce Wholesale removal of deprecated register attribute from all source files 2022-08-15 15:04:07 -07:00
Nick Briggs
d509224797 Add explicit cast to byte_swap_word to resolve implicit conversion issue
warning: implicit conversion loses integer precision: 'int' to 'unsigned short'
2022-08-15 14:43:32 -07:00
Nick Briggs
89c01ad00a Fix pointer vs. unboxed fixp in certain fields in onde_array/general_array 2022-08-15 13:32:08 -07:00
Nick Briggs
3075cc93bb Fix types for smallp manipulation in arith.h
Introduce GetPosSmallp for converting an unsigned value to smallp
    Use [unsigned] long as input to Get...Smallp to avoid shortening input
2022-08-15 13:26:53 -07:00
Nick Briggs
4a02a1a24d Rename lisp2c's LispStringLength to LispStringSimpleLength
Avoid confusion with the LispStringLength definition in locfile.h
    This lisp2c function ONLY looks at the fillpointer for the length.
2022-08-14 21:43:48 -07:00
Nick Briggs
813d2aa2b5 Inline GetSmalldata and GetSmallp to improve type diagnostics, code, and readability in arith.h 2022-08-14 16:53:22 -07:00
Nick Briggs
8d804ad5cd Cleanup signedness, remove abuse of comma operator, use C99 local for-loop decls where appropriate 2022-08-14 13:46:27 -07:00
Nick Briggs
ad045ce356 Alarm timer requires an unsigned timeout value in timer.c, timeout.h 2022-08-14 12:50:16 -07:00
Nick Briggs
1c5881fad4 Cleanups in uutils.c
Resolve shadow declarations
    Remove deprecated register attribute
    Simplify for-loop syntax, use C99 style loop var declaration
    Make (not used elsewhere) string functions static
2022-08-14 11:44:27 -07:00
Nick Briggs
89c3041339 bitmaps only referenced internally in xbitmaps.h can be static 2022-08-14 10:34:24 -07:00
Nick Briggs
142b5679cf Use correct type for FIXP (and pointer to it), and reformat for readability in my.h 2022-08-13 19:33:24 -07:00
Nick Briggs
0e7dc75fd9 Use correct type for pointer to FIXP in arith.h 2022-08-13 19:31:05 -07:00
Nick Briggs
5a7cfcbbe7 Correct procedure declarations since N_OP_xxx function args are all LispPTRs 2022-08-13 15:55:11 -07:00
Nick Briggs
9e2b3eb882 Types work out better and better code if not trying to over-optimize memory accesses in arith.h 2022-08-13 15:35:18 -07:00
Nick Briggs
d842b284ac correct prototype declaration for process_io_events 2022-08-13 09:11:58 -07:00