gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29964 - in gnunet/src: include regex util


From: gnunet
Subject: [GNUnet-SVN] r29964 - in gnunet/src: include regex util
Date: Tue, 8 Oct 2013 11:30:28 +0200

Author: LRN
Date: 2013-10-08 11:30:27 +0200 (Tue, 08 Oct 2013)
New Revision: 29964

Modified:
   gnunet/src/include/gnunet_disk_lib.h
   gnunet/src/regex/regex_test_lib.c
   gnunet/src/util/container_bloomfilter.c
   gnunet/src/util/disk.c
Log:
Replace OFF_T with off_t

Modified: gnunet/src/include/gnunet_disk_lib.h
===================================================================
--- gnunet/src/include/gnunet_disk_lib.h        2013-10-08 09:30:24 UTC (rev 
29963)
+++ gnunet/src/include/gnunet_disk_lib.h        2013-10-08 09:30:27 UTC (rev 
29964)
@@ -25,12 +25,6 @@
 #ifndef GNUNET_DISK_LIB_H
 #define GNUNET_DISK_LIB_H
 
-#if WINDOWS
-#define OFF_T uint64_t
-#else
-#define OFF_T off_t
-#endif
-
 /**
  * Handle used to manage a pipe.
  */
@@ -307,8 +301,8 @@
  * @param whence specification to which position the offset parameter relates 
to
  * @return the new position on success, GNUNET_SYSERR otherwise
  */
-OFF_T
-GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, OFF_T offset,
+off_t
+GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset,
                        enum GNUNET_DISK_Seek whence);
 
 
@@ -408,7 +402,7 @@
  */
 int
 GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
-                             OFF_T *size);
+                             off_t *size);
 
 
 /**
@@ -767,8 +761,8 @@
  */
 int
 GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh,
-                       OFF_T lock_start,
-                       OFF_T lock_end, int excl);
+                       off_t lock_start,
+                       off_t lock_end, int excl);
 
 
 /**
@@ -781,8 +775,8 @@
  */
 int
 GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh,
-                         OFF_T unlock_start,
-                         OFF_T unlock_end);
+                         off_t unlock_start,
+                         off_t unlock_end);
 
 
 /**

Modified: gnunet/src/regex/regex_test_lib.c
===================================================================
--- gnunet/src/regex/regex_test_lib.c   2013-10-08 09:30:24 UTC (rev 29963)
+++ gnunet/src/regex/regex_test_lib.c   2013-10-08 09:30:27 UTC (rev 29964)
@@ -346,7 +346,7 @@
   struct GNUNET_DISK_FileHandle *f;
   unsigned int nr;
   unsigned int offset;
-  OFF_T size;
+  off_t size;
   size_t len;
   char *buffer;
   char *regex;

Modified: gnunet/src/util/container_bloomfilter.c
===================================================================
--- gnunet/src/util/container_bloomfilter.c     2013-10-08 09:30:24 UTC (rev 
29963)
+++ gnunet/src/util/container_bloomfilter.c     2013-10-08 09:30:27 UTC (rev 
29964)
@@ -181,7 +181,7 @@
 incrementBit (char *bitArray, unsigned int bitIdx,
               const struct GNUNET_DISK_FileHandle *fh)
 {
-  OFF_T fileSlot;
+  off_t fileSlot;
   unsigned char value;
   unsigned int high;
   unsigned int low;
@@ -229,7 +229,7 @@
 decrementBit (char *bitArray, unsigned int bitIdx,
               const struct GNUNET_DISK_FileHandle *fh)
 {
-  OFF_T fileslot;
+  off_t fileslot;
   unsigned char value;
   unsigned int high;
   unsigned int low;
@@ -462,10 +462,10 @@
 {
   struct GNUNET_CONTAINER_BloomFilter *bf;
   char *rbuff;
-  OFF_T pos;
+  off_t pos;
   int i;
   size_t ui;
-  OFF_T fsize;
+  off_t fsize;
   int must_read;
 
   GNUNET_assert (NULL != filename);

Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c      2013-10-08 09:30:24 UTC (rev 29963)
+++ gnunet/src/util/disk.c      2013-10-08 09:30:27 UTC (rev 29964)
@@ -208,7 +208,7 @@
  */
 int
 GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
-                             OFF_T *size)
+                             off_t *size)
 {
 #if WINDOWS
   BOOL b;
@@ -219,7 +219,7 @@
     SetErrnoFromWinError (GetLastError ());
     return GNUNET_SYSERR;
   }
-  *size = (OFF_T) li.QuadPart;
+  *size = (off_t) li.QuadPart;
 #else
   struct stat sbuf;
 
@@ -239,8 +239,8 @@
  * @param whence specification to which position the offset parameter relates 
to
  * @return the new position on success, GNUNET_SYSERR otherwise
  */
-OFF_T
-GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
+off_t
+GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, off_t offset,
                        enum GNUNET_DISK_Seek whence)
 {
   if (h == NULL)
@@ -263,7 +263,7 @@
     SetErrnoFromWinError (GetLastError ());
     return GNUNET_SYSERR;
   }
-  return (OFF_T) new_pos.QuadPart;
+  return (off_t) new_pos.QuadPart;
 #else
   static int t[] = { SEEK_SET, SEEK_CUR, SEEK_END };
 
@@ -1529,8 +1529,8 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, OFF_T lock_start,
-                       OFF_T lock_end, int excl)
+GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lock_start,
+                       off_t lock_end, int excl)
 {
   if (fh == NULL)
   {
@@ -1550,7 +1550,7 @@
   return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK;
 #else
   OVERLAPPED o;
-  OFF_T diff = lock_end - lock_start;
+  off_t diff = lock_end - lock_start;
   DWORD diff_low, diff_high;
   diff_low = (DWORD) (diff & 0xFFFFFFFF);
   diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF);
@@ -1580,8 +1580,8 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, OFF_T unlock_start,
-                         OFF_T unlock_end)
+GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlock_start,
+                         off_t unlock_end)
 {
   if (fh == NULL)
   {
@@ -1601,7 +1601,7 @@
   return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK;
 #else
   OVERLAPPED o;
-  OFF_T diff = unlock_end - unlock_start;
+  off_t diff = unlock_end - unlock_start;
   DWORD diff_low, diff_high;
   diff_low = (DWORD) (diff & 0xFFFFFFFF);
   diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]