… | |
… | |
66 | Returns true iff the expression can be deduced to be a compile-time |
66 | Returns true iff the expression can be deduced to be a compile-time |
67 | constant, and false otherwise. |
67 | constant, and false otherwise. |
68 | |
68 | |
69 | For example, when you have a C<rndm16> function that returns a 16 bit |
69 | For example, when you have a C<rndm16> function that returns a 16 bit |
70 | random number, and you have a function that maps this to a range from |
70 | random number, and you have a function that maps this to a range from |
71 | 0..n-1, then you could use this inline fucntion in a header file: |
71 | 0..n-1, then you could use this inline function in a header file: |
72 | |
72 | |
73 | ecb_inline uint32_t |
73 | ecb_inline uint32_t |
74 | rndm (uint32_t n) |
74 | rndm (uint32_t n) |
75 | { |
75 | { |
76 | return n * (uint32_t)rndm16 ()) >> 16; |
76 | return n * (uint32_t)rndm16 ()) >> 16; |