Add flags to gcc invocations
All checks were successful
continuous-integration/drone Build is passing
All checks were successful
continuous-integration/drone Build is passing
This commit is contained in:
parent
7775028b58
commit
e2db3a7748
@ -17,11 +17,11 @@ steps:
|
||||
image: gcc:12.2.0
|
||||
commands:
|
||||
- cd algo2/pairingheap
|
||||
- gcc -o main pairingheap.c
|
||||
- gcc -Wall -Werror -o main pairingheap.c
|
||||
- ./main
|
||||
- name: radixheap
|
||||
image: gcc:12.2.0
|
||||
commands:
|
||||
- cd algo2/radixheap
|
||||
- gcc -o main radixheap.c
|
||||
- gcc -Wall -Werror -o main radixheap.c
|
||||
- ./main
|
||||
|
@ -51,12 +51,12 @@ struct RHeap {
|
||||
struct RHeapNode *buckets;
|
||||
};
|
||||
|
||||
static unsigned int log2(unsigned int x) {
|
||||
static unsigned int uintlog2(unsigned int x) {
|
||||
return 8 * sizeof(unsigned int) - __builtin_clz(x);
|
||||
}
|
||||
|
||||
void rh_init(struct RHeap *rh, unsigned int c) {
|
||||
unsigned int k = 1 + log2(c);
|
||||
unsigned int k = 1 + uintlog2(c);
|
||||
|
||||
rh->min = 0;
|
||||
rh->buckets_size = 1 + k; // extra space for bucket -1
|
||||
|
Loading…
x
Reference in New Issue
Block a user