|
Click
|
Functions for manipulating integers. More...
Go to the source code of this file.
Macros | |
| #define | NEED_FFS_MSB_UINT64_T 1 |
| #define | NEED_FFS_LSB_UINT64_T 1 |
Functions | |
| uint64_t | htonq (uint64_t x) |
| Return x translated from host to network byte order. | |
| uint64_t | ntohq (uint64_t x) |
| Return x translated from network to host byte order. | |
| unsigned char | host_to_net_order (unsigned char x) |
| Translate x to network byte order. | |
| signed char | host_to_net_order (signed char x) |
| char | host_to_net_order (char x) |
| short | host_to_net_order (short x) |
| unsigned short | host_to_net_order (unsigned short x) |
| int | host_to_net_order (int x) |
| unsigned | host_to_net_order (unsigned x) |
| int64_t | host_to_net_order (int64_t x) |
| uint64_t | host_to_net_order (uint64_t x) |
| unsigned char | net_to_host_order (unsigned char x) |
| Translate x to host byte order. | |
| signed char | net_to_host_order (signed char x) |
| char | net_to_host_order (char x) |
| short | net_to_host_order (short x) |
| unsigned short | net_to_host_order (unsigned short x) |
| int | net_to_host_order (int x) |
| unsigned | net_to_host_order (unsigned x) |
| int64_t | net_to_host_order (int64_t x) |
| uint64_t | net_to_host_order (uint64_t x) |
| int | ffs_msb (unsigned x) |
| Return the index of the most significant bit set in x. | |
| int | ffs_msb (unsigned long x) |
| int | ffs_msb (uint64_t x) |
| int | ffs_lsb (unsigned x) |
| Return the index of the least significant bit set in x. | |
| int | ffs_lsb (unsigned long x) |
| int | ffs_lsb (uint64_t x) |
| uint32_t | int_sqrt (uint32_t x) |
| Return the integer approximation of x's square root. | |
| uint64_t | int_sqrt (uint64_t x) |
| uint32_t | int_divide (uint32_t a, uint32_t b) |
| Return a / b. | |
| int32_t | int_divide (int32_t a, uint32_t b) |
| uint64_t | int_divide (uint64_t a, uint32_t b) |
| int64_t | int_divide (int64_t a, uint32_t b) |
| template<typename T > | |
| void | int_multiply (T a, T b, T &xlow, T &xhigh) |
| Multiply a * b, placing the low-order bits of the result in xlow and the high-order bits in xhigh. | |
| uint32_t | int_remainder (uint32_t a, uint32_t b, uint32_t ") |
| Divide a / b, placing quotient in quot and returning remainder. | |
| int32_t | int_remainder (int32_t a, uint32_t b, int32_t ") |
| uint32_t | int_remainder (uint64_t a, uint32_t b, uint64_t ") |
| uint32_t | int_remainder (int64_t a, uint32_t b, int64_t ") |
Functions for manipulating integers.
>
|
inline |
Return x translated from host to network byte order.
|
inline |
Return x translated from network to host byte order.
|
inline |
Translate x to network byte order.
Compare htons/htonl/htonq. host_to_net_order is particularly useful in template functions, where the type to be translated to network byte order is unknown.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Translate x to host byte order.
Compare ntohs/ntohl/ntohq. net_to_host_order is particularly useful in template functions, where the type to be translated to network byte order is unknown.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Return the index of the most significant bit set in x.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| int ffs_msb | ( | uint64_t | x | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Return the index of the least significant bit set in x.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| int ffs_lsb | ( | uint64_t | x | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| uint32_t int_sqrt | ( | uint32_t | x | ) |
Return the integer approximation of x's square root.
| uint64_t int_sqrt | ( | uint64_t | x | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Return a / b.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void int_multiply | ( | T | a, |
| T | b, | ||
| T & | xlow, | ||
| T & | xhigh | ||
| ) |
Multiply a * b, placing the low-order bits of the result in xlow and the high-order bits in xhigh.
|
inline |
Divide a / b, placing quotient in quot and returning remainder.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.