aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/container_bloomfilter.c8
-rw-r--r--src/util/disk.c22
2 files changed, 15 insertions, 15 deletions
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index 08a083df4..579c1261d 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -181,7 +181,7 @@ static void
181incrementBit (char *bitArray, unsigned int bitIdx, 181incrementBit (char *bitArray, unsigned int bitIdx,
182 const struct GNUNET_DISK_FileHandle *fh) 182 const struct GNUNET_DISK_FileHandle *fh)
183{ 183{
184 OFF_T fileSlot; 184 off_t fileSlot;
185 unsigned char value; 185 unsigned char value;
186 unsigned int high; 186 unsigned int high;
187 unsigned int low; 187 unsigned int low;
@@ -229,7 +229,7 @@ static void
229decrementBit (char *bitArray, unsigned int bitIdx, 229decrementBit (char *bitArray, unsigned int bitIdx,
230 const struct GNUNET_DISK_FileHandle *fh) 230 const struct GNUNET_DISK_FileHandle *fh)
231{ 231{
232 OFF_T fileslot; 232 off_t fileslot;
233 unsigned char value; 233 unsigned char value;
234 unsigned int high; 234 unsigned int high;
235 unsigned int low; 235 unsigned int low;
@@ -462,10 +462,10 @@ GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size,
462{ 462{
463 struct GNUNET_CONTAINER_BloomFilter *bf; 463 struct GNUNET_CONTAINER_BloomFilter *bf;
464 char *rbuff; 464 char *rbuff;
465 OFF_T pos; 465 off_t pos;
466 int i; 466 int i;
467 size_t ui; 467 size_t ui;
468 OFF_T fsize; 468 off_t fsize;
469 int must_read; 469 int must_read;
470 470
471 GNUNET_assert (NULL != filename); 471 GNUNET_assert (NULL != filename);
diff --git a/src/util/disk.c b/src/util/disk.c
index 652a45ed0..8dc1e35bf 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -208,7 +208,7 @@ GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h)
208 */ 208 */
209int 209int
210GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, 210GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
211 OFF_T *size) 211 off_t *size)
212{ 212{
213#if WINDOWS 213#if WINDOWS
214 BOOL b; 214 BOOL b;
@@ -219,7 +219,7 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
219 SetErrnoFromWinError (GetLastError ()); 219 SetErrnoFromWinError (GetLastError ());
220 return GNUNET_SYSERR; 220 return GNUNET_SYSERR;
221 } 221 }
222 *size = (OFF_T) li.QuadPart; 222 *size = (off_t) li.QuadPart;
223#else 223#else
224 struct stat sbuf; 224 struct stat sbuf;
225 225
@@ -239,8 +239,8 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
239 * @param whence specification to which position the offset parameter relates to 239 * @param whence specification to which position the offset parameter relates to
240 * @return the new position on success, GNUNET_SYSERR otherwise 240 * @return the new position on success, GNUNET_SYSERR otherwise
241 */ 241 */
242OFF_T 242off_t
243GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset, 243GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, off_t offset,
244 enum GNUNET_DISK_Seek whence) 244 enum GNUNET_DISK_Seek whence)
245{ 245{
246 if (h == NULL) 246 if (h == NULL)
@@ -263,7 +263,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
263 SetErrnoFromWinError (GetLastError ()); 263 SetErrnoFromWinError (GetLastError ());
264 return GNUNET_SYSERR; 264 return GNUNET_SYSERR;
265 } 265 }
266 return (OFF_T) new_pos.QuadPart; 266 return (off_t) new_pos.QuadPart;
267#else 267#else
268 static int t[] = { SEEK_SET, SEEK_CUR, SEEK_END }; 268 static int t[] = { SEEK_SET, SEEK_CUR, SEEK_END };
269 269
@@ -1529,8 +1529,8 @@ GNUNET_DISK_file_change_owner (const char *filename, const char *user)
1529 * @return GNUNET_OK on success, GNUNET_SYSERR on error 1529 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1530 */ 1530 */
1531int 1531int
1532GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, OFF_T lock_start, 1532GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lock_start,
1533 OFF_T lock_end, int excl) 1533 off_t lock_end, int excl)
1534{ 1534{
1535 if (fh == NULL) 1535 if (fh == NULL)
1536 { 1536 {
@@ -1550,7 +1550,7 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, OFF_T lock_start,
1550 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK; 1550 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK;
1551#else 1551#else
1552 OVERLAPPED o; 1552 OVERLAPPED o;
1553 OFF_T diff = lock_end - lock_start; 1553 off_t diff = lock_end - lock_start;
1554 DWORD diff_low, diff_high; 1554 DWORD diff_low, diff_high;
1555 diff_low = (DWORD) (diff & 0xFFFFFFFF); 1555 diff_low = (DWORD) (diff & 0xFFFFFFFF);
1556 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF); 1556 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF);
@@ -1580,8 +1580,8 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, OFF_T lock_start,
1580 * @return GNUNET_OK on success, GNUNET_SYSERR on error 1580 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1581 */ 1581 */
1582int 1582int
1583GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, OFF_T unlock_start, 1583GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlock_start,
1584 OFF_T unlock_end) 1584 off_t unlock_end)
1585{ 1585{
1586 if (fh == NULL) 1586 if (fh == NULL)
1587 { 1587 {
@@ -1601,7 +1601,7 @@ GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, OFF_T unlock_start,
1601 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK; 1601 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK;
1602#else 1602#else
1603 OVERLAPPED o; 1603 OVERLAPPED o;
1604 OFF_T diff = unlock_end - unlock_start; 1604 off_t diff = unlock_end - unlock_start;
1605 DWORD diff_low, diff_high; 1605 DWORD diff_low, diff_high;
1606 diff_low = (DWORD) (diff & 0xFFFFFFFF); 1606 diff_low = (DWORD) (diff & 0xFFFFFFFF);
1607 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF); 1607 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF);