Mark every bool conversion as explicit

This commit is contained in:
Jérôme Leclercq 2017-06-21 18:10:46 +02:00
parent d4532ce7ff
commit b2e23cfb56
9 changed files with 9 additions and 9 deletions

View File

@ -145,7 +145,7 @@ namespace Nz
template<bool BadCall = true> template<bool BadCall = true>
void* operator&() const; void* operator&() const;
operator bool() const; explicit operator bool() const;
Bit& operator=(bool val); Bit& operator=(bool val);
Bit& operator=(const Bit& bit); Bit& operator=(const Bit& bit);

View File

@ -24,7 +24,7 @@ namespace Nz
bool IsInitialized() const; bool IsInitialized() const;
void Uninitialize(); void Uninitialize();
operator bool() const; explicit operator bool() const;
Initializer& operator=(const Initializer&) = delete; Initializer& operator=(const Initializer&) = delete;
Initializer& operator=(Initializer&&) = delete; ///TODO Initializer& operator=(Initializer&&) = delete; ///TODO

View File

@ -38,7 +38,7 @@ namespace Nz
Nz::String ToString() const; Nz::String ToString() const;
operator bool() const; explicit operator bool() const;
operator T*() const; operator T*() const;
T* operator->() const; T* operator->() const;

View File

@ -31,7 +31,7 @@ namespace Nz
bool Reset(T* object = nullptr); bool Reset(T* object = nullptr);
ObjectRef& Swap(ObjectRef& ref); ObjectRef& Swap(ObjectRef& ref);
operator bool() const; explicit operator bool() const;
operator T*() const; operator T*() const;
T* operator->() const; T* operator->() const;

View File

@ -41,7 +41,7 @@ namespace Nz
void SetPtr(VoidPtr ptr); void SetPtr(VoidPtr ptr);
void SetStride(int stride); void SetStride(int stride);
operator bool() const; explicit operator bool() const;
operator T*() const; operator T*() const;
T& operator*() const; T& operator*() const;
T* operator->() const; T* operator->() const;

View File

@ -50,7 +50,7 @@ namespace Nz
String ToString() const; String ToString() const;
inline UInt32 ToUInt32() const; inline UInt32 ToUInt32() const;
inline operator bool() const; inline explicit operator bool() const;
IpAddress& operator=(const IpAddress&) = default; IpAddress& operator=(const IpAddress&) = default;
IpAddress& operator=(IpAddress&&) = default; IpAddress& operator=(IpAddress&&) = default;

View File

@ -45,7 +45,7 @@ namespace Nz
inline bool IndexBuffer::IsValid() const inline bool IndexBuffer::IsValid() const
{ {
return m_buffer; return m_buffer.IsValid();
} }
inline void* IndexBuffer::Map(BufferAccess access, UInt32 startIndex, UInt32 length) inline void* IndexBuffer::Map(BufferAccess access, UInt32 startIndex, UInt32 length)

View File

@ -39,7 +39,7 @@ namespace Nz
inline bool VertexBuffer::IsValid() const inline bool VertexBuffer::IsValid() const
{ {
return m_buffer && m_vertexDeclaration; return m_buffer.IsValid() && m_vertexDeclaration.IsValid();
} }
template<typename... Args> template<typename... Args>

View File

@ -527,7 +527,7 @@ namespace Nz
} }
else else
{ {
NazaraNotice("Received wrong token (" + String::Number(token) + " instead of " + String::Number(~peer.stateData1) + ") from client " + peer.address); NazaraNotice("Received wrong token (" + String::Number(token) + " instead of " + String::Number(~peer.stateData1) + ") from client " + peer.address.ToString());
return; //< Ignore return; //< Ignore
} }