| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 02632b4 commit bdb793a
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -233,8 +233,7 @@ int ParseGeneralReply( | |||
| 233 | 233 | status = ares_parse_ptr_reply(buf, len, nullptr, 0, AF_INET, &host); | |
| 234 | 234 | break; | |
| 235 | 235 | default: | |
| 236 | - CHECK(0 && "Bad NS type"); | ||
| 237 | - break; | ||
| 236 | + UNREACHABLE("Bad NS type"); | ||
| 238 | 237 | } | |
| 239 | 238 | ||
| 240 | 239 | if (status != ARES_SUCCESS) | |
@@ -1578,7 +1577,7 @@ void GetAddrInfo(const FunctionCallbackInfo<Value>& args) { | |||
| 1578 | 1577 | family = AF_INET6; | |
| 1579 | 1578 | break; | |
| 1580 | 1579 | default: | |
| 1581 | - CHECK(0 && "bad address family"); | ||
| 1580 | + UNREACHABLE("bad address family"); | ||
| 1582 | 1581 | } | |
| 1583 | 1582 | ||
| 1584 | 1583 | auto req_wrap = std::make_unique<GetAddrInfoReqWrap>(env, | |
@@ -1736,7 +1735,7 @@ void SetServers(const FunctionCallbackInfo<Value>& args) { | |||
| 1736 | 1735 | err = uv_inet_pton(AF_INET6, *ip, &cur->addr); | |
| 1737 | 1736 | break; | |
| 1738 | 1737 | default: | |
| 1739 | - CHECK(0 && "Bad address family."); | ||
| 1738 | + UNREACHABLE("Bad address family"); | ||
| 1740 | 1739 | } | |
| 1741 | 1740 | ||
| 1742 | 1741 | if (err) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -190,12 +190,9 @@ long NodeBIO::Ctrl(BIO* bio, int cmd, long num, // NOLINT(runtime/int) | |||
| 190 | 190 | *reinterpret_cast<void**>(ptr) = nullptr; | |
| 191 | 191 | break; | |
| 192 | 192 | case BIO_C_SET_BUF_MEM: | |
| 193 | - CHECK(0 && "Can't use SET_BUF_MEM_PTR with NodeBIO"); | ||
| 194 | - break; | ||
| 193 | + UNREACHABLE("Can't use SET_BUF_MEM_PTR with NodeBIO"); | ||
| 195 | 194 | case BIO_C_GET_BUF_MEM_PTR: | |
| 196 | - CHECK(0 && "Can't use GET_BUF_MEM_PTR with NodeBIO"); | ||
| 197 | - ret = 0; | ||
| 198 | - break; | ||
| 195 | + UNREACHABLE("Can't use GET_BUF_MEM_PTR with NodeBIO"); | ||
| 199 | 196 | case BIO_CTRL_GET_CLOSE: | |
| 200 | 197 | ret = BIO_get_shutdown(bio); | |
| 201 | 198 | break; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1393,7 +1393,7 @@ BaseObjectPtr<BaseObject> NativeKeyObject::KeyObjectTransferData::Deserialize( | |||
| 1393 | 1393 | key_ctor = env->crypto_key_object_private_constructor(); | |
| 1394 | 1394 | break; | |
| 1395 | 1395 | default: | |
| 1396 | - CHECK(false); | ||
| 1396 | + UNREACHABLE(); | ||
| 1397 | 1397 | } | |
| 1398 | 1398 | ||
| 1399 | 1399 | Local<Value> key; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -321,7 +321,7 @@ void CheckedUvLoopClose(uv_loop_t* loop) { | |||
| 321 | 321 | ||
| 322 | 322 | fflush(stderr); | |
| 323 | 323 | // Finally, abort. | |
| 324 | - CHECK(0 && "uv_loop_close() while having open handles"); | ||
| 324 | + UNREACHABLE("uv_loop_close() while having open handles"); | ||
| 325 | 325 | } | |
| 326 | 326 | ||
| 327 | 327 | void PrintLibuvHandleInformation(uv_loop_t* loop, FILE* stream) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -204,7 +204,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, | |||
| 204 | 204 | } else if (events & UV_CHANGE) { | |
| 205 | 205 | event_string = env->change_string(); | |
| 206 | 206 | } else { | |
| 207 | - CHECK(0 && "bad fs events flag"); | ||
| 207 | + UNREACHABLE("bad fs events flag"); | ||
| 208 | 208 | } | |
| 209 | 209 | ||
| 210 | 210 | Local<Value> argv[] = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -313,7 +313,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { | |||
| 313 | 313 | flush != Z_FULL_FLUSH && | |
| 314 | 314 | flush != Z_FINISH && | |
| 315 | 315 | flush != Z_BLOCK) { | |
| 316 | - CHECK(0 && "Invalid flush value"); | ||
| 316 | + UNREACHABLE("Invalid flush value"); | ||
| 317 | 317 | } | |
| 318 | 318 | ||
| 319 | 319 | if (args[1]->IsNull()) { | |
@@ -814,7 +814,7 @@ void ZlibContext::DoThreadPoolWork() { | |||
| 814 | 814 | ||
| 815 | 815 | break; | |
| 816 | 816 | default: | |
| 817 | - CHECK(0 && "invalid number of gzip magic number bytes read"); | ||
| 817 | + UNREACHABLE("invalid number of gzip magic number bytes read"); | ||
| 818 | 818 | } | |
| 819 | 819 | ||
| 820 | 820 | [[fallthrough]]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -931,8 +931,7 @@ int SyncProcessRunner::ParseStdioOption(int child_fd, | |||
| 931 | 931 | return AddStdioInheritFD(child_fd, inherit_fd); | |
| 932 | 932 | ||
| 933 | 933 | } else { | |
| 934 | - CHECK(0 && "invalid child stdio type"); | ||
| 935 | - return UV_EINVAL; | ||
| 934 | + UNREACHABLE("invalid child stdio type"); | ||
| 936 | 935 | } | |
| 937 | 936 | } | |
| 938 | 937 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -368,8 +368,7 @@ size_t StringBytes::Write(Isolate* isolate, | |||
| 368 | 368 | break; | |
| 369 | 369 | ||
| 370 | 370 | default: | |
| 371 | - CHECK(0 && "unknown encoding"); | ||
| 372 | - break; | ||
| 371 | + UNREACHABLE("unknown encoding"); | ||
| 373 | 372 | } | |
| 374 | 373 | ||
| 375 | 374 | return nbytes; | |
@@ -423,8 +422,7 @@ Maybe<size_t> StringBytes::StorageSize(Isolate* isolate, | |||
| 423 | 422 | break; | |
| 424 | 423 | ||
| 425 | 424 | default: | |
| 426 | - CHECK(0 && "unknown encoding"); | ||
| 427 | - break; | ||
| 425 | + UNREACHABLE("unknown encoding"); | ||
| 428 | 426 | } | |
| 429 | 427 | ||
| 430 | 428 | return Just(data_size); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -233,7 +233,7 @@ int sockaddr_for_family(int address_family, | |||
| 233 | 233 | case AF_INET6: | |
| 234 | 234 | return uv_ip6_addr(address, port, reinterpret_cast<sockaddr_in6*>(addr)); | |
| 235 | 235 | default: | |
| 236 | - CHECK(0 && "unexpected address family"); | ||
| 236 | + UNREACHABLE("unexpected address family"); | ||
| 237 | 237 | } | |
| 238 | 238 | } | |
| 239 | 239 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments