Unverified Commit c4943308 authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #632 from capnproto/fix-warnings

Fix new compiler warnings.
parents 0034d126 a75953ed
......@@ -2475,16 +2475,16 @@ private:
const char* linkage = scope.size() == 0 ? "extern " : "static ";
switch (type.which()) {
case schema::Value::BOOL:
case schema::Value::INT8:
case schema::Value::INT16:
case schema::Value::INT32:
case schema::Value::INT64:
case schema::Value::UINT8:
case schema::Value::UINT16:
case schema::Value::UINT32:
case schema::Value::UINT64:
case schema::Value::ENUM:
case schema::Type::BOOL:
case schema::Type::INT8:
case schema::Type::INT16:
case schema::Type::INT32:
case schema::Type::INT64:
case schema::Type::UINT8:
case schema::Type::UINT16:
case schema::Type::UINT32:
case schema::Type::UINT64:
case schema::Type::ENUM:
return ConstText {
false,
kj::strTree("static constexpr ", typeName_, ' ', upperCase, " = ",
......@@ -2497,9 +2497,9 @@ private:
"#endif\n")
};
case schema::Value::VOID:
case schema::Value::FLOAT32:
case schema::Value::FLOAT64: {
case schema::Type::VOID:
case schema::Type::FLOAT32:
case schema::Type::FLOAT64: {
// TODO(msvc): MSVC doesn't like float- or class-typed constexprs. As soon as this is fixed,
// treat VOID, FLOAT32, and FLOAT64 the same as the other primitives.
kj::String value = literalValue(schema.getType(), constProto.getValue()).flatten();
......@@ -2513,7 +2513,7 @@ private:
};
}
case schema::Value::TEXT: {
case schema::Type::TEXT: {
kj::String constType = kj::strTree(
"::capnp::_::ConstText<", schema.as<Text>().size(), ">").flatten();
return ConstText {
......@@ -2524,7 +2524,7 @@ private:
};
}
case schema::Value::DATA: {
case schema::Type::DATA: {
kj::String constType = kj::strTree(
"::capnp::_::ConstData<", schema.as<Data>().size(), ">").flatten();
return ConstText {
......@@ -2535,7 +2535,7 @@ private:
};
}
case schema::Value::STRUCT: {
case schema::Type::STRUCT: {
kj::String constType = kj::strTree(
"::capnp::_::ConstStruct<", typeName_, ">").flatten();
return ConstText {
......@@ -2546,7 +2546,7 @@ private:
};
}
case schema::Value::LIST: {
case schema::Type::LIST: {
kj::String constType = kj::strTree(
"::capnp::_::ConstList<", typeName(type.asList().getElementType(), nullptr), ">")
.flatten();
......@@ -2558,8 +2558,8 @@ private:
};
}
case schema::Value::ANY_POINTER:
case schema::Value::INTERFACE:
case schema::Type::ANY_POINTER:
case schema::Type::INTERFACE:
return ConstText { false, kj::strTree(), kj::strTree() };
}
......
......@@ -1168,7 +1168,6 @@ TEST(Rpc, RealmGatewayImportExport) {
kj::EventLoop loop;
kj::WaitScope waitScope(loop);
TestNetwork network;
TestRestorer restorer;
TestNetworkAdapter& clientNetwork = network.add("client");
TestNetworkAdapter& serverNetwork = network.add("server");
RpcSystem<test::TestSturdyRefHostId> rpcClient =
......@@ -1222,7 +1221,6 @@ TEST(Rpc, RealmGatewayImportExport) {
kj::EventLoop loop;
kj::WaitScope waitScope(loop);
TestNetwork network;
TestRestorer restorer;
TestNetworkAdapter& clientNetwork = network.add("client");
TestNetworkAdapter& serverNetwork = network.add("server");
RpcSystem<test::TestSturdyRefHostId> rpcClient =
......
......@@ -99,7 +99,7 @@ void ensureOpenSslInitialized() {
// AsyncIoStream is simply wrapping a file descriptor (or other readiness-based stream?) and use
// that directly if so.
class TlsConnection: public kj::AsyncIoStream {
class TlsConnection final: public kj::AsyncIoStream {
public:
TlsConnection(kj::Own<kj::AsyncIoStream> stream, SSL_CTX* ctx)
: TlsConnection(*stream, ctx) {
......@@ -372,7 +372,7 @@ private:
// =======================================================================================
// Implementations of ConnectionReceiver, NetworkAddress, and Network as wrappers adding TLS.
class TlsConnectionReceiver: public kj::ConnectionReceiver {
class TlsConnectionReceiver final: public kj::ConnectionReceiver {
public:
TlsConnectionReceiver(TlsContext& tls, kj::Own<kj::ConnectionReceiver> inner)
: tls(tls), inner(kj::mv(inner)) {}
......@@ -400,7 +400,7 @@ private:
kj::Own<kj::ConnectionReceiver> inner;
};
class TlsNetworkAddress: public kj::NetworkAddress {
class TlsNetworkAddress final: public kj::NetworkAddress {
public:
TlsNetworkAddress(TlsContext& tls, kj::String hostname, kj::Own<kj::NetworkAddress>&& inner)
: tls(tls), hostname(kj::mv(hostname)), inner(kj::mv(inner)) {}
......@@ -435,7 +435,7 @@ private:
kj::Own<kj::NetworkAddress> inner;
};
class TlsNetwork: public kj::Network {
class TlsNetwork final: public kj::Network {
public:
TlsNetwork(TlsContext& tls, kj::Network& inner): tls(tls), inner(inner) {}
TlsNetwork(TlsContext& tls, kj::Own<kj::Network> inner)
......
......@@ -631,7 +631,7 @@ void MainBuilder::MainImpl::usageError(StringPtr programName, StringPtr message)
class MainBuilder::Impl::OptionDisplayOrder {
public:
bool operator()(const Option* a, const Option* b) {
bool operator()(const Option* a, const Option* b) const {
if (a == b) return false;
char aShort = '\0';
......
......@@ -32,7 +32,7 @@ kj::Exception Timer::makeTimeoutException() {
struct TimerImpl::Impl {
struct TimerBefore {
bool operator()(TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs);
bool operator()(TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs) const;
};
using Timers = std::multiset<TimerPromiseAdapter*, TimerBefore>;
Timers timers;
......@@ -66,7 +66,7 @@ private:
};
inline bool TimerImpl::Impl::TimerBefore::operator()(
TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs) {
TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs) const {
return lhs->time < rhs->time;
}
......
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