Skip to content

Commit

Permalink
[wayland] Fix raw pointer comparison
Browse files Browse the repository at this point in the history
Comparing pointers that do not point into the same array
is unspecified in C++
  • Loading branch information
pkerling committed Mar 22, 2019
1 parent 26972c7 commit dfa64ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xbmc/windowing/wayland/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#pragma once

#include <cstdint>
#include <string>

#include <wayland-client.hpp>
Expand All @@ -24,7 +25,7 @@ struct WaylandCPtrCompare
{
bool operator()(wayland::proxy_t const& p1, wayland::proxy_t const& p2) const
{
return p1.c_ptr() < p2.c_ptr();
return reinterpret_cast<std::uintptr_t>(p1.c_ptr()) < reinterpret_cast<std::uintptr_t>(p2.c_ptr());
}
};

Expand Down

0 comments on commit dfa64ee

Please sign in to comment.