From aeab1a0b7986b2de8d200bf5ce43d0f9d72dd528 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Wed, 29 Nov 2017 19:18:58 -0800 Subject: [PATCH] Fix MSVC builds --- src/indexer.h | 2 +- src/query.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/indexer.h b/src/indexer.h index 6d142d91..9c5e8593 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -134,7 +134,7 @@ inline void Reflect(Writer& visitor, IndexFuncRef& value) { s += "~"; // id.id is unsigned, special case 0 value - if (static_cast(value.id.id) == -1) { + if (value.id.id == static_cast(-1)) { s += "-1"; } else { s += std::to_string(value.id.id); diff --git a/src/query.h b/src/query.h index 9bc9db0b..9d23177d 100644 --- a/src/query.h +++ b/src/query.h @@ -110,7 +110,7 @@ struct QueryFuncRef { QueryLocation loc; bool is_implicit = false; - bool has_id() const { return static_cast(id_.id) != -1; } + bool has_id() const { return id_.id != static_cast(-1); } QueryFuncRef() {} // Do not use, needed for reflect. QueryFuncRef(QueryFuncId id, QueryLocation loc, bool is_implicit)