Commit 2fc88527 authored by Christian Maurer's avatar Christian Maurer Committed by Adam Cozzette

c++ remove warning switch contains default but no case

parent 3f4f3152
......@@ -1723,8 +1723,8 @@ class ParseLoopGenerator {
"while (!ctx->Done(&ptr)) {\n"
" $uint32$ tag;\n"
" ptr = $pi_ns$::ReadTag(ptr, &tag);\n"
" CHK_(ptr);\n"
" switch (tag >> 3) {\n");
" CHK_(ptr);\n");
if (!ordered_fields.empty()) format_(" switch (tag >> 3) {\n");
format_.Indent();
format_.Indent();
......@@ -1787,7 +1787,7 @@ class ParseLoopGenerator {
} // for loop over ordered fields
// Default case
format_("default: {\n");
if (!ordered_fields.empty()) format_("default: {\n");
if (!ordered_fields.empty()) format_("handle_unusual:\n");
format_(
" if ((tag & 7) == 4 || tag == 0) {\n"
......@@ -1828,12 +1828,11 @@ class ParseLoopGenerator {
" CHK_(ptr != nullptr);\n"
" continue;\n");
}
format_("}\n"); // default case
if (!ordered_fields.empty()) format_("}\n"); // default case
format_.Outdent();
format_.Outdent();
format_(
" } // switch\n"
"} // while\n");
if (!ordered_fields.empty()) format_(" } // switch\n");
format_("} // while\n");
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment