Well, I think this is not my preferred part of the job.
But anyway, about code indentation, here's my dictatorial choice:
Code:
signed char raydium_hdr_texture(int texture, signed char hdr)
{
//if(texture>=0 && texture<(int)raydium_texture_index)
if(raydium_texture_is_slot_used(texture))
{
raydium_texture_hdr[texture]=hdr;
return 1;
}
raydium_log("this is an example : %i",10);
return 0;
}
In plain english:
- Do not use unnecessary spaces: "a=10;" is better than "a = 10;"
- Same thing for function arguments, when calling: foobar(10,20);
- Put spaces for function declaration/prototypes.
- Do not place braces on the same line as the function, if, for, ...
- Typical exception to the preceding rule: if(foo) { bar=10; foo=0; } (note spaces around braces)
- Indent code blocks with braces (at the same level)
I'll edit vicente's message above, about comments, and post new messages here if some new ideas pops into my mind (may hurt). Ideas welcome.