diff options
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/CompilerKit/ErrorOr.h | 4 | ||||
| -rw-r--r-- | dev/CompilerKit/Ref.h | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/StringKit.h | 6 | ||||
| -rw-r--r-- | dev/ThirdParty/Dialogs.h | 7 |
4 files changed, 9 insertions, 10 deletions
diff --git a/dev/CompilerKit/ErrorOr.h b/dev/CompilerKit/ErrorOr.h index 218bec5..ef6cb84 100644 --- a/dev/CompilerKit/ErrorOr.h +++ b/dev/CompilerKit/ErrorOr.h @@ -36,9 +36,9 @@ class ErrorOr final { Int32 Error() { return mId; } - BOOL HasError() { return mId != NECTI_SUCCESS; } + Bool HasError() { return mId != NECTI_SUCCESS; } - operator bool() { return mRef; } + explicit operator bool() { return mRef; } private: Ref<T> mRef; diff --git a/dev/CompilerKit/Ref.h b/dev/CompilerKit/Ref.h index bbe67de..381b628 100644 --- a/dev/CompilerKit/Ref.h +++ b/dev/CompilerKit/Ref.h @@ -47,7 +47,7 @@ class Ref final { Bool IsStrong() const { return m_Strong; } - operator bool() { return *m_Class; } + explicit operator bool() { return *m_Class; } private: T* m_Class{nullptr}; diff --git a/dev/CompilerKit/StringKit.h b/dev/CompilerKit/StringKit.h index 422d163..c4efbee 100644 --- a/dev/CompilerKit/StringKit.h +++ b/dev/CompilerKit/StringKit.h @@ -56,7 +56,7 @@ class BasicString final { BasicString& operator+=(const Char rhs); BasicString& operator+=(const BasicString& rhs); - operator bool() { return m_Data && m_Data[0] != 0; } + explicit operator bool() { return m_Data && m_Data[0] != 0; } bool operator!() { return !m_Data || m_Data[0] == 0; } @@ -77,7 +77,7 @@ struct StringBuilder final { static BasicString FromInt(const char* fmt, int n); static BasicString FromBool(const char* fmt, bool n); static BasicString Format(const char* fmt, const char* from); - static BOOL Equals(const char* lhs, const char* rhs); + static Bool Equals(const char* lhs, const char* rhs); }; using BasicStringOr = ErrorOr<BasicString>; @@ -85,4 +85,4 @@ using BasicStringPtr = BasicString*; using BasicStringRef = Ref<BasicString>; } // namespace CompilerKit -#endif /* ifndef __NECTI_STRINGKIT__ */
\ No newline at end of file +#endif /* ifndef __NECTI_STRINGKIT__ */ diff --git a/dev/ThirdParty/Dialogs.h b/dev/ThirdParty/Dialogs.h index 84e239f..edaea92 100644 --- a/dev/ThirdParty/Dialogs.h +++ b/dev/ThirdParty/Dialogs.h @@ -1,5 +1,4 @@ -// -// Portable File Dialogs +//// Portable File Dialogs // // Copyright © 2018–2022 Sam Hocevar <sam@hocevar.net> // @@ -217,7 +216,7 @@ namespace internal { proc(dll const& lib, std::string const& sym) : m_proc(reinterpret_cast<T*>((void*) ::GetProcAddress(lib.handle, sym.c_str()))) {} - operator bool() const { return m_proc != nullptr; } + explicit operator bool() const { return m_proc != nullptr; } operator T*() const { return m_proc; } private: @@ -1736,4 +1735,4 @@ inline std::string select_folder::result() { #endif // PFD_SKIP_IMPLEMENTATION -} // namespace pfd
\ No newline at end of file +} // namespace pfd |
