Given an array of bucket sizes, and an initial value 'bucketEdge[0]', * add subsequent bucket edges of the given bucket sizes. * * Precondition: uint32_t bucketEdge[CHAR_COUNT]; * const uint32_t sizes[CHAR_COUNT]; */
| 53 | * const uint32_t sizes[CHAR_COUNT]; |
| 54 | */ |
| 55 | static void cumulative(uint32_t* restrict bucketEdge, const uint32_t* restrict sizes) { |
| 56 | uint32_t accumulator = bucketEdge[0] + sizes[0]; |
| 57 | for (unsigned int i = 1; i < CHAR_COUNT; ++i) { |
| 58 | bucketEdge[i] = accumulator; |
| 59 | accumulator += sizes[i]; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | /* Exchange two pointers. |
| 64 | * (a == b is acceptable.) |