1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-13 23:27:12 +00:00
Nick Briggs 533c935e72
Fix various bugprone warnings (#397)
* Fix some warnings in main.c

main.c:678: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined
main.c:493: The return value from the call to 'seteuid' is not checked.

* Fix some warnings in array operations

Instead of extracting typenumbers to an 'int', use the unsigned typenumber directly

array3.c:49: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
array4.c:61: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
array5.c:63: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
array6.c:50: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined

* Resolve type mismatches for version numbers and propp flag

dir.c:1849: narrowing conversion from 'unsigned int' to signed type 'int'
dir.c:1850: narrowing conversion from 'unsigned int' to signed type 'int'
dir.c:2114: narrowing conversion from 'unsigned long' to signed type 'int'
dir.c:2207: narrowing conversion from 'unsigned int' to signed type 'int'

* Resolve type mismatches for version numbers and strlen result type

dsk.c:1072: narrowing conversion from 'unsigned long' to signed type 'int'
dsk.c:1108: narrowing conversion from 'unsigned long' to signed type 'int'
dsk.c:1549: narrowing conversion from 'unsigned long' to signed type 'int'
dsk.c:1712: narrowing conversion from 'unsigned long' to signed type 'int'
dsk.c:1751: narrowing conversion from 'unsigned long' to signed type 'int'
dsk.c:3426: narrowing conversion from 'unsigned int' to signed type 'int'

* Resolve type mismatches for strlen result type

ufs.c:213: narrowing conversion from 'unsigned long' to signed type 'int'
ufs.c:404: narrowing conversion from 'unsigned long' to signed type 'int'

* Resolve type error

uutils.c:117: 'signed char' to 'int' conversion [bugprone-signed-char-misuse,cert-str34-c]
2021-09-16 17:24:25 -07:00
2021-09-16 17:24:25 -07:00
2021-09-16 17:24:25 -07:00
2020-12-29 11:00:24 -08:00

Maiko

Maiko is the implementation of the Medley Interlisp virtual machine, for a byte-coded Lisp instruction set and some low-level functions for connecting with Lisp for access to display (via X11) and disk etc.

For an overview, see Medley Interlisp Introduction.

See the Medley repository for

Bug reports, feature requests, fixes and improvements, support for additional platforms and hardware are all welcome.

Development Platforms

We are developing on FreeBSD, Linux, MacOS, and Solaris currently on arm7l, arm64, PowerPC, SPARC, i386, and x86_64 hardware.

Building Maiko

Building requires clang, make, X11 client libraries (libx11-dev). For example,

$ sudo apt update
$ sudo apt install clang make x11dev
$ cd maiko/bin
$ ./makeright x
  • The build will (attempt to) detect the OS-type and cpu-type. It will build binaries lde and ldex in ../ostype.cputype (with .o files in ..ostype.cputype-x. For example, Linux on a 64-bit x86 will use linux.x86_64, while MacOS 11 on a (new M1) Mac will use darwin.aarch64.
  • If you prefer using gcc over clang, you will need to edit the makefile fragment for your configuration (makefile-ostype.cputype-x) and comment out the line (with a #) that defines CC for clang and uncomment the line (delete the #) for the line that defines CC for gcc.
  • There is a cmake configuration (TBD To Be Described here).

Building For MacOS

  • Running on MacOS requires an X server, and building on a Mac requires X client libraries. An X-server for MacOS (and X11 client libraries) can be freely obtained at https://www.xquartz.org/releases

Building for Windows 10

Windows 10 currently requires "Docker for Desktop" or WSL2 and a (Windows X-server). See Medley's README for more.

Languages
C 95.6%
Assembly 3.4%
CMake 0.5%
Shell 0.3%
sed 0.2%