Increase nbytes to make it a multiple of n. Works for any n.
| 501 | |
| 502 | // Increase nbytes to make it a multiple of n. Works for any n. |
| 503 | size_t padn(uint32_t n, size_t nbytes) { |
| 504 | return (size_t)(n * ceilf((float)nbytes / n)); |
| 505 | } |
| 506 | |
| 507 | // Calculate number of bytes to add to nbytes to make it a multiple of n. |
| 508 | // Works for any n. |
no outgoing calls
no test coverage detected