From a57a2eed5b7ea2fbf76d677e309a75ae6a633685 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sat, 12 Dec 2015 19:24:23 -0800 Subject: [PATCH] unify types --- src/turbo_linecount.cpp | 4 ---- src/turbo_linecount.h | 12 +++++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/turbo_linecount.cpp b/src/turbo_linecount.cpp index 182e39e..404c016 100644 --- a/src/turbo_linecount.cpp +++ b/src/turbo_linecount.cpp @@ -23,7 +23,6 @@ #define LCINVALIDHANDLE INVALID_HANDLE_VALUE #define LCSETREALLASTERROR(err, errstr) { setLastError((err), (errstr)); } #define MAP_FAILED NULL -typedef long long tlc_fileoffset_t; #elif defined(TLC_COMPATIBLE_UNIX) @@ -34,17 +33,14 @@ typedef long long tlc_fileoffset_t; #include #if (defined (__APPLE__) && defined (__MACH__)) #include -typedef off_t tlc_fileoffset_t; #define MMAP ::mmap #define FSTAT ::fstat #define STAT ::stat #elif (defined(__linux__) || defined(__cygwin__)) && defined(_LARGEFILE64_SOURCE) -typedef off64_t tlc_fileoffset_t; #define MMAP ::mmap64 #define FSTAT ::fstat64 #define STAT ::stat64 #else -typedef off_t tlc_fileoffset_t; #define MMAP ::mmap #define FSTAT ::fstat #define STAT ::stat diff --git a/src/turbo_linecount.h b/src/turbo_linecount.h index 1c01f65..add21d5 100644 --- a/src/turbo_linecount.h +++ b/src/turbo_linecount.h @@ -70,7 +70,7 @@ BEGIN_TURBOLINECOUNT_NAMESPACE; #endif typedef HANDLE tlc_filehandle_t; - typedef long long tlc_fileoffset_t; + typedef long long int tlc_fileoffset_t; typedef tlc_fileoffset_t tlc_linecount_t; #define TLC_LINECOUNT_FMT "%I64d" @@ -78,6 +78,7 @@ BEGIN_TURBOLINECOUNT_NAMESPACE; typedef std::string tlc_string_t; typedef int tlc_filehandle_t; + #if (defined (__APPLE__) && defined (__MACH__)) typedef off_t tlc_fileoffset_t; #define TLC_LINECOUNT_FMT "%lld" @@ -92,6 +93,7 @@ BEGIN_TURBOLINECOUNT_NAMESPACE; typedef off_t tlc_fileoffset_t; #define TLC_LINECOUNT_FMT "%d" #endif + typedef tlc_fileoffset_t tlc_linecount_t; #endif @@ -174,11 +176,11 @@ extern "C" #endif #ifdef _WIN32 - long long turbo_linecount_handle(HANDLE fhandle, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL); - long long turbo_linecount_file(const TCHAR *filename, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL); + long long int turbo_linecount_handle(HANDLE fhandle, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL); + long long int turbo_linecount_file(const TCHAR *filename, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL); #elif defined(TLC_COMPATIBLE_UNIX) - long long turbo_linecount_handle(int fhandle, tlc_error_t * tlc_error = NULL, char ** errorstring = NULL); - long long turbo_linecount_file(const char *filename, tlc_error_t * error = NULL, char ** errorstring = NULL); + long long int turbo_linecount_handle(int fhandle, tlc_error_t * tlc_error = NULL, char ** errorstring = NULL); + long long int turbo_linecount_file(const char *filename, tlc_error_t * error = NULL, char ** errorstring = NULL); #endif