[misc] : Remove few more warnings

Observed few warnings with fresh builds:
[365/1113] Building CXX object 
src/kudu/common/CMakeFiles/kudu_common_exported.dir/row_operations.cc.o
../../src/kudu/common/row_operations.cc: In member function ‘std::string 
kudu::DecodedRowOperation::ToString(const kudu::Schema&) const’:
../../src/kudu/common/row_operations.cc:58:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
[403/1113] Building CXX object 
src/kudu/common/CMakeFiles/kudu_common.dir/row_operations.cc.o
../../src/kudu/common/row_operations.cc: In member function ‘std::string 
kudu::DecodedRowOperation::ToString(const kudu::Schema&) const’:
../../src/kudu/common/row_operations.cc:58:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
[516/1113] Building CXX object src/kudu/benchmarks/CMakeFiles/rle.dir/rle.cc.o
../../src/kudu/benchmarks/rle.cc: In function ‘void kudu::BooleanRLE()’:
../../src/kudu/benchmarks/rle.cc:93:10: warning: variable ‘run_length’ set 
but not used [-Wunused-but-set-variable]
   size_t run_length;
          ^
[575/1113] Building CXX object 
src/kudu/cfile/CMakeFiles/cfile.dir/compression_codec.cc.o
In file included from ../../src/kudu/cfile/compression_codec.h:24:0,
                 from ../../src/kudu/cfile/compression_codec.cc:26:
../../src/kudu/gutil/macros.h:102:0: warning: "DISALLOW_COPY_AND_ASSIGN" 
redefined
 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
 ^
In file included from ../../thirdparty/installed-deps/include/snappy.h:45:0,
                 from ../../src/kudu/cfile/compression_codec.cc:20:
../../thirdparty/installed-deps/include/snappy-stubs-public.h:79:0: note: this 
is the location of the previous definition
 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
 ^

Also added a trivial comment update.

Change-Id: I89b96d52dfed6b38f17cf8cdebeed840fb32f98d
Reviewed-on: http://gerrit.cloudera.org:8080/4518
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Alexey Serbin <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/4e3d2550
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/4e3d2550
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/4e3d2550

Branch: refs/heads/master
Commit: 4e3d25502cff273c67b4a408cb2d4716a50c6560
Parents: 799e067
Author: Dinesh Bhat <[email protected]>
Authored: Thu Sep 22 14:14:46 2016 -0700
Committer: Alexey Serbin <[email protected]>
Committed: Fri Sep 23 20:14:12 2016 +0000

----------------------------------------------------------------------
 src/kudu/benchmarks/rle.cc        | 12 +++---------
 src/kudu/codegen/row_projector.cc |  2 +-
 src/kudu/common/row_operations.cc |  1 +
 src/kudu/gutil/macros.h           |  2 ++
 4 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/4e3d2550/src/kudu/benchmarks/rle.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/rle.cc b/src/kudu/benchmarks/rle.cc
index cb2c6f2..93c514b 100644
--- a/src/kudu/benchmarks/rle.cc
+++ b/src/kudu/benchmarks/rle.cc
@@ -24,6 +24,7 @@
 #include <glog/logging.h>
 #include <gflags/gflags.h>
 
+#include "kudu/gutil/basictypes.h"
 #include "kudu/gutil/mathlimits.h"
 #include "kudu/util/bit-stream-utils.h"
 #include "kudu/util/logging.h"
@@ -90,15 +91,8 @@ void BooleanRLE() {
 
   RleDecoder<bool> decoder(buffer.data(), encoder.len(), 1);
   bool val = false;
-  size_t run_length;
-  for (int i = 0; i < num_iters; i++) {
-    run_length = decoder.GetNextRun(&val, MathLimits<size_t>::kMax);
-    run_length = decoder.GetNextRun(&val, MathLimits<size_t>::kMax);
-    run_length = decoder.GetNextRun(&val, MathLimits<size_t>::kMax);
-    run_length = decoder.GetNextRun(&val, MathLimits<size_t>::kMax);
-    run_length = decoder.GetNextRun(&val, MathLimits<size_t>::kMax);
-    run_length = decoder.GetNextRun(&val, MathLimits<size_t>::kMax);
-    run_length = decoder.GetNextRun(&val, MathLimits<size_t>::kMax);
+  for (int i = 0; i < num_iters * 7; i++) {
+    ignore_result(decoder.GetNextRun(&val, MathLimits<size_t>::kMax));
   }
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/4e3d2550/src/kudu/codegen/row_projector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/row_projector.cc 
b/src/kudu/codegen/row_projector.cc
index c6076cf..fe34be6 100644
--- a/src/kudu/codegen/row_projector.cc
+++ b/src/kudu/codegen/row_projector.cc
@@ -405,7 +405,7 @@ Status RowProjector::Init() {
   //
   // This equivalence relation can be decomposed as:
   //
-  //   ProjectionsCompatible((base1, proj1), (base2, proj2)) :=
+  //   compat_check((base1, proj1), (base2, proj2)) :=
   //     WELLFORMED(base1, proj1) &&
   //     WELLFORMED(base2, proj2) &&
   //     PROJEQUALS(base1, base2) &&

http://git-wip-us.apache.org/repos/asf/kudu/blob/4e3d2550/src/kudu/common/row_operations.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/row_operations.cc 
b/src/kudu/common/row_operations.cc
index 17effcd..4c8adc6 100644
--- a/src/kudu/common/row_operations.cc
+++ b/src/kudu/common/row_operations.cc
@@ -55,6 +55,7 @@ string DecodedRowOperation::ToString(const Schema& schema) 
const {
     case RowOperationsPB::INCLUSIVE_RANGE_UPPER_BOUND:
       return Substitute("INCLUSIVE_RANGE_UPPER_BOUND $0", 
split_row->ToString());
   }
+  return "UNKNOWN";
 }
 
 RowOperationsPBEncoder::RowOperationsPBEncoder(RowOperationsPB* pb)

http://git-wip-us.apache.org/repos/asf/kudu/blob/4e3d2550/src/kudu/gutil/macros.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/macros.h b/src/kudu/gutil/macros.h
index a57a375..7ebb4b4 100644
--- a/src/kudu/gutil/macros.h
+++ b/src/kudu/gutil/macros.h
@@ -98,6 +98,7 @@ struct CompileAssert {
 // http://gcc.gnu.org/PR51213 in gcc-4.7 / Crosstool v16.
 // TODO(user): Remove "&& !defined(__clang_)" when =delete is
 // gcc-4.7 before =delete is allowed, go back to the C++98 definition.
+#ifndef DISALLOW_COPY_AND_ASSIGN
 #if LANG_CXX11 && !defined(__clang__)
 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
   TypeName(const TypeName&) = delete;      \
@@ -107,6 +108,7 @@ struct CompileAssert {
   TypeName(const TypeName&);               \
   void operator=(const TypeName&)
 #endif
+#endif
 
 // An older, politically incorrect name for the above.
 // Prefer DISALLOW_COPY_AND_ASSIGN for new code.

Reply via email to