… | |
… | |
58 | |
58 | |
59 | =head2 TYPES / TYPE SUPPORT |
59 | =head2 TYPES / TYPE SUPPORT |
60 | |
60 | |
61 | ecb.h makes sure that the following types are defined (in the expected way): |
61 | ecb.h makes sure that the following types are defined (in the expected way): |
62 | |
62 | |
63 | int8_t uint8_t int16_t uint16_t |
63 | int8_t uint8_t int16_t uint16_t |
64 | int32_t uint32_t int64_t uint64_t |
64 | int32_t uint32_t int64_t uint64_t |
65 | intptr_t uintptr_t |
65 | intptr_t uintptr_t ptrdiff_t |
66 | |
66 | |
67 | The macro C<ECB_PTRSIZE> is defined to the size of a pointer on this |
67 | The macro C<ECB_PTRSIZE> is defined to the size of a pointer on this |
68 | platform (currently C<4> or C<8>). |
68 | platform (currently C<4> or C<8>). |
69 | |
69 | |
70 | =head2 GCC ATTRIBUTES |
70 | =head2 GCC ATTRIBUTES |
… | |
… | |
436 | For example: |
436 | For example: |
437 | |
437 | |
438 | ecb_ctz32 (3) = 0 |
438 | ecb_ctz32 (3) = 0 |
439 | ecb_ctz32 (6) = 1 |
439 | ecb_ctz32 (6) = 1 |
440 | |
440 | |
|
|
441 | =item bool ecb_is_pot32 (uint32_t x) |
|
|
442 | |
|
|
443 | =item bool ecb_is_pot64 (uint32_t x) |
|
|
444 | |
|
|
445 | Return true iff C<x> is a power of two or C<x == 0>. |
|
|
446 | |
|
|
447 | For smaller types then C<uint32_t> you can safely use C<ecb_is_pot32>. |
|
|
448 | |
441 | =item int ecb_ld32 (uint32_t x) |
449 | =item int ecb_ld32 (uint32_t x) |
442 | |
450 | |
443 | =item int ecb_ld64 (uint64_t x) |
451 | =item int ecb_ld64 (uint64_t x) |
444 | |
452 | |
445 | Returns the index of the most significant bit set in C<x>, or the number |
453 | Returns the index of the most significant bit set in C<x>, or the number |