You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/08/04 20:09:48 UTC

[3/3] activemq-cpp git commit: Fix some more warnings.

Fix some more 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/d3e13e38
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/d3e13e38
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/d3e13e38

Branch: refs/heads/master
Commit: d3e13e386bd63d619b8dc70cdaf2ea9be80f7ce1
Parents: 0304e07
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Aug 4 11:29:35 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Tue Aug 4 11:29:35 2015 -0400

----------------------------------------------------------------------
 activemq-cpp/src/main/decaf/lang/System.cpp               |  2 +-
 activemq-cpp/src/main/decaf/util/HashCode.h               |  4 ++--
 activemq-cpp/src/main/decaf/util/Properties.cpp           | 10 ++++++----
 .../src/main/decaf/util/concurrent/CopyOnWriteArrayList.h |  4 ++--
 .../decaf/io/BufferedInputStreamBenchmark.cpp             |  1 -
 5 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/d3e13e38/activemq-cpp/src/main/decaf/lang/System.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/lang/System.cpp b/activemq-cpp/src/main/decaf/lang/System.cpp
index 5b9f04e..199dd66 100644
--- a/activemq-cpp/src/main/decaf/lang/System.cpp
+++ b/activemq-cpp/src/main/decaf/lang/System.cpp
@@ -411,7 +411,7 @@ const Map<string, string>& System::getenv() {
         } else if (tokens > 2) {
             // special case: first equals delimits the key value, the rest are
             // part of the variable
-            int pos = (int) env[i].find("=");
+            std::size_t pos = env[i].find("=");
             key = env[i].substr(0, pos);
             value = env[i].substr(pos + 1, string::npos);
         } else if (tokens == 0) {

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/d3e13e38/activemq-cpp/src/main/decaf/util/HashCode.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/HashCode.h b/activemq-cpp/src/main/decaf/util/HashCode.h
index 51cc792..a51b751 100644
--- a/activemq-cpp/src/main/decaf/util/HashCode.h
+++ b/activemq-cpp/src/main/decaf/util/HashCode.h
@@ -149,7 +149,7 @@ namespace util {
     template<>
     struct HashCode<long long> : public HashCodeUnaryBase<long long> {
         int operator()(long long arg) const {
-            return (int) (arg ^ ((unsigned long long) arg >> 32));
+            return (int) ((unsigned long long) arg ^ ((unsigned long long) arg >> 32));
         }
     };
 
@@ -164,7 +164,7 @@ namespace util {
     struct HashCode<double> : public HashCodeUnaryBase<double> {
         int operator()(double arg) const {
             long long value = decaf::lang::Double::doubleToLongBits(arg);
-            return (int) (value ^ ((unsigned long long) value >> 32));
+            return (int) ((unsigned long long) value ^ ((unsigned long long) value >> 32));
         }
     };
 

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/d3e13e38/activemq-cpp/src/main/decaf/util/Properties.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/Properties.cpp b/activemq-cpp/src/main/decaf/util/Properties.cpp
index 71b38b9..d24d531 100644
--- a/activemq-cpp/src/main/decaf/util/Properties.cpp
+++ b/activemq-cpp/src/main/decaf/util/Properties.cpp
@@ -428,8 +428,8 @@ void Properties::load(decaf::io::InputStream* stream) {
                             }
                             std::string temp(buf.begin(), buf.begin() + offset);
 
-                            this->internal->properties.put(temp.substr(
-                                0, keyLength), temp.substr(keyLength));
+                            this->internal->properties.put(
+                                temp.substr(0, (std::size_t) keyLength), temp.substr((std::size_t) keyLength));
                         }
 
                         keyLength = -1;
@@ -451,7 +451,8 @@ void Properties::load(decaf::io::InputStream* stream) {
                         }
                         break;
                 }
-                if( Character::isWhitespace( nextChar ) ) {
+
+                if (Character::isWhitespace(nextChar)) {
                     if (mode == PARSE_MODE_CONTINUE) {
                         mode = PARSE_MODE_IGNORE;
                     }
@@ -486,7 +487,8 @@ void Properties::load(decaf::io::InputStream* stream) {
 
         if (keyLength >= 0) {
             std::string temp(buf.begin(), buf.begin() + offset);
-            this->internal->properties.put(temp.substr(0, keyLength), temp.substr(keyLength));
+            this->internal->properties.put(
+                temp.substr(0, (std::size_t) keyLength), temp.substr((std::size_t) keyLength));
         }
     }
     DECAF_CATCH_RETHROW(IOException)

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/d3e13e38/activemq-cpp/src/main/decaf/util/concurrent/CopyOnWriteArrayList.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/concurrent/CopyOnWriteArrayList.h b/activemq-cpp/src/main/decaf/util/concurrent/CopyOnWriteArrayList.h
index 7a08d17..148260b 100644
--- a/activemq-cpp/src/main/decaf/util/concurrent/CopyOnWriteArrayList.h
+++ b/activemq-cpp/src/main/decaf/util/concurrent/CopyOnWriteArrayList.h
@@ -497,8 +497,8 @@ namespace concurrent {
                 this->arrayLock.readLock().unlock();
                 throw;
             }
-            std::vector<E> result( current->size );
-            for( int i = 0; i < current->size; ++i ) {
+            std::vector<E> result((std::size_t) current->size);
+            for (int i = 0; i < current->size; ++i) {
                 result[i] = current->elements[i];
             }
 

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/d3e13e38/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 86057d1..674a7c3 100644
--- a/activemq-cpp/src/test-benchmarks/decaf/io/BufferedInputStreamBenchmark.cpp
+++ b/activemq-cpp/src/test-benchmarks/decaf/io/BufferedInputStreamBenchmark.cpp
@@ -39,7 +39,6 @@ void BufferedInputStreamBenchmark::setUp() {
 
 ////////////////////////////////////////////////////////////////////////////////
 void BufferedInputStreamBenchmark::tearDown() {
-
     delete[] buffer;
 }