@@ -9,9 +9,16 @@ size_t hashString(const char* key) {
}
size_t roundUp2(size_t n) {
- size_t w = 1;
- while(w < n) {
- w *= 2;
+ n -= n != 0;
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ if(sizeof(n) >= 4) {
+ n |= n >> 16;
- return w;
+ if(sizeof(n) >= 8) {
+ n |= n >> 32;
+ }
+ return n + 1;
@@ -2,8 +2,6 @@
#include "core/Generic.h"
-#define CV3(a, b, c) (&(Vector3){{a, b, c}})
-
void initView(View* v) {
*v = (View){0};
@@ -1,6 +1,5 @@
#include "../Tests.h"
#include "core/BitArray.h"
-#include "core/ToString.h"
static void testSetRead() {
BitArray bits;
#include "core/Box.h"
static void testInit() {
Box box = BOX;
@@ -1,7 +1,6 @@
#include "core/HashMap.h"
#include "core/ToString.h"
-#include "core/Utility.h"
HASHMAP(size_t, size_t, Size)
#include "core/Plane.h"
static const float eps = 0.0001f;
#include "core/Queue.h"
QUEUE(size_t, Size)
QUEUE_SOURCE(size_t, Size)
@@ -1,5 +1,4 @@
#include "core/View.h"
static void testFromAngles() {