Commit Graph

8 Commits

Author SHA1 Message Date
Lassi Kortela a02557230b Consolidate (almost) all #include's into new "scheme.h" 2019-08-26 22:12:15 +03:00
Lassi Kortela 3dc58baa4a Include <sys/types.h> to get off_t
This header is even shipped by Windows compilers. The iostream stuff
uses off_t.
2019-08-18 00:09:43 +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 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 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