mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 08:59:37 -05:00
Suppress aliasing warning in DirDetails and DirStub
Order of serialization doesn't matter ATM as we use those only for JSON API. Those classes should be rewritten anyway with proper naming of the memebers and using std::uintptr_t instead of void* and rstime_t for timestamps
This commit is contained in:
parent
047ae7f723
commit
b3d73ba6a5
@ -277,8 +277,14 @@ struct DirStub : RsSerializable
|
||||
{
|
||||
RS_SERIAL_PROCESS(type);
|
||||
RS_SERIAL_PROCESS(name);
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||
std::uintptr_t& handle(reinterpret_cast<std::uintptr_t&>(ref));
|
||||
RS_SERIAL_PROCESS(handle);
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic pop
|
||||
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||
}
|
||||
};
|
||||
|
||||
@ -313,11 +319,17 @@ struct DirDetails : RsSerializable
|
||||
void serial_process(RsGenericSerializer::SerializeJob j,
|
||||
RsGenericSerializer::SerializeContext& ctx)
|
||||
{
|
||||
std::uintptr_t& parentHandle(reinterpret_cast<std::uintptr_t&>(parent));
|
||||
RS_SERIAL_PROCESS(parentHandle);
|
||||
RS_SERIAL_PROCESS(prow);
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||
std::uintptr_t& handle(reinterpret_cast<std::uintptr_t&>(ref));
|
||||
RS_SERIAL_PROCESS(handle);
|
||||
std::uintptr_t& parentHandle(reinterpret_cast<std::uintptr_t&>(parent));
|
||||
RS_SERIAL_PROCESS(parentHandle);
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic pop
|
||||
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||
RS_SERIAL_PROCESS(prow);
|
||||
RS_SERIAL_PROCESS(type);
|
||||
RS_SERIAL_PROCESS(id);
|
||||
RS_SERIAL_PROCESS(name);
|
||||
|
Loading…
Reference in New Issue
Block a user