Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
This commit is contained in:
parent
77a0a5b519
commit
fa325e9b42
1021 changed files with 5688 additions and 6193 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Bloom filter tracking which scores are present in our arenas
|
||||
* and (more importantly) which are not.
|
||||
* and (more importantly) which are not.
|
||||
*/
|
||||
|
||||
#include "stdinc.h"
|
||||
|
|
@ -13,19 +13,19 @@ int
|
|||
bloominit(Bloom *b, vlong vsize, u8int *data)
|
||||
{
|
||||
ulong size;
|
||||
|
||||
|
||||
size = vsize;
|
||||
if(size != vsize){ /* truncation */
|
||||
werrstr("bloom data too big");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
b->size = size;
|
||||
b->nhash = 32; /* will be fixed by caller on initialization */
|
||||
if(data != nil)
|
||||
if(unpackbloomhead(b, data) < 0)
|
||||
return -1;
|
||||
|
||||
|
||||
b->bitmask = (b->size<<3) - 1;
|
||||
b->data = data;
|
||||
return 0;
|
||||
|
|
@ -42,7 +42,7 @@ readbloom(Part *p)
|
|||
{
|
||||
uchar buf[512];
|
||||
Bloom *b;
|
||||
|
||||
|
||||
b = vtmallocz(sizeof *b);
|
||||
if(readpart(p, 0, buf, sizeof buf) < 0)
|
||||
return nil;
|
||||
|
|
@ -75,7 +75,7 @@ int
|
|||
resetbloom(Bloom *b)
|
||||
{
|
||||
uchar *data;
|
||||
|
||||
|
||||
data = vtmallocz(b->size);
|
||||
b->data = data;
|
||||
if(b->size == MaxBloomSize) /* 2^32 overflows ulong */
|
||||
|
|
@ -92,7 +92,7 @@ loadbloom(Bloom *b)
|
|||
uint ones;
|
||||
uchar *data;
|
||||
u32int *a;
|
||||
|
||||
|
||||
data = vtmallocz(b->size);
|
||||
if(readpart(b->part, 0, data, b->size) < 0){
|
||||
vtfree(b);
|
||||
|
|
@ -105,14 +105,14 @@ loadbloom(Bloom *b)
|
|||
n = b->size/4;
|
||||
ones = 0;
|
||||
for(i=0; i<n; i++)
|
||||
ones += countbits(a[i]);
|
||||
ones += countbits(a[i]);
|
||||
addstat(StatBloomOnes, ones);
|
||||
|
||||
if(b->size == MaxBloomSize) /* 2^32 overflows ulong */
|
||||
addstat(StatBloomBits, b->size*8-1);
|
||||
else
|
||||
addstat(StatBloomBits, b->size*8);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ inbloomfilter(Bloom *b, u8int *score)
|
|||
|
||||
if(ignorebloom)
|
||||
return 1;
|
||||
|
||||
|
||||
rlock(&b->lk);
|
||||
r = _inbloomfilter(b, score);
|
||||
runlock(&b->lk);
|
||||
|
|
@ -236,7 +236,7 @@ markbloomfiltern(Bloom *b, u8int score[][20], int n)
|
|||
|
||||
if(b == nil || b->data == nil)
|
||||
return;
|
||||
|
||||
|
||||
rlock(&b->lk);
|
||||
qlock(&b->mod);
|
||||
for(i=0; i<n; i++)
|
||||
|
|
@ -251,7 +251,7 @@ bloomwriteproc(void *v)
|
|||
int ret;
|
||||
Bloom *b;
|
||||
|
||||
threadsetname("bloomwriteproc");
|
||||
threadsetname("bloomwriteproc");
|
||||
b = v;
|
||||
for(;;){
|
||||
recv(b->writechan, 0);
|
||||
|
|
@ -268,5 +268,5 @@ startbloomproc(Bloom *b)
|
|||
{
|
||||
b->writechan = chancreate(sizeof(void*), 0);
|
||||
b->writedonechan = chancreate(sizeof(ulong), 0);
|
||||
vtproc(bloomwriteproc, b);
|
||||
vtproc(bloomwriteproc, b);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue