diff options
author | yang-g <yangg@google.com> | 2015-10-07 11:40:13 -0700 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-10-07 11:40:13 -0700 |
commit | b063c87596f4e05e4aaac9f69541e01278920451 (patch) | |
tree | f0ac8083daec33e61943e38e328b1b766007fe15 /src/core/httpcli | |
parent | fbfd3d42d2f4fcbc627b713f5ba7f0540bc0a8d0 (diff) |
mark unreachable code with a macro
Diffstat (limited to 'src/core/httpcli')
-rw-r--r-- | src/core/httpcli/parser.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/httpcli/parser.c b/src/core/httpcli/parser.c index 404906d5ae..046770c094 100644 --- a/src/core/httpcli/parser.c +++ b/src/core/httpcli/parser.c @@ -139,8 +139,7 @@ static int finish_line(grpc_httpcli_parser *parser) { } break; case GRPC_HTTPCLI_BODY: - gpr_log(GPR_ERROR, "should never reach here"); - abort(); + GPR_UNREACHABLE_CODE(return 0); } parser->cur_line_length = 0; @@ -165,8 +164,7 @@ static int addbyte(grpc_httpcli_parser *parser, gpr_uint8 byte) { } else { return 1; } - gpr_log(GPR_ERROR, "should never reach here"); - abort(); + GPR_UNREACHABLE_CODE(return 0); case GRPC_HTTPCLI_BODY: if (parser->r.body_length == parser->body_capacity) { parser->body_capacity = GPR_MAX(8, parser->body_capacity * 3 / 2); @@ -177,10 +175,7 @@ static int addbyte(grpc_httpcli_parser *parser, gpr_uint8 byte) { parser->r.body_length++; return 1; } - gpr_log(GPR_ERROR, "should never reach here"); - abort(); - - return 0; + GPR_UNREACHABLE_CODE(return 0); } void grpc_httpcli_parser_init(grpc_httpcli_parser *parser) { |