diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -2,6 +2,7 @@ #include <stdlib.h> #include <stdio.h> #include <ctype.h> +#include <stdint.h> #include <sys/types.h> #include <sys/stat.h> @@ -68,6 +69,16 @@ char * split_keyval(char * text) return text+1; } +uint32_t nearest_pow2(uint32_t val) +{ + uint32_t ret = 1; + while (ret < val) + { + ret = ret << 1; + } + return ret; +} + static char * exe_str; void set_exe_str(char * str) |