Code Standard
Below is a list of requirements for submitting code to Unununium.
1. Legal requirements
- The source code, and all accompanying files, must be made available under the BSD License
2. Required Documentation
- All private and public functions must be clearly identified
- The purpose of each function, as well as how it could, or not, be used under a different context must be clearly accessible (above the function in the source or indexed in a central document)
- All required parameters for each function, including global data, and the valid values and formats of these parameters must be documented along with the function’s purpose. Reference to documents, available under the same license or under the public domain, will be accepted.
- The source code must be readable and clearly laid out.
- The minimum and maximum stack usage requirements must be documented for each function.
3. Source Code:
- All input parameters, including used globals, must be verified prior to being used in all functions.
- All output parameters, including stored globals, must be verified for validity and correctness prior to being returned.
- All memory pointers should be verified to be non-null, and memory aligned with the data size of the operand (32-bits aligned for dword pointers, etc).
- When performing mathematical operations, including increment, decrement, multiplications and divisions, there must be a check either prior the operations or after to ensure that the results will be as expected, that no overflow or underflow occurred or will occur.