Add documentation for bstr

This commit is contained in:
Tim Schubert 2018-10-29 10:38:32 +01:00
parent 880a77ff65
commit 9a59cee745

View file

@ -155,6 +155,9 @@ void report_error(char *buf, unsigned long buflen, char *msg) {
sprintf(buf, "%s\n", msg); sprintf(buf, "%s\n", msg);
} }
/// Converts an integer into a string representation of its binary encoding
/// @param n an integer
/// @param out stores the resulting string
void bstr(unsigned int n, char **out) { void bstr(unsigned int n, char **out) {
// voodoo // voodoo
int msb = 32 - __builtin_clz(n); int msb = 32 - __builtin_clz(n);