THRIFT-916 long long becomes int64_t
Patch: Christian Lavoie
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1037500 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/contrib/fb303/TClientInfo.cpp b/contrib/fb303/TClientInfo.cpp
index d093017..e07eaa8 100644
--- a/contrib/fb303/TClientInfo.cpp
+++ b/contrib/fb303/TClientInfo.cpp
@@ -160,7 +160,7 @@
char buf[256];
snprintf(buf, sizeof buf, "%d %s %s %.3f %llu", i, addrStr, callStr, secs,
- (unsigned long long)info->getNCalls());
+ (uint64_t)info->getNCalls());
result.push_back(buf);
}
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h
index 6059d13..8e38d88 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/protocol/TProtocol.h
@@ -122,8 +122,8 @@
# define ntohll(n) bswap_64(n)
# define htonll(n) bswap_64(n)
# else /* GNUC & GLIBC */
-# define ntohll(n) ( (((unsigned long long)ntohl(n)) << 32) + ntohl(n >> 32) )
-# define htonll(n) ( (((unsigned long long)htonl(n)) << 32) + htonl(n >> 32) )
+# define ntohll(n) ( (((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32) )
+# define htonll(n) ( (((uint64_t)htonl(n)) << 32) + htonl(n >> 32) )
# endif /* GNUC & GLIBC */
#else /* __BYTE_ORDER */
# error "Can't define htonll or ntohll!"
diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp
index 8b09ed9..b42a093 100644
--- a/lib/cpp/src/transport/TFileTransport.cpp
+++ b/lib/cpp/src/transport/TFileTransport.cpp
@@ -743,7 +743,7 @@
// 3. size indicates that event crosses chunk boundary
T_ERROR("Read corrupt event. Event crosses chunk boundary. Event size:%u Offset:%lld",
readState_.event_->eventSize_,
- (long long int) (offset_ + readState_.bufferPtr_ + 4));
+ (int64_t) (offset_ + readState_.bufferPtr_ + 4));
return true;
}
@@ -784,7 +784,7 @@
currentEvent_ = NULL;
char errorMsg[1024];
sprintf(errorMsg, "TFileTransport: log file corrupted at offset: %lld",
- (long long int) (offset_ + readState_.lastDispatchPtr_));
+ (int64_t) (offset_ + readState_.lastDispatchPtr_));
GlobalOutput(errorMsg);
throw TTransportException(errorMsg);
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index 4fcf6b1..897153a 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -42,7 +42,7 @@
// Current time, microseconds since the epoch
uint64_t now()
{
- long long ret;
+ int64_t ret;
struct timeval tv;
gettimeofday(&tv, NULL);
diff --git a/test/cpp/src/main.cpp b/test/cpp/src/main.cpp
index 2aad4d6..c4124c3 100644
--- a/test/cpp/src/main.cpp
+++ b/test/cpp/src/main.cpp
@@ -210,8 +210,8 @@
size_t& _workerCount;
size_t _loopCount;
TType _loopType;
- long long _startTime;
- long long _endTime;
+ int64_t _startTime;
+ int64_t _endTime;
bool _done;
Monitor _sleep;
};
@@ -439,8 +439,8 @@
(*thread)->start();
}
- long long time00;
- long long time01;
+ int64_t time00;
+ int64_t time01;
{Synchronized s(monitor);
threadCount = clientCount;
@@ -458,18 +458,18 @@
time01 = Util::currentTime();
}
- long long firstTime = 9223372036854775807LL;
- long long lastTime = 0;
+ int64_t firstTime = 9223372036854775807LL;
+ int64_t lastTime = 0;
double averageTime = 0;
- long long minTime = 9223372036854775807LL;
- long long maxTime = 0;
+ int64_t minTime = 9223372036854775807LL;
+ int64_t maxTime = 0;
for (set<shared_ptr<Thread> >::iterator ix = clientThreads.begin(); ix != clientThreads.end(); ix++) {
shared_ptr<ClientThread> client = dynamic_pointer_cast<ClientThread>((*ix)->runnable());
- long long delta = client->_endTime - client->_startTime;
+ int64_t delta = client->_endTime - client->_startTime;
assert(delta > 0);
diff --git a/test/cpp/src/nb-main.cpp b/test/cpp/src/nb-main.cpp
index 8c74a81..6887e4e 100644
--- a/test/cpp/src/nb-main.cpp
+++ b/test/cpp/src/nb-main.cpp
@@ -216,8 +216,8 @@
size_t& _workerCount;
size_t _loopCount;
TType _loopType;
- long long _startTime;
- long long _endTime;
+ int64_t _startTime;
+ int64_t _endTime;
bool _done;
Monitor _sleep;
};
@@ -432,8 +432,8 @@
(*thread)->start();
}
- long long time00;
- long long time01;
+ int64_t time00;
+ int64_t time01;
{Synchronized s(monitor);
threadCount = clientCount;
@@ -451,18 +451,18 @@
time01 = Util::currentTime();
}
- long long firstTime = 9223372036854775807LL;
- long long lastTime = 0;
+ int64_t firstTime = 9223372036854775807LL;
+ int64_t lastTime = 0;
double averageTime = 0;
- long long minTime = 9223372036854775807LL;
- long long maxTime = 0;
+ int64_t minTime = 9223372036854775807LL;
+ int64_t maxTime = 0;
for (set<shared_ptr<Thread> >::iterator ix = clientThreads.begin(); ix != clientThreads.end(); ix++) {
shared_ptr<ClientThread> client = dynamic_pointer_cast<ClientThread>((*ix)->runnable());
- long long delta = client->_endTime - client->_startTime;
+ int64_t delta = client->_endTime - client->_startTime;
assert(delta > 0);