From 1526d0970129172fdec2883bbf1ab84e2e147638 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Tue, 24 May 2011 22:10:13 +0200 Subject: [PATCH] Changed Packet::operator bool() to Packet::operator void*(), to avoid inappropriate implicit conversions --- include/SFML/Network/Packet.hpp | 2 +- src/SFML/Network/Packet.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SFML/Network/Packet.hpp b/include/SFML/Network/Packet.hpp index 4c8c6404..a4a2cb73 100644 --- a/include/SFML/Network/Packet.hpp +++ b/include/SFML/Network/Packet.hpp @@ -159,7 +159,7 @@ public : /// \see EndOfPacket /// //////////////////////////////////////////////////////////// - operator bool() const; + operator void*() const; //////////////////////////////////////////////////////////// /// Overloads of operator >> to read data from the packet diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index 11cf5d58..5b668969 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -92,9 +92,9 @@ bool Packet::EndOfPacket() const //////////////////////////////////////////////////////////// -Packet::operator bool() const +Packet::operator void*() const { - return myIsValid; + return myIsValid ? this : NULL; }