in reply to Re^2: [OT] The interesting problem of ... bit-strings (alpha skip search)
in thread [OT] The interesting problem of comparing bit-strings.
Despite saying I wouldn't look at this further; since you updated, I did. But I didn't get very far.
Once I commented out a couple (non-existent on my system) unix-y headers -- no idea if they are necessary or not:
#include <stdio.h> //#include <stdint.h> #include <stdlib.h> #include <string.h> //#include <unistd.h>
I got this:
c:\test\c\oiskuu-search.h(9) : warning C4293: '<<' : shift count negat +ive or too big, undefined behavior
Which I fixed by changing 1L to 1ull:
enum { logM = 32, Mmax = 1ull << logM, Mdflt = 65536, Mnil = Mmax - 1 +};
Which got me to:
c:\test\c\oiskuu-search.h(10) : warning C4341: 'Mmax' : signed value i +s out of range for enum constant c:\test\c\oiskuu-search.h(10) : warning C4309: 'initializing' : trunca +tion of constant value c:\test\c\oiskuu-search.h(14) : error C2143: syntax error : missing ') +' before '(' c:\test\c\oiskuu-search.h(14) : error C2091: function returns function c:\test\c\oiskuu-search.h(14) : error C2059: syntax error : ')' c:\test\c\oiskuu-search.h(14) : error C2085: 'bt_off_t' : not in forma +l parameter list
From these 3 lines:
// F = logM is theoretically optimal. Mmax is our maximum needle size. // if logM/Mmax is changed, be sure to also check the bt_off_t below enum { logM = 32, Mmax = 1ull << logM, Mdflt = 65536, Mnil = Mmax - 1 +}; enum { F = 16, Ftop = 1 << F, Fmask = Ftop - 1 }; //typedef uint32_t bt_off_t; // must hold 0..Mnil enum { BT_OFF_MAX = Mnil } __attribute__((packed)) typedef bt_off_t;
I hope you'll understand that I'm not being unfair when I say I have simply no clue how to fix that...but I did try.
(Quite why you need to invent your own special integer types all over the place is beyond my understanding.)
|
---|