Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Sep 20, 2024
1 parent b58b6bc commit 9a3025b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/xtd.core/include/xtd/comparison_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ namespace xtd {
/// * std::strong_ordering::greater : if lhs greater than rhs;
/// * std::strong_ordering::equivalent : if lhs is equal to rhs.
friend std::strong_ordering operator <=>(const type_t& lhs, const type_t& rhs) noexcept {
if (dynamic_cast<const type_t*>(&rhs) && lhs.compare_to(static_cast<const type_t&>(rhs)) < 0) return std::strong_ordering::less;
if (dynamic_cast<const type_t*>(&rhs) && lhs.compare_to(static_cast<const type_t&>(rhs)) > 0) return std::strong_ordering::greater;
if (dynamic_cast<const type_t*>(&rhs) && lhs.compare_to(static_cast<const type_t&>(rhs)) == 0) return std::strong_ordering::equivalent;
auto rhs_ptr = &rhs;
if (dynamic_cast<const type_t*>(rhs_ptr) && lhs.compare_to(static_cast<const type_t&>(rhs)) < 0) return std::strong_ordering::less;
if (dynamic_cast<const type_t*>(rhs_ptr) && lhs.compare_to(static_cast<const type_t&>(rhs)) > 0) return std::strong_ordering::greater;
if (dynamic_cast<const type_t*>(rhs_ptr) && lhs.compare_to(static_cast<const type_t&>(rhs)) == 0) return std::strong_ordering::equivalent;
return std::strong_ordering::less;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/xtd.core/include/xtd/istringable.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace xtd {
/// @}

/// @cond
friend std::ostream& operator <<(std::ostream& os, const istringable& obj);
friend std::ostream& operator <<(std::ostream& os, const istringable& obj) noexcept;
/// @endcond
};
}
2 changes: 1 addition & 1 deletion src/xtd.core/src/xtd/hash_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ size hash_code::combine_iterator(size seed) noexcept {

size hash_code::hash_combine(size seed, size value) noexcept {
// https://stackoverflow.com/questions/35985960/c-why-is-boosthash-combine-the-best-way-to-combine-hash-values
return seed ^ value + 0x9e3779b9 + (seed << 6) + (seed >> 2);
return (seed ^ value) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}

size hash_code::generate_uniqueness_seed() noexcept {
Expand Down
2 changes: 1 addition & 1 deletion src/xtd.core/src/xtd/istringable.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "../../include/xtd/istringable.h"
#include "../../include/xtd/string.h"

std::ostream& xtd::operator <<(std::ostream& os, const xtd::istringable& obj) {
std::ostream& operator <<(std::ostream& os, const xtd::istringable& obj) noexcept {
return os << obj.to_string();
}

0 comments on commit 9a3025b

Please sign in to comment.