explaining #define

In the following file setjmp.h from apple :

http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/i386/setjmp.h

there is a macro defined as :

#define _JBLEN ((9*2) +3 +16);

why didnot the author choose to write 37 instead of "(9*2) +3 +16 " in the above code ?
although there were no comments , there must be a purpose of these nunbers , any ideas?

Thanks!
Last edited on
Perhaps the author was too lazy to do the math? The author also could have been illustrating where the number came from. Some mathematics are tough to follow if steps are skipped. For example when solving a really big algebraic equation on paper, more experienced mathematicians can do most of the work in their head. But if they are asked to explain their work by somebody who is not understanding they might have to show more of the intermediate steps that were taken.
It's explained in a comment before the first instance where _JBLEN is defined:
1
2
3
4
5
6
7
8
#if defined(__x86_64__)
/*
 * _JBLEN is number of ints required to save the following:
 * rflags, rip, rbp, rsp, rbx, r12, r13, r14, r15... these are 8 bytes each
 * mxcsr, fp control word, sigmask... these are 4 bytes each
 * add 16 ints for future expansion needs...
 */
#define _JBLEN ((9 * 2) + 3 + 16) 
Topic archived. No new replies allowed.