diff options
author | Roger Meier <roger@apache.org> | 2010-11-21 16:59:05 +0000 |
---|---|---|
committer | Roger Meier <roger@apache.org> | 2010-11-21 16:59:05 +0000 |
commit | 5f9614cf9a8003a772e48d9d2ae5b2877d08a721 (patch) | |
tree | e47460069ba027363c7db20592070be609f8b28e | |
parent | d3bfe700308fa00eeed4bfa9cd76283c194c2d4a (diff) | |
download | thrift-5f9614cf9a8003a772e48d9d2ae5b2877d08a721.tar.gz |
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
-rw-r--r-- | contrib/fb303/TClientInfo.cpp | 2 | ||||
-rw-r--r-- | lib/cpp/src/protocol/TProtocol.h | 4 | ||||
-rw-r--r-- | lib/cpp/src/transport/TFileTransport.cpp | 4 | ||||
-rw-r--r-- | test/cpp/src/TestClient.cpp | 2 | ||||
-rw-r--r-- | test/cpp/src/main.cpp | 18 | ||||
-rw-r--r-- | test/cpp/src/nb-main.cpp | 18 |
6 files changed, 24 insertions, 24 deletions
diff --git a/contrib/fb303/TClientInfo.cpp b/contrib/fb303/TClientInfo.cpp index d09301791..e07eaa8cb 100644 --- a/contrib/fb303/TClientInfo.cpp +++ b/contrib/fb303/TClientInfo.cpp @@ -160,7 +160,7 @@ void TClientInfoServerHandler::getStatsStrings(vector<string>& result) { 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 6059d1397..8e38d88bf 100644 --- a/lib/cpp/src/protocol/TProtocol.h +++ b/lib/cpp/src/protocol/TProtocol.h @@ -122,8 +122,8 @@ using apache::thrift::transport::TTransport; # 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 8b09ed99f..b42a09318 100644 --- a/lib/cpp/src/transport/TFileTransport.cpp +++ b/lib/cpp/src/transport/TFileTransport.cpp @@ -743,7 +743,7 @@ bool TFileTransport::isEventCorrupted() { // 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 @@ void TFileTransport::performRecovery() { 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 4fcf6b186..897153ab4 100644 --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -42,7 +42,7 @@ using namespace thrift::test; // 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 2aad4d60f..c4124c30a 100644 --- a/test/cpp/src/main.cpp +++ b/test/cpp/src/main.cpp @@ -210,8 +210,8 @@ public: 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 @@ int main(int argc, char **argv) { (*thread)->start(); } - long long time00; - long long time01; + int64_t time00; + int64_t time01; {Synchronized s(monitor); threadCount = clientCount; @@ -458,18 +458,18 @@ int main(int argc, char **argv) { 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 8c74a815d..6887e4e1d 100644 --- a/test/cpp/src/nb-main.cpp +++ b/test/cpp/src/nb-main.cpp @@ -216,8 +216,8 @@ public: 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 @@ int main(int argc, char **argv) { (*thread)->start(); } - long long time00; - long long time01; + int64_t time00; + int64_t time01; {Synchronized s(monitor); threadCount = clientCount; @@ -451,18 +451,18 @@ int main(int argc, char **argv) { 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); |