added find, more tests
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include <stddef.h>
|
||||
|
||||
void keke_swap(void *a, void *b, size_t size) {
|
||||
char *aa = a;
|
||||
char *bb = b;
|
||||
for(size_t i = 0; i < size; i++) {
|
||||
aa[i] ^= bb[i];
|
||||
bb[i] ^= aa[i];
|
||||
aa[i] ^= bb[i];
|
||||
}
|
||||
}
|
||||
|
||||
size_t next_power_of_two(size_t s) {
|
||||
size_t t = 1;
|
||||
while(t < s) t <<= 1;
|
||||
return t;
|
||||
}
|
||||
Reference in New Issue
Block a user