If there are FIELDS fields, return the total padding up to the start of field I, where I < FIELDS. PAD is the total padding for all fields. The result equals (PAD * I) / FIELDS, except it does not suffer from internal overflow. */
| 516 | all fields. The result equals (PAD * I) / FIELDS, except it does |
| 517 | not suffer from internal overflow. */ |
| 518 | static idx_t |
| 519 | pad_at (idx_t fields, idx_t i, idx_t pad) |
| 520 | { |
| 521 | /* This implementation assumes that (FIELDS - 1)^2 does not overflow |
| 522 | intmax_t, an assumption checked by pad_at_overflow. */ |
| 523 | intmax_t m = pad % fields; |
| 524 | return pad / fields * i + m * i / fields; |
| 525 | } |
| 526 | static bool |
| 527 | pad_at_overflow (idx_t fields) |
| 528 | { |
no outgoing calls
no test coverage detected