瀏覽代碼

Fix more -Wunused-parameter warnings

Yuriy Chernyshov 5 年之前
父節點
當前提交
2361b1960f
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 4 0
      src/google/protobuf/compiler/cpp/cpp_message.cc
  2. 1 0
      src/google/protobuf/map.h

+ 4 - 0
src/google/protobuf/compiler/cpp/cpp_message.cc

@@ -1054,6 +1054,8 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) {
             "       s->data(), static_cast<int>(s->size()), "
             "::$proto_ns$::internal::"
             "WireFormatLite::PARSE, \"$1$\");\n"
+            "#else\n"
+            "    (void) s;\n"
             "#endif\n"
             "    return true;\n"
             " }\n",
@@ -1081,6 +1083,8 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) {
             "       s->data(), static_cast<int>(s->size()), "
             "::$proto_ns$::internal::"
             "WireFormatLite::PARSE, \"$1$\");\n"
+            "#else\n"
+            "    (void) s;\n"
             "#endif\n"
             "    return true;\n"
             " }\n",

+ 1 - 0
src/google/protobuf/map.h

@@ -826,6 +826,7 @@ class Map {
     // non-determinism to the map ordering.
     bool ShouldInsertAfterHead(void* node) {
 #ifdef NDEBUG
+      (void) node;
       return false;
 #else
       // Doing modulo with a prime mixes the bits more.