Commit Graph

337 Commits

Author SHA1 Message Date
Lassi Kortela e19fe0b8bd Remove time.string and time.fromstring builtins
They are of dubious value, and the C implementation uses #if.
2019-08-09 21:50:52 +03:00
Lassi Kortela 36e2057616 Do not include count_bits() all over the place 2019-08-09 21:41:37 +03:00
Lassi Kortela c84c71adcc Get rid of INLINE and STATIC_INLINE
Nowadays compilers have good optimizers that know when to inline static
functions depending on the user's chosen optimization level (and speed vs size
optimization). We don't need to annotate functions manually.
2019-08-09 21:35:20 +03:00
Lassi Kortela 12fb30462b Simplify endian (byte order) detection
The following:

    #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
    #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__

are apparently semi-standard nowadays.
2019-08-09 21:30:30 +03:00
Lassi Kortela 5817003816 Replace index_t with uintptr_t 2019-08-09 21:13:48 +03:00
Lassi Kortela c0ef0c2549 Remove more useless typedefs 2019-08-09 21:11:40 +03:00
Lassi Kortela 36fd757689 Replace ptrint_t with standard intptr_t 2019-08-09 21:07:16 +03:00
Lassi Kortela b35ab48437 Replace "preferred int type" with intptr_t 2019-08-09 21:04:19 +03:00
Lassi Kortela d6a4029dde Replace idiosyncratic C types with standard ones
For number types, we rely on classic C types (char, short, int, long) to be
the correct sizes. For precise bit widths, use standard intN_t and uintN_t.
For size_t, just use system size_t.
2019-08-09 21:00:03 +03:00
Lassi Kortela d5d7406276 Remove unused Boehm GC hooks 2019-08-09 20:37:42 +03:00
Lassi Kortela 10ffed569e Fix build errors and warnings for OpenBSD 2019-08-09 20:20:17 +03:00
Lassi Kortela b7b4269455 Replace strcpy() and strcat() with safer functions 2019-08-09 20:14:42 +03:00
Lassi Kortela b5946dea77 Remove unused INITFILE config option 2019-08-09 20:11:02 +03:00
Lassi Kortela bb78dc0634 Fix compiler warnings (clang -Wextra) 2019-08-09 19:53:35 +03:00
Lassi Kortela 7d93f262a7 Set C compiler options -Wextra -std=gnu99 2019-08-09 19:50:21 +03:00
Lassi Kortela 45a7ec7bc4 Remove include protections
Since we no longer have recursive includes, we don't need them. Removing the
protections uncovered a couple of accidental double-includes: good.
2019-08-09 19:47:22 +03:00
Lassi Kortela fe4550dad7 Replace cvalue_t with struct 2019-08-09 19:36:20 +03:00
Lassi Kortela b48261f21c Replace fltype_t with struct 2019-08-09 19:33:04 +03:00
Lassi Kortela c9f5e4faeb Replace symbol_t with struct 2019-08-09 19:30:15 +03:00
Lassi Kortela 193ced5e73 Replace cons_t with struct 2019-08-09 19:28:14 +03:00
Lassi Kortela d6f1579e17 Replace cprim_t with struct 2019-08-09 19:26:48 +03:00
Lassi Kortela fdcdd865b4 Replace function_t with struct 2019-08-09 19:26:48 +03:00
Lassi Kortela ece07d2e1a Replace cvtable_t with struct 2019-08-09 19:26:48 +03:00
Lassi Kortela 428e7a3825 Replace builtinspec_t with struct 2019-08-09 19:26:48 +03:00
Lassi Kortela e54797e4eb Replace fl_exception_context_t with struct 2019-08-09 19:26:48 +03:00
Lassi Kortela 262ace1efd Replace fl_readstate_t with struct 2019-08-09 19:26:42 +03:00
Lassi Kortela b561f9d4b0 Replace gensym_t with struct 2019-08-09 19:26:33 +03:00
Lassi Kortela f2fb37e520 Replace ios_t with struct 2019-08-09 19:26:20 +03:00
Lassi Kortela 41cf0e7b2c Replace htable_t with struct 2019-08-09 19:26:09 +03:00
Lassi Kortela 79d44c0780 Get rid of almost all recursive includes
Simple rule: include files should never include include files.

"Notes on Programming in C", Rob Pike, February 21, 1989
<https://www.lysator.liu.se/c/pikestyle.html>
2019-08-09 19:00:17 +03:00
Lassi Kortela 0701b22d29 Rename #include'd C files from .c to .h 2019-08-09 18:30:02 +03:00
Lassi Kortela d69e40aa3a Delete unused C file 2019-08-09 18:22:10 +03:00
Lassi Kortela 1caa8f9cf3 Update copyright statement in LICENSE file 2019-08-09 18:10:54 +03:00
Lassi Kortela 85efbbc7ce Sort C file names in build.sh 2019-08-09 17:30:49 +03:00
Lassi Kortela b4c3c64f94 Generate new boot image after tabs-to-spaces conversion 2019-08-09 17:25:13 +03:00
Lassi Kortela 04b3c3b292 Replace tabs with spaces in Lisp printer 2019-08-09 17:25:13 +03:00
Lassi Kortela be9b2b364e Clean up whitespace
- Tabs to spaces
- Remove invisible whitespace at ends of lines
- Break or shorten long lines (not for all files)
2019-08-09 17:25:13 +03:00
Lassi Kortela 09c6368668 Run renamed .inc files by clang-format for the first time 2019-08-09 17:25:13 +03:00
Lassi Kortela 4128fbc535 Rename .inc files to use .h extension 2019-08-09 17:18:21 +03:00
Lassi Kortela 8e35d98142 Move bootstrap images into a scheme-boot directory 2019-08-09 15:53:31 +03:00
Lassi Kortela aaf73c8439 Consolidate all Lisp files into scheme-* with .scm extension 2019-08-09 15:21:56 +03:00
Lassi Kortela d6f54bc13c Consolidate all C files into a "c" subdirectory 2019-08-09 15:02:58 +03:00
Lassi Kortela 53e6421ce1 Remove curiosity files from tree 2019-08-09 15:02:04 +03:00
Lassi Kortela 349a42510f Replace makefiles with a simple shell script
Build, bootstrap and test everything in one go. Put build artifacts in a
separate subdirectory which is emptied at the start of every build.
2019-08-09 14:56:16 +03:00
Lassi Kortela 82e09fa92b Avoid clang warnings about undefined signed shift behavior
Calls to fixnum(-1) would cause them.
2019-08-09 14:06:36 +03:00
Lassi Kortela b128aee83d Add .editorconfig file to match clang-format 2019-08-09 14:03:13 +03:00
Lassi Kortela 6a6a7071a9 Run clang-format on all C code for the first time 2019-08-09 14:02:02 +03:00
Lassi Kortela 7ab81c9e56 Change some more clang-format settings to my liking 2019-08-09 13:59:27 +03:00
Lassi Kortela 0fdee2f7b8 Change clang-format to keep "} else" brace on same line 2019-08-09 13:59:18 +03:00
Lassi Kortela 0270f8628d Change clang-format AlignEscapedNewlines setting
whatstyle didn't catch that the original codebase is aligning
backslashes at the ends of lines in long preprocessor macro
definitions. The "Left" setting closely matches the original code.
2019-08-09 13:58:51 +03:00