Imported Upstream version 2.9.0
[debian/cc1111] / src / izt / util.c
1 /** @file izt/util.c
2  */
3 #include "izt.h"
4
5 int izt_util_binLog(int i)
6 {
7     static const int lookup[] = {
8         0, 0, 1, -1, 2, -1, -1, -1, 3
9     };
10
11     if (i < NUM_OF(lookup)) {
12         if (lookup[i] != -1) {
13             return lookup[i];
14         }
15         else {
16             // Unsupported.
17             wassert(0);
18         }
19     }
20     else {
21         // Unsupported.
22         wassert(0);
23     }
24     return 0;
25 }