Oops! In that last 7zip file I put the old version of the header in with the newer .c file, by accident.
Sorry about that, give me a few minutes and I'll attach the proper, updated files.
- First of all, please check your editor, the patch contains 4spaces per level instead of TABs in indentations.
- Second comments: there are two different kind of comments we use:
a) doygen:
/**
* @brief what this function does
* @param[in] param1 What is param1
* @param[in,out] param2 What is param2
* @return @c true if blabla...
*/
Always write doxygen comments for functions, our documentation is made of them automatically. (We also make doxy for macros/constants/structures which are not obvious)
b) normal comments
there is no asterisk leading for a normal comment
put normal comments in separate line if possible
- function signatures: put a space between function name and parameter list in the .c file but not in the .h file.
- if and the (condition) should also have a space between.
Wrong whitespace using will FAIL the pushing of the commit. We have some automatic tests for whitespace rules.
- I suggest using double precision types for the parameters
- I lost in the bracket jungles of macros in the header file, also in macros every parameter should be protected with brackets as they can be complex expressions on calling. (we agreed that they'll be better as inline functions)
- better parameter (and function) names if possible, please
- make the functions failsafe, now they can easily div by zero. If the parameters domain are strict you should explain it in the @param doxygen tag, and can check with at least an assert().
- there are much comments in the .h I don't get, can you clean them up? Or I should have some drink, to make it clear?
-geever