address reviews and make compile with `-Wunused-variable`

This commit is contained in:
mpilman 2019-04-17 10:49:19 -07:00
parent a92233a371
commit 46e7a0ca56
7 changed files with 10 additions and 9 deletions

View File

@ -146,9 +146,10 @@ struct OpenDatabaseRequest {
template <class Ar>
void serialize(Ar& ar) {
if constexpr (!is_fb_function<Ar>) {
ASSERT( ar.protocolVersion() >= 0x0FDB00A400040001LL );
ASSERT(ar.protocolVersion() >= 0x0FDB00A400040001LL);
}
serializer(ar, issues, supportedVersions, connectedCoordinatorsNum, traceLogGroup, knownClientInfoID, reply, arena);
serializer(ar, issues, supportedVersions, connectedCoordinatorsNum, traceLogGroup, knownClientInfoID, reply,
arena);
}
};

View File

@ -1022,7 +1022,7 @@ static PacketID sendPacket( TransportData* self, ISerializeSource const& what, c
Standalone<StringRef> copy;
if (g_network->useObjectSerializer()) {
ObjectWriter wr;
what.serializeBinaryWriter(wr);
what.serializeObjectWriter(wr);
copy = wr.toStringRef();
} else {
BinaryWriter wr( AssumeVersion(currentProtocolVersion) );

View File

@ -203,6 +203,7 @@ struct JVMContext {
bool checkException() {
auto flag = env->ExceptionCheck();
if (flag) {
env->ExceptionOccurred();
TraceEvent(SevError, "JavaException");
env->ExceptionDescribe();
env->ExceptionClear();

View File

@ -109,7 +109,7 @@ public:
data = new (arena) uint8_t[size];
return data;
};
auto res = save_members(allocator, file_identifier, items...);
save_members(allocator, file_identifier, items...);
ASSERT(allocations == 1);
}

View File

@ -1410,7 +1410,7 @@ void setMemoryQuota( size_t limit ) {
}
if (!AssignProcessToJobObject( job, GetCurrentProcess() ))
TraceEvent(SevWarn, "FailedToSetMemoryLimit").GetLastError();
#elif defined(__linux__) && !defined(USE_ASAN)
#elif defined(__linux__)
struct rlimit rlim;
if (getrlimit(RLIMIT_AS, &rlim)) {
TraceEvent(SevError, "GetMemoryLimit").GetLastError();

View File

@ -816,7 +816,6 @@ struct LoadSaveHelper {
std::enable_if_t<is_struct_like<U>> load(U& member, const uint8_t* current, Context& context) {
using StructTraits = struct_like_traits<U>;
using types = typename StructTraits::types;
constexpr auto size = struct_size(types{});
for_each_i<pack_size(types{})>([&](auto i_type) {
constexpr int i = decltype(i_type)::value;
using type = index_t<i, types>;

View File

@ -721,7 +721,7 @@ private:
struct ISerializeSource {
virtual void serializePacketWriter(PacketWriter&, bool useObjectSerializer) const = 0;
virtual void serializeBinaryWriter(BinaryWriter&) const = 0;
virtual void serializeBinaryWriter(ObjectWriter&) const = 0;
virtual void serializeObjectWriter(ObjectWriter&) const = 0;
};
template <class T, class V>
@ -745,7 +745,7 @@ struct SerializeSource : MakeSerializeSource<SerializeSource<T>, T> {
using value_type = T;
T const& value;
SerializeSource(T const& value) : value(value) {}
virtual void serializeBinaryWriter(ObjectWriter& w) const {
virtual void serializeObjectWriter(ObjectWriter& w) const {
w.serialize(value);
}
template <class Ar> void serialize(Ar& ar) const {
@ -761,7 +761,7 @@ struct SerializeBoolAnd : MakeSerializeSource<SerializeBoolAnd<T>, T> {
T const& value;
SerializeBoolAnd( bool b, T const& value ) : b(b), value(value) {}
template <class Ar> void serialize(Ar& ar) const { ar << b << value; }
virtual void serializeBinaryWriter(ObjectWriter& w) const {
virtual void serializeObjectWriter(ObjectWriter& w) const {
ASSERT(false);
}
virtual T const& get() const {