GRU - Generic Reusable Utilities
Loading...
Searching...
No Matches
gru_units.h
Go to the documentation of this file.
1
16#ifndef GRU_UNITS_H
17#define GRU_UNITS_H
18
19#include <stdint.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
28static inline uint64_t gru_unit_kb(uint64_t num) {
29 return (num / 1024);
30}
31
32
36static inline uint64_t gru_unit_mb(uint64_t num) {
37 return gru_unit_kb(num) / 1024;
38}
39
40
44static inline uint64_t gru_unit_gb(uint64_t num) {
45 return gru_unit_mb(num) / 1024;
46}
47
48#ifdef __cplusplus
49}
50#endif
51
52
53#endif /* GRU_UNITS_H */