Fix -Wreturn-type warnings

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <99f7a006daaa78eb87720ac51c394093398bc868.1504013915.git.bdenes@scylladb.com>
This commit is contained in:
Botond Dénes
2017-08-29 16:39:34 +03:00
committed by Avi Kivity
parent f1eb6a8de3
commit d1209c548a
9 changed files with 11 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ operator<<(std::ostream&out, constants::type t)
case constants::type::DURATION: return out << "DURATION";
};
assert(0);
return out << "UNKOWN";
}
bytes

View File

@@ -620,6 +620,7 @@ future<mutation> query_partition_mutation(service::storage_proxy& proxy,
return partitions[0].mut().unfreeze(s);
} else {
assert(false && "Results must have at most one partition");
throw std::invalid_argument("Results must have at most one partition");
}
});
});

View File

@@ -160,6 +160,7 @@ byte_ordered_partitioner::shard_of(const token& t) const {
return (uint8_t(t._data[0]) * _shard_count) >> 8;
}
assert(0);
throw std::invalid_argument("invalid token");
}
token
@@ -177,6 +178,7 @@ byte_ordered_partitioner::token_for_next_shard(const token& t, shard_id shard, u
return token(token::kind::key, managed_bytes({int8_t(e)}));
}
assert(0);
throw std::invalid_argument("invalid token");
}

View File

@@ -255,6 +255,7 @@ murmur3_partitioner::shard_of(const token& t) const {
return zero_based_shard_of(adjusted, _shard_count, _sharding_ignore_msb_bits);
}
assert(0);
throw std::invalid_argument("invalid token");
}
token

View File

@@ -220,6 +220,7 @@ unsigned random_partitioner::shard_of(const token& t) const {
return smp;
}
assert(0);
throw std::invalid_argument("invalid token");
}
token
@@ -240,6 +241,7 @@ random_partitioner::token_for_next_shard(const token& t, shard_id shard, unsigne
return cppint_to_token(t.convert_to<boost::multiprecision::uint128_t>());
}
assert(0);
throw std::invalid_argument("invalid token");
}

View File

@@ -36,6 +36,7 @@ lexicographical_relation relation_for_lower_bound(composite_view v) {
return lexicographical_relation::after_all_prefixed;
default:
assert(0);
throw std::invalid_argument("invalid composite_view");
}
}

View File

@@ -235,6 +235,7 @@ future<> schema_registry_entry::maybe_sync(std::function<future<>()> syncer) {
}
default:
assert(0);
throw std::logic_error("invalid _sync_state");
}
}

View File

@@ -177,6 +177,7 @@ struct compression {
const_iterator& operator=(const const_iterator& other) {
assert(&_offsets == &other._offsets);
_index = other._index;
return *this;
}
const_iterator operator++(int) {

View File

@@ -64,6 +64,7 @@ std::ostream& operator<<(std::ostream& out, cause c) {
case cause::VIEWS: return out << "MATERIALIZED_VIEWS";
}
assert(0);
return out << "UNKNOWN_CAUSE";
}
void warn(cause c) {