Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A62A1832A for ; Tue, 4 Aug 2015 18:09:46 +0000 (UTC) Received: (qmail 85728 invoked by uid 500); 4 Aug 2015 18:09:46 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 85600 invoked by uid 500); 4 Aug 2015 18:09:46 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 85573 invoked by uid 99); 4 Aug 2015 18:09:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2015 18:09:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 448F3E35C5; Tue, 4 Aug 2015 18:09:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Date: Tue, 04 Aug 2015 18:09:47 -0000 Message-Id: <493dd4c626ad41bf90ecb93bc9a5ca7b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/3] activemq-cpp git commit: Fix some warnings. Fix some warnings. Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/0304e079 Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/0304e079 Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/0304e079 Branch: refs/heads/master Commit: 0304e079de5180804e7dfee470cfd39eb42b1f2e Parents: 60ecacb Author: Timothy Bish Authored: Tue Aug 4 11:10:15 2015 -0400 Committer: Timothy Bish Committed: Tue Aug 4 11:10:15 2015 -0400 ---------------------------------------------------------------------- .../benchmark/PerformanceTimer.h | 2 +- .../decaf/io/BufferedInputStreamBenchmark.cpp | 28 ++++++------ .../decaf/io/ByteArrayInputStreamBenchmark.cpp | 29 ++++++------ .../decaf/io/DataInputStreamBenchmark.cpp | 38 ++++++++-------- .../decaf/io/DataOutputStreamBenchmark.cpp | 48 ++++++++++---------- 5 files changed, 71 insertions(+), 74 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/0304e079/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.h ---------------------------------------------------------------------- diff --git a/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.h b/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.h index 55fa94e..edeafd2 100644 --- a/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.h +++ b/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.h @@ -63,7 +63,7 @@ namespace benchmark{ * Gets the number of runs made so far * @returns unsigned int that counts the number of runs */ - unsigned long long getNumberOfRuns() const { + long long getNumberOfRuns() const { return numberOfRuns; } http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/0304e079/activemq-cpp/src/test-benchmarks/decaf/io/BufferedInputStreamBenchmark.cpp ---------------------------------------------------------------------- diff --git a/activemq-cpp/src/test-benchmarks/decaf/io/BufferedInputStreamBenchmark.cpp b/activemq-cpp/src/test-benchmarks/decaf/io/BufferedInputStreamBenchmark.cpp index 5918e31..86057d1 100644 --- a/activemq-cpp/src/test-benchmarks/decaf/io/BufferedInputStreamBenchmark.cpp +++ b/activemq-cpp/src/test-benchmarks/decaf/io/BufferedInputStreamBenchmark.cpp @@ -33,40 +33,38 @@ BufferedInputStreamBenchmark::~BufferedInputStreamBenchmark() { //////////////////////////////////////////////////////////////////////////////// void BufferedInputStreamBenchmark::setUp() { - buffer = new unsigned char[bufferSize]; - source.setByteArray( buffer, bufferSize ); + source.setByteArray(buffer, bufferSize); } //////////////////////////////////////////////////////////////////////////////// -void BufferedInputStreamBenchmark::tearDown(){ +void BufferedInputStreamBenchmark::tearDown() { - delete [] buffer; + delete[] buffer; } //////////////////////////////////////////////////////////////////////////////// -void BufferedInputStreamBenchmark::run(){ +void BufferedInputStreamBenchmark::run() { int numRuns = 25; - std::vector bucket( bufferSize ); - BufferedInputStream bis( &source ); + std::vector bucket(bufferSize); + BufferedInputStream bis(&source); - for( int iy = 0; iy < numRuns; ++iy ){ - BufferedInputStream local( &source ); + for (std::size_t iy = 0; iy < numRuns; ++iy) { + BufferedInputStream local(&source); } - for( int iy = 0; iy < numRuns; ++iy ){ + for (std::size_t iy = 0; iy < numRuns; ++iy) { - for( int iz = 0; iz < bufferSize; ++iz ) { - bucket[iy] = (unsigned char)bis.read(); + for (int iz = 0; iz < bufferSize; ++iz) { + bucket[iy] = (unsigned char) bis.read(); } source.reset(); } - for( int iy = 0; iy < numRuns; ++iy ){ - bis.read( &bucket[0], bufferSize, 0, bufferSize ); + for (std::size_t iy = 0; iy < numRuns; ++iy) { + bis.read(&bucket[0], bufferSize, 0, bufferSize); source.reset(); } - } http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/0304e079/activemq-cpp/src/test-benchmarks/decaf/io/ByteArrayInputStreamBenchmark.cpp ---------------------------------------------------------------------- diff --git a/activemq-cpp/src/test-benchmarks/decaf/io/ByteArrayInputStreamBenchmark.cpp b/activemq-cpp/src/test-benchmarks/decaf/io/ByteArrayInputStreamBenchmark.cpp index c6f2d9e..c0d824c 100755 --- a/activemq-cpp/src/test-benchmarks/decaf/io/ByteArrayInputStreamBenchmark.cpp +++ b/activemq-cpp/src/test-benchmarks/decaf/io/ByteArrayInputStreamBenchmark.cpp @@ -37,12 +37,12 @@ void ByteArrayInputStreamBenchmark::setUp() { buffer = new unsigned char[bufferSize]; // init to full String Buffer - stlBuffer.reserve( bufferSize ); - for( int ix = 0; ix < bufferSize - 1; ++ix ) { + stlBuffer.reserve(bufferSize); + for (int ix = 0; ix < bufferSize - 1; ++ix) { buffer[ix] = 65; - stlBuffer.push_back( 65 ); + stlBuffer.push_back(65); } - buffer[bufferSize-1] = 0; + buffer[bufferSize - 1] = 0; } //////////////////////////////////////////////////////////////////////////////// @@ -52,28 +52,27 @@ void ByteArrayInputStreamBenchmark::tearDown(){ } //////////////////////////////////////////////////////////////////////////////// -void ByteArrayInputStreamBenchmark::run(){ +void ByteArrayInputStreamBenchmark::run() { int numRuns = 25; - std::vector bucket( bufferSize ); - ByteArrayInputStream bis( buffer, bufferSize ); + std::vector bucket(bufferSize); + ByteArrayInputStream bis(buffer, bufferSize); - for( int iy = 0; iy < numRuns; ++iy ){ - ByteArrayInputStream local( buffer, bufferSize ); + for (int iy = 0; iy < numRuns; ++iy) { + ByteArrayInputStream local(buffer, bufferSize); } - for( int iy = 0; iy < numRuns; ++iy ){ + for (std::size_t iy = 0; iy < numRuns; ++iy) { - for( int iz = 0; iz < bufferSize; ++iz ) { - bucket[iy] = (unsigned char)bis.read(); + for (std::size_t iz = 0; iz < bufferSize; ++iz) { + bucket[iy] = (unsigned char) bis.read(); } bis.reset(); } - for( int iy = 0; iy < numRuns; ++iy ){ - bis.read( &bucket[0], bufferSize, 0, bufferSize ); + for (std::size_t iy = 0; iy < numRuns; ++iy) { + bis.read(&bucket[0], bufferSize, 0, bufferSize); bis.reset(); } - } http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/0304e079/activemq-cpp/src/test-benchmarks/decaf/io/DataInputStreamBenchmark.cpp ---------------------------------------------------------------------- diff --git a/activemq-cpp/src/test-benchmarks/decaf/io/DataInputStreamBenchmark.cpp b/activemq-cpp/src/test-benchmarks/decaf/io/DataInputStreamBenchmark.cpp index f9cf9be..4f8b9b7 100644 --- a/activemq-cpp/src/test-benchmarks/decaf/io/DataInputStreamBenchmark.cpp +++ b/activemq-cpp/src/test-benchmarks/decaf/io/DataInputStreamBenchmark.cpp @@ -29,28 +29,28 @@ DataInputStreamBenchmark::DataInputStreamBenchmark() : buffer(), bis() { } //////////////////////////////////////////////////////////////////////////////// -void DataInputStreamBenchmark::setUp(){ +void DataInputStreamBenchmark::setUp() { buffer = new unsigned char[bufferSize]; // init to full String Buffer - for( int ix = 0; ix < bufferSize - 1; ++ix ) { + for (int ix = 0; ix < bufferSize - 1; ++ix) { buffer[ix] = 65; } - buffer[bufferSize-1] = 0; - bis.setByteArray( buffer, bufferSize ); + buffer[bufferSize - 1] = 0; + bis.setByteArray(buffer, bufferSize); } //////////////////////////////////////////////////////////////////////////////// -void DataInputStreamBenchmark::tearDown(){ +void DataInputStreamBenchmark::tearDown() { - delete [] buffer; + delete[] buffer; } //////////////////////////////////////////////////////////////////////////////// -void DataInputStreamBenchmark::run(){ +void DataInputStreamBenchmark::run() { - DataInputStream dis( &bis ); + DataInputStream dis(&bis); bool boolResult = 0; char charResult = 0; @@ -63,52 +63,52 @@ void DataInputStreamBenchmark::run(){ float floatResult = 0.0f; std::string stringResult = ""; - for( size_t iy = 0; iy < bufferSize / sizeof( boolResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(boolResult); ++iy) { boolResult = dis.readBoolean(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( charResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(charResult); ++iy) { charResult = dis.readChar(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( byteResult ); ++iy ){ - byteResult = dis.readByte(); + for (size_t iy = 0; iy < bufferSize / sizeof(byteResult); ++iy) { + byteResult = (unsigned char) dis.readByte(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( ushortResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(ushortResult); ++iy) { ushortResult = dis.readUnsignedShort(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( shortResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(shortResult); ++iy) { shortResult = dis.readShort(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( intResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(intResult); ++iy) { intResult = dis.readInt(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( longResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(longResult); ++iy) { longResult = dis.readLong(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( floatResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(floatResult); ++iy) { floatResult = dis.readFloat(); } bis.reset(); - for( size_t iy = 0; iy < bufferSize / sizeof( doubleResult ); ++iy ){ + for (size_t iy = 0; iy < bufferSize / sizeof(doubleResult); ++iy) { doubleResult = dis.readDouble(); } bis.reset(); - for( int i = 0; i < 5; ++i ) { + for (int i = 0; i < 5; ++i) { stringResult = dis.readString(); bis.reset(); } http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/0304e079/activemq-cpp/src/test-benchmarks/decaf/io/DataOutputStreamBenchmark.cpp ---------------------------------------------------------------------- diff --git a/activemq-cpp/src/test-benchmarks/decaf/io/DataOutputStreamBenchmark.cpp b/activemq-cpp/src/test-benchmarks/decaf/io/DataOutputStreamBenchmark.cpp index d64bc50..9b799d1 100644 --- a/activemq-cpp/src/test-benchmarks/decaf/io/DataOutputStreamBenchmark.cpp +++ b/activemq-cpp/src/test-benchmarks/decaf/io/DataOutputStreamBenchmark.cpp @@ -27,55 +27,55 @@ DataOutputStreamBenchmark::DataOutputStreamBenchmark() : testString() { } //////////////////////////////////////////////////////////////////////////////// -void DataOutputStreamBenchmark::setUp(){ +void DataOutputStreamBenchmark::setUp() { - for( size_t i = 0; i < 8096; ++i ) { + for (size_t i = 0; i < 8096; ++i) { testString += 'a'; } } //////////////////////////////////////////////////////////////////////////////// -void DataOutputStreamBenchmark::run(){ +void DataOutputStreamBenchmark::run() { int numRuns = 500; ByteArrayOutputStream bos; - DataOutputStream dos( &bos ); + DataOutputStream dos(&bos); - for( int iy = 0; iy < numRuns * 40; ++iy ){ - dos.writeLong( 0xFF00FF00FF00FF00LL ); + for (int iy = 0; iy < numRuns * 40; ++iy) { + dos.writeLong((long long) 0xFF00FF00FF00FF00LL); } - for( int iy = 0; iy < numRuns * 40; ++iy ){ - dos.writeInt( 312568 ); + for (int iy = 0; iy < numRuns * 40; ++iy) { + dos.writeInt(312568); } - for( int iy = 0; iy < numRuns * 40; ++iy ){ - dos.writeShort( 12568 ); + for (int iy = 0; iy < numRuns * 40; ++iy) { + dos.writeShort(12568); } - for( int iy = 0; iy < numRuns * 40; ++iy ){ - dos.writeUnsignedShort( 12568 ); + for (int iy = 0; iy < numRuns * 40; ++iy) { + dos.writeUnsignedShort(12568); } - for( int iy = 0; iy < numRuns * 40; ++iy ){ - dos.writeBoolean( true ); + for (int iy = 0; iy < numRuns * 40; ++iy) { + dos.writeBoolean(true); } - for( int iy = 0; iy < numRuns * 40; ++iy ){ - dos.writeDouble( 10.34235234 ); + for (int iy = 0; iy < numRuns * 40; ++iy) { + dos.writeDouble(10.34235234); } - for( int iy = 0; iy < numRuns + 40; ++iy ){ - dos.writeFloat( 32.4f ); + for (int iy = 0; iy < numRuns + 40; ++iy) { + dos.writeFloat(32.4f); } bos.reset(); - for( int iy = 0; iy < numRuns; ++iy ){ - dos.writeChars( testString ); + for (int iy = 0; iy < numRuns; ++iy) { + dos.writeChars(testString); bos.reset(); } - for( int iy = 0; iy < numRuns; ++iy ){ - dos.writeBytes( testString ); + for (int iy = 0; iy < numRuns; ++iy) { + dos.writeBytes(testString); bos.reset(); } - for( int iy = 0; iy < numRuns; ++iy ){ - dos.writeUTF( testString ); + for (int iy = 0; iy < numRuns; ++iy) { + dos.writeUTF(testString); bos.reset(); }