diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-08-24 09:26:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-08-24 09:26:47 +0000 |
commit | da7cc55488f90b3294dbb7aa186184e6e8501d7e (patch) | |
tree | 642f70be79ca8f2cbdbb3579d213086f3a25a4bf /src/util/container_bloomfilter.c | |
parent | 2518cfc0a86865ebe4d0550e0013ed52a494231b (diff) | |
download | gnunet-da7cc55488f90b3294dbb7aa186184e6e8501d7e.tar.gz gnunet-da7cc55488f90b3294dbb7aa186184e6e8501d7e.zip |
hxing
Diffstat (limited to 'src/util/container_bloomfilter.c')
-rw-r--r-- | src/util/container_bloomfilter.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c index cf99ac7b4..9efc2647c 100644 --- a/src/util/container_bloomfilter.c +++ b/src/util/container_bloomfilter.c | |||
@@ -157,7 +157,7 @@ incrementBit (char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_File | |||
157 | fileSlot = bitIdx / 2; | 157 | fileSlot = bitIdx / 2; |
158 | targetLoc = bitIdx % 2; | 158 | targetLoc = bitIdx % 2; |
159 | 159 | ||
160 | GNUNET_assert (fileSlot == (unsigned int) GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_SEEK_SET)); | 160 | GNUNET_assert (fileSlot == (unsigned int) GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET)); |
161 | if (1 != GNUNET_DISK_file_read (fh, &value, 1)) | 161 | if (1 != GNUNET_DISK_file_read (fh, &value, 1)) |
162 | value = 0; | 162 | value = 0; |
163 | low = value & 0xF; | 163 | low = value & 0xF; |
@@ -174,7 +174,7 @@ incrementBit (char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_File | |||
174 | high++; | 174 | high++; |
175 | } | 175 | } |
176 | value = ((high << 4) | low); | 176 | value = ((high << 4) | low); |
177 | GNUNET_assert (fileSlot == (unsigned int) GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_SEEK_SET)); | 177 | GNUNET_assert (fileSlot == (unsigned int) GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET)); |
178 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); | 178 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); |
179 | } | 179 | } |
180 | 180 | ||
@@ -200,7 +200,7 @@ decrementBit (char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_File | |||
200 | /* Each char slot in the counter file holds two 4 bit counters */ | 200 | /* Each char slot in the counter file holds two 4 bit counters */ |
201 | fileSlot = bitIdx / 2; | 201 | fileSlot = bitIdx / 2; |
202 | targetLoc = bitIdx % 2; | 202 | targetLoc = bitIdx % 2; |
203 | GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_SEEK_SET); | 203 | GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET); |
204 | if (1 != GNUNET_DISK_file_read (fh, &value, 1)) | 204 | if (1 != GNUNET_DISK_file_read (fh, &value, 1)) |
205 | value = 0; | 205 | value = 0; |
206 | low = value & 0xF; | 206 | low = value & 0xF; |
@@ -226,7 +226,7 @@ decrementBit (char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_File | |||
226 | } | 226 | } |
227 | } | 227 | } |
228 | value = ((high << 4) | low); | 228 | value = ((high << 4) | low); |
229 | GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_SEEK_SET); | 229 | GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET); |
230 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); | 230 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); |
231 | } | 231 | } |
232 | 232 | ||
@@ -250,7 +250,7 @@ makeEmptyFile (const struct GNUNET_DISK_FileHandle *fh, unsigned int size) | |||
250 | return GNUNET_SYSERR; | 250 | return GNUNET_SYSERR; |
251 | buffer = GNUNET_malloc (BUFFSIZE); | 251 | buffer = GNUNET_malloc (BUFFSIZE); |
252 | memset (buffer, 0, BUFFSIZE); | 252 | memset (buffer, 0, BUFFSIZE); |
253 | GNUNET_DISK_file_seek (fh, 0, GNUNET_SEEK_SET); | 253 | GNUNET_DISK_file_seek (fh, 0, GNUNET_DISK_SEEK_SET); |
254 | 254 | ||
255 | while (bytesleft > 0) | 255 | while (bytesleft > 0) |
256 | { | 256 | { |