###Assign instead of return.
Assign instead of return.
This is not really standard C, but works with every compiler and CPU that I know of:
int sqr(int a){return a*a;}
has the same effect as:
int sqr(int a){a*=a;}
Because the first argument is stored into the same CPU register as the return value.
Note: As noted in one comment, this is undefined behaviour and not guaranteed to work for every operation. And any compiler optimization will just skip over it.
X-Macros
###X-Macros AnotherAnother useful feature: X-Macros can help you when you have a list of variables and you need to do some operation which involve all of them: