Remove some junk from style.md and add general guidelines

This commit is contained in:
UnknownShadow200 2019-11-29 20:35:39 +11:00 committed by GitHub
parent b154d94348
commit b26ab73a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,15 @@
### Types ### Guidelines
* Integers generally use plain ```int```, floating point numbers use ```float``` or ```double```. * Code should be C89 compatible and compilable as C++.
* Explicit integer types are also provided in ```Core.h```. * Each .c file should represent a module. (see architecture.md for more details)
* There are a few typedefs of integer types to provide better context in some functions * Public functions and variables should be prefixed by module to avoid name collisions. (e.g. `Game_Reset`)
* A few common simple structs are typedef-ed, but are rarely otherwise. * Private functions should be named using pascal case. Prefixing module is optional - do it when it makes sense.
* ```bool``` is an alias for 8 bit unsigned integer * Private variables don't really have a consistent style.
* ```GfxResourceID``` is not constant type - can be pointer or integer, depending on underlying 3D graphics API
* ```PackedCol``` field order differs depending on the underlying 3D graphics API
As such, your compiler is required to support: ### Types
- explicit 8/16/32/64 bit signed and unsigned integers * Explicit integer typedefs are provided in ```Core.h``` for when needed. Otherwise just use int.
- 32 and 64 bit floating point numbers * A few common simple structs are typedef-ed, but are rarely otherwise.
* ```cc_bool``` is an alias for 8 bit unsigned integer
* ```PackedCol``` field order differs depending on the underlying 3D graphics API
I may not have defined the appropriate types for your compiler, so you may need to modify ```Core.h``` I may not have defined the appropriate types for your compiler, so you may need to modify ```Core.h```