From 7aca15b071d04730e6aeccc0a441a308cde25919 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 15 Mar 2022 21:45:45 -0500 Subject: [PATCH] changes to contributing guidelines --- CONTRIBUTING.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f57b2025..ad608e4cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,6 +33,23 @@ the coding style is described here: - indent switch cases - preprocessor directives not intended - if macro comprises more than one line, indent +- prefer built-in types: + - `bool` + - `signed char` or `unsigned char` are 8-bit + - when the type is `char`, **always** specify whether it is signed or not. + - unspecified `char` is signed on x86 and unsigned on ARM, so yeah. + - the only situation in where unspecified `char` is allowed is for C strings (`const char*`). + - `short` or `unsigned short` are 16-bit + - `int` or `unsigned int` are 32-bit + - `float` is 32-bit + - `double` is 64-bit + - `long long int` or `unsigned long long int` are 64-bit + - avoid using 64-bit numbers as I still build for 32-bit systems. + - two `long`s are required to make Windows happy. + - `size_t` are 32-bit or 64-bit, depending on architecture. +- in float/double operations, always use decimal and `f` if single-precision. + - e.g. `1.0f` or `1.0` instead of `1`. +- don't use `auto` unless needed. some files (particularly the ones in `src/engine/platform/sound` and `extern/`) don't follow this style.