mirror of
https://github.com/boostorg/build.git
synced 2026-07-21 13:13:39 +00:00
Fixed 2 compiler warnings emitted from ./bootstrap.sh --cxx=g++
One complaining that the order in which == operators were declared was undefined, so making all four equals operations in the value_ref class depend on a single one was fragile and another that enums need to be explicitly static_casted since direct adding between two different enum types is deprecated, now the only warning is about calling free on a heap object in a yyparse function, which from a cursory glance is the compiler not realizing that it only gets freed if it isn't a heap object (#600)
This commit is contained in:
@@ -560,7 +560,7 @@ struct jam_arg_spec_count_sum<X, A...>
|
||||
// = X::count + jam_arg_spec_count_sum<A...>::value;
|
||||
enum : std::size_t
|
||||
{
|
||||
value = X::count + jam_arg_spec_count_sum<A...>::value
|
||||
value = static_cast<std::size_t>(X::count) + static_cast<std::size_t>(jam_arg_spec_count_sum<A...>::value)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
+7
-4
@@ -131,12 +131,15 @@ struct value_ref
|
||||
inline bool operator==(value_ptr b) const { return val->equal_to(*b); }
|
||||
inline bool operator==(const char * v) const
|
||||
{
|
||||
return (*this) == value_ref(v);
|
||||
return val->equal_to(*value_ref(v));
|
||||
}
|
||||
template <typename T>
|
||||
inline bool operator!=(T v) const
|
||||
inline bool operator!=(value_ptr b) const
|
||||
{
|
||||
return !((*this) == v);
|
||||
return !(val->equal_to(*b));
|
||||
}
|
||||
inline bool operator!=(const char * v) const
|
||||
{
|
||||
return !(val->equal_to(*value_ref(v)));
|
||||
}
|
||||
inline value_ptr operator->() const { return val; }
|
||||
inline value & operator*() const { return *val; }
|
||||
|
||||
Reference in New Issue
Block a user