Lassi Kortela
10763df501
Add fallthrough comments to switch cases
...
Some versions of GCC warn otherwise, which is good.
2019-08-10 01:01:40 +03:00
Lassi Kortela
e9d6ca265c
Unify preprocessor checks for win32
...
<https://sourceforge.net/p/predef/wiki/OperatingSystems/ > says that _WIN32 is
always defined for both 32-bit and 64-bit versions of Windows.
2019-08-10 00:12:33 +03:00
Lassi Kortela
8a7ce61575
Replace uses of alloca() with malloc()
...
Gets rid of more #ifdef magic.
2019-08-09 23:45:10 +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
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
10ffed569e
Fix build errors and warnings for OpenBSD
2019-08-09 20:20:17 +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
d6f54bc13c
Consolidate all C files into a "c" subdirectory
2019-08-09 15:02:58 +03:00