Author: roger
Date: Sun Nov 21 16:59:05 2010
New Revision: 1037500
URL: http://svn.apache.org/viewvc?rev=1037500&view=rev
Log:
THRIFT-916 long long becomes int64_t
Patch: Christian Lavoie
Modified:
thrift/trunk/contrib/fb303/TClientInfo.cpp
thrift/trunk/lib/cpp/src/protocol/TProtocol.h
thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
thrift/trunk/test/cpp/src/TestClient.cpp
thrift/trunk/test/cpp/src/main.cpp
thrift/trunk/test/cpp/src/nb-main.cpp
Modified: thrift/trunk/contrib/fb303/TClientInfo.cpp
URL:
http://svn.apache.org/viewvc/thrift/trunk/contrib/fb303/TClientInfo.cpp?rev=1037500&r1=1037499&r2=1037500&view=diff
==============================================================================
--- thrift/trunk/contrib/fb303/TClientInfo.cpp (original)
+++ thrift/trunk/contrib/fb303/TClientInfo.cpp Sun Nov 21 16:59:05 2010
@@ -160,7 +160,7 @@ void TClientInfoServerHandler::getStatsS
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);
}
Modified: thrift/trunk/lib/cpp/src/protocol/TProtocol.h
URL:
http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/protocol/TProtocol.h?rev=1037500&r1=1037499&r2=1037500&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/protocol/TProtocol.h (original)
+++ thrift/trunk/lib/cpp/src/protocol/TProtocol.h Sun Nov 21 16:59:05 2010
@@ -122,8 +122,8 @@ using apache::thrift::transport::TTransp
# 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!"
Modified: thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
URL:
http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp?rev=1037500&r1=1037499&r2=1037500&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp Sun Nov 21 16:59:05
2010
@@ -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);
Modified: thrift/trunk/test/cpp/src/TestClient.cpp
URL:
http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/TestClient.cpp?rev=1037500&r1=1037499&r2=1037500&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/TestClient.cpp (original)
+++ thrift/trunk/test/cpp/src/TestClient.cpp Sun Nov 21 16:59:05 2010
@@ -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);
Modified: thrift/trunk/test/cpp/src/main.cpp
URL:
http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/main.cpp?rev=1037500&r1=1037499&r2=1037500&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/main.cpp (original)
+++ thrift/trunk/test/cpp/src/main.cpp Sun Nov 21 16:59:05 2010
@@ -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);
Modified: thrift/trunk/test/cpp/src/nb-main.cpp
URL:
http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/nb-main.cpp?rev=1037500&r1=1037499&r2=1037500&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/nb-main.cpp (original)
+++ thrift/trunk/test/cpp/src/nb-main.cpp Sun Nov 21 16:59:05 2010
@@ -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);