minor bug fixes (mechiel lukkien, andrey)
This commit is contained in:
parent
a5f3a00bcd
commit
4f959600b6
4 changed files with 3 additions and 5 deletions
|
|
@ -101,8 +101,6 @@ gethashes(u8int *score, ulong *h)
|
|||
a ^= *(u32int*)(score+i);
|
||||
b ^= *(u32int*)(score+i+4);
|
||||
}
|
||||
if(i+4 <= VtScoreSize) /* 20 is not 4-aligned */
|
||||
a ^= *(u32int*)(score+i);
|
||||
for(i=0; i<BloomMaxHash; i++, a+=b)
|
||||
h[i] = a < BloomHeadSize*8 ? BloomHeadSize*8 : a;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ threadmain(int argc, char *argv[])
|
|||
b.nhash = nhash;
|
||||
bits = nhash*10/7;
|
||||
nblocks = (8*size)/bits;
|
||||
fprint(2, "fmtbloom: using %lldMB, %d hashes/score, best up to %,lld blocks\n", size, nhash, nblocks);
|
||||
fprint(2, "fmtbloom: using %lldMB, %d hashes/score, best up to %,lld blocks\n", size/1024/1024, nhash, nblocks);
|
||||
b.data = vtmallocz(size);
|
||||
b.part = part;
|
||||
if(writebloom(&b) < 0)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ statgraph(Graph *g)
|
|||
if(g->wid > nelem(bin))
|
||||
g->wid = nelem(bin);
|
||||
if(g->fill < 0)
|
||||
g->fill = ((uint)g->arg>>8)%nelem(lofill);
|
||||
g->fill = ((uint)(uintptr)g->arg>>8)%nelem(lofill);
|
||||
if(g->fill > nelem(lofill))
|
||||
g->fill %= nelem(lofill);
|
||||
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ print("FAILED isread=%d r=%d count=%d blocksize=%d\n", isread, r, count, blocksi
|
|||
memmove(buf, tmp, count);
|
||||
else{
|
||||
memmove(tmp, buf, count);
|
||||
if(pwrite(fd, tmp, opsize, offset) != blocksize){
|
||||
if(pwrite(fd, tmp, blocksize, offset) != blocksize){
|
||||
dst = tmp;
|
||||
op = "write";
|
||||
goto Error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue