Commit b5864078 authored by Eric Coissac's avatar Eric Coissac

--no commit message

--no commit message
parent d1385537
......@@ -333,17 +333,15 @@ int32_t nextForward(buffer_t *buffer, int32_t current, size_t length, int32_t* e
return 0;
}
static char* itoa(int val, int base){
static char* bin8(int val){
char buf[32] = {0};
static char buf[32] = {0};
int i = 30;
int j = 0;
for(; val && i ; j++,--i, val /= base)
buf[i] = "0123456789abcdef"[val % base];
for (;j<8;j++,i--) buf[i]='0';
for(; j < 8 ; j++,--i, val /= 2)
buf[i] = "0123456789abcdef"[val % 2];
return &buf[i+1];
......@@ -397,14 +395,14 @@ int32_t lookForReverse(buffer_t *buffer, pnuc key, size_t length, int32_t* endof
printf("Rshift = %d\n",rshift);
int ib;
for (ib=0;ib<lkey;ib++)
printf ("%8s ",itoa (dest2[ib],2));
printf ("%8s ",bin8(dest2[ib],2));
printf("\n");
dest = shiftKey(dest, dest2, rshift, lkey);
dest[lkey]&=bmask[rshift];
for (ib=0;ib<=lkey;ib++)
printf ("%8s ",itoa (dest[ib],2));
printf ("%8s ",bin8(dest[ib],2));
printf("\n");
// Set the last bits of the query to 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment