|
Tor 0.4.9.3-alpha-dev
|
#include "lib/cc/torint.h"Go to the source code of this file.
Macros | |
| #define | CEIL_DIV(a, b) (((a)+((b)-1))/(b)) |
Functions | |
| unsigned | round_to_next_multiple_of (unsigned number, unsigned divisor) |
| uint32_t | round_uint32_to_next_multiple_of (uint32_t number, uint32_t divisor) |
| uint64_t | round_uint64_to_next_multiple_of (uint64_t number, uint64_t divisor) |
| uint64_t | tor_mul_u64_nowrap (uint64_t a, uint64_t b) |
| void | simplify_fraction64 (uint64_t *numer, uint64_t *denom) |
| unsigned round_to_next_multiple_of | ( | unsigned | number, |
| unsigned | divisor | ||
| ) |
Return the lowest x such that x is at least number, and x modulo divisor == 0. If no such x can be expressed as an unsigned, return UINT_MAX. Asserts if divisor is zero.
Definition at line 21 of file muldiv.c.
Referenced by geoip_get_client_history(), geoip_get_request_history(), and rate_limit_log().
| uint32_t round_uint32_to_next_multiple_of | ( | uint32_t | number, |
| uint32_t | divisor | ||
| ) |
Return the lowest x such that x is at least number, and x modulo divisor == 0. If no such x can be expressed as a uint32_t, return UINT32_MAX. Asserts if divisor is zero.
Definition at line 35 of file muldiv.c.
Referenced by geoip_format_dirreq_stats(), and rep_hist_format_exit_stats().
| uint64_t round_uint64_to_next_multiple_of | ( | uint64_t | number, |
| uint64_t | divisor | ||
| ) |
Return the lowest x such that x is at least number, and x modulo divisor == 0. If no such x can be expressed as a uint64_t, return UINT64_MAX. Asserts if divisor is zero.
Definition at line 50 of file muldiv.c.
Referenced by geoip_get_transport_history(), rep_hist_format_exit_stats(), and rep_hist_format_hs_stats().
| void simplify_fraction64 | ( | uint64_t * | numer, |
| uint64_t * | denom | ||
| ) |
| uint64_t tor_mul_u64_nowrap | ( | uint64_t | a, |
| uint64_t | b | ||
| ) |
Return the unsigned integer product of a and b. If overflow is detected, return UINT64_MAX instead.
Definition at line 75 of file muldiv.c.
Referenced by config_parse_units().