Some filetransport indentation and style fixes
Reviewed By: null, no code change, style only
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665114 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp
index 84ea60d..f368599 100644
--- a/lib/cpp/src/transport/TFileTransport.cpp
+++ b/lib/cpp/src/transport/TFileTransport.cpp
@@ -99,7 +99,7 @@
// flush any events in the queue
flush();
fprintf(stderr, "error, current file (%s) not closed\n", filename_.c_str());
- if(-1 == ::close(fd_)) {
+ if (-1 == ::close(fd_)) {
perror("TFileTransport: error in file close");
throw TTransportException("TFileTransport: error in file close");
}
@@ -305,7 +305,7 @@
if(closing_) {
// empty out both the buffers
if (enqueueBuffer_->isEmpty() && dequeueBuffer_->isEmpty()) {
- if(-1 == ::close(fd_)) {
+ if (-1 == ::close(fd_)) {
perror("TFileTransport: error in close");
throw TTransportException("TFileTransport: error in file close");
}
@@ -353,17 +353,17 @@
// sanity check
if (padding <= 0) {
T_DEBUG("Padding is empty, skipping event");
- continue;
+ continue;
}
if (padding > (int32_t)chunkSize_) {
T_DEBUG("padding is larger than chunk size, skipping event");
- continue;
+ continue;
}
uint8_t zeros[padding];
bzero(zeros, padding);
- // T_DEBUG_L(1, "Adding padding of %u bytes at %lu (to reach chunk %lld)",
- // padding, offset_, chunk2);
- if(-1 == ::write(fd_, zeros, padding)) {
+ //T_DEBUG_L(1, "Adding padding of %u bytes at %lu (to reach chunk %lld)",
+ //padding, offset_, chunk2);
+ if (-1 == ::write(fd_, zeros, padding)) {
perror("TFileTransport: error while padding zeros");
throw TTransportException("TFileTransport: error while padding zeros");
}
@@ -373,8 +373,8 @@
}
// write the dequeued event to the file
- if(outEvent->eventSize_ > 0) {
- if(-1 == ::write(fd_, outEvent->eventBuff_, outEvent->eventSize_)) {
+ if (outEvent->eventSize_ > 0) {
+ if (-1 == ::write(fd_, outEvent->eventBuff_, outEvent->eventSize_)) {
perror("TFileTransport: error while writing event");
throw TTransportException("TFileTransport: error while writing event");
}
@@ -890,7 +890,7 @@
if (!tail) {
break;
}
- } catch (TException te) {
+ } catch (TException &te) {
cerr << te.what() << endl;
break;
}
@@ -919,7 +919,7 @@
}
} catch (TEOFException& teof) {
break;
- } catch (TException te) {
+ } catch (TException &te) {
cerr << te.what() << endl;
break;
}