From: John Tsiombikas Date: Sun, 15 May 2022 19:51:52 +0000 (+0300) Subject: added code conventions section in the README X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=commitdiff_plain;h=cfa71f2849ee3482ebe617931972657b6a69c930 added code conventions section in the README --- diff --git a/.clang-format b/.clang-format index c2b7d66..b54f2e9 100644 --- a/.clang-format +++ b/.clang-format @@ -1,3 +1,3 @@ UseTab: Always -IndentWidth: 8 -ColumnLimit: 100 +IndentWidth: 4 +ColumnLimit: 90 diff --git a/README.md b/README.md index 5db81a5..6d34b63 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,31 @@ Source structure - libs/imago/ image loading library (includes libpng, zlib, libjpeg) - libs/anim/ keyframe animation library +Coding style conventions +------------------------ +Very few style issues are mandated: + + - All filenames should be lowercase unless convention says otherwise + (`Makefile`, `README`, etc). + - All filenames under `src/` and of any tools necessary to build from MS-DOS + will have to use maximum 8.3 characters. + - Source code should be C89-compliant. Any compiler-specific features beyond + that will have to be ifdefed. + - Use tabs for indentation, where each tab is equivalent to 4 spaces. + +Everything else is left to the discretion of each individual, but also if +you're editing an existing file, try to match the style of the surrounding code. + +Some general style suggestions, which will not be enforced: + + - Don't use overly long names, abbreviate wherever it makes sense. + - Don't cast the return value of malloc. `void*` are converted implicitly, and + the cast hides forgetting to include `stdlib.h`. + - Preferably use lowercase with underscores for everything. + - Preferably use the K&R brace style if possible. + +This section will be expanded as necessary. + Building on DOS with Watcom --------------------------- Make sure you have Watcom or OpenWatcom installed, and the appropriate env-vars