forked from qt-creator/qt-creator
Clang: Fix aliasing
Task-number: QTCREATORBUG-15888 Change-Id: I0f2e28e9e0da53481c03707ab0a9abf728c7419f Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -56,15 +56,10 @@ quint64 CodeCompletedMessage::ticketNumber() const
|
||||
return ticketNumber_;
|
||||
}
|
||||
|
||||
quint32 &CodeCompletedMessage::neededCorrectionAsInt()
|
||||
{
|
||||
return reinterpret_cast<quint32&>(neededCorrection_);
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const CodeCompletedMessage &message)
|
||||
{
|
||||
out << message.codeCompletions_;
|
||||
out << quint32(message.neededCorrection_);
|
||||
out << static_cast<quint32>(message.neededCorrection_);
|
||||
out << message.ticketNumber_;
|
||||
|
||||
return out;
|
||||
@@ -72,10 +67,14 @@ QDataStream &operator<<(QDataStream &out, const CodeCompletedMessage &message)
|
||||
|
||||
QDataStream &operator>>(QDataStream &in, CodeCompletedMessage &message)
|
||||
{
|
||||
quint32 neededCorrection;
|
||||
|
||||
in >> message.codeCompletions_;
|
||||
in >> message.neededCorrectionAsInt();
|
||||
in >> neededCorrection;
|
||||
in >> message.ticketNumber_;
|
||||
|
||||
message.neededCorrection_ = static_cast<CompletionCorrection>(neededCorrection);
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user