mirror of https://github.com/AxioDL/kabufuda.git
Merge pull request #13 from lioncash/explicit
General: Use explicit where applicable
This commit is contained in:
commit
d48ba9523f
|
@ -28,7 +28,7 @@ class AsyncIO {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AsyncIO() = default;
|
AsyncIO() = default;
|
||||||
AsyncIO(SystemStringView filename, bool truncate = false);
|
explicit AsyncIO(SystemStringView filename, bool truncate = false);
|
||||||
~AsyncIO();
|
~AsyncIO();
|
||||||
AsyncIO(AsyncIO&& other);
|
AsyncIO(AsyncIO&& other);
|
||||||
AsyncIO& operator=(AsyncIO&& other);
|
AsyncIO& operator=(AsyncIO&& other);
|
||||||
|
@ -41,9 +41,9 @@ public:
|
||||||
ECardResult pollStatus() const;
|
ECardResult pollStatus() const;
|
||||||
void waitForCompletion() const;
|
void waitForCompletion() const;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
operator bool() const { return m_fd != -1; }
|
explicit operator bool() const { return m_fd != -1; }
|
||||||
#else
|
#else
|
||||||
operator bool() const { return m_fh != INVALID_HANDLE_VALUE; }
|
explicit operator bool() const { return m_fh != INVALID_HANDLE_VALUE; }
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -17,14 +17,14 @@ namespace kabufuda {
|
||||||
|
|
||||||
class FileHandle {
|
class FileHandle {
|
||||||
friend class Card;
|
friend class Card;
|
||||||
uint32_t idx = -1;
|
uint32_t idx = UINT32_MAX;
|
||||||
int32_t offset = 0;
|
int32_t offset = 0;
|
||||||
FileHandle(uint32_t idx) : idx(idx) {}
|
explicit FileHandle(uint32_t idx) : idx(idx) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FileHandle() = default;
|
FileHandle() = default;
|
||||||
uint32_t getFileNo() const { return idx; }
|
uint32_t getFileNo() const { return idx; }
|
||||||
operator bool() const { return getFileNo() != UINT32_MAX; }
|
explicit operator bool() const { return getFileNo() != UINT32_MAX; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ProbeResults {
|
struct ProbeResults {
|
||||||
|
@ -136,7 +136,7 @@ public:
|
||||||
* @param game The game code.
|
* @param game The game code.
|
||||||
* @param maker The maker code.
|
* @param maker The maker code.
|
||||||
*/
|
*/
|
||||||
Card(const char* game = nullptr, const char* maker = nullptr);
|
explicit Card(const char* game = nullptr, const char* maker = nullptr);
|
||||||
~Card();
|
~Card();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -489,6 +489,6 @@ public:
|
||||||
/**
|
/**
|
||||||
* @return Whether or not the card is within a ready state.
|
* @return Whether or not the card is within a ready state.
|
||||||
*/
|
*/
|
||||||
operator bool() const { return getError() == ECardResult::READY; }
|
explicit operator bool() const { return getError() == ECardResult::READY; }
|
||||||
};
|
};
|
||||||
} // namespace kabufuda
|
} // namespace kabufuda
|
||||||
|
|
Loading…
Reference in New Issue