From c70632420861b161a35cd7b8d3163160c279bfc4 Mon Sep 17 00:00:00 2001 From: storagezhang Date: Fri, 19 Mar 2021 11:56:25 -0700 Subject: [PATCH] Add default in switch (#8065) Summary: switch may not cover all branch in `db/c.cc`: ```c++ void rocksdb_options_set_access_hint_on_compaction_start( rocksdb_options_t* opt, int v) { switch(v) { case 0: opt->rep.access_hint_on_compaction_start = ROCKSDB_NAMESPACE::Options::NONE; break; case 1: opt->rep.access_hint_on_compaction_start = ROCKSDB_NAMESPACE::Options::NORMAL; break; case 2: opt->rep.access_hint_on_compaction_start = ROCKSDB_NAMESPACE::Options::SEQUENTIAL; break; case 3: opt->rep.access_hint_on_compaction_start = ROCKSDB_NAMESPACE::Options::WILLNEED; break; } } ``` Pull Request resolved: https://github.com/facebook/rocksdb/pull/8065 Reviewed By: riversand963 Differential Revision: D27102892 Pulled By: zhichao-cao fbshipit-source-id: ad1d20d192712878e61597311ba75b55df0066d7 --- db/c.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/c.cc b/db/c.cc index c556f3eee9..b03bf9ad8e 100644 --- a/db/c.cc +++ b/db/c.cc @@ -2959,6 +2959,8 @@ void rocksdb_options_set_access_hint_on_compaction_start( opt->rep.access_hint_on_compaction_start = ROCKSDB_NAMESPACE::Options::WILLNEED; break; + default: + assert(0); } }