Do not buy secondary without enough money on not first round.

This commit is contained in:
jeefo 2019-09-05 10:44:08 +03:00
commit 9720a63401
4 changed files with 12 additions and 8 deletions

View file

@ -192,7 +192,9 @@ public:
class MemFile final : public DenyCopying {
private:
static constexpr char kEOF = static_cast <char> (-1);
enum : char {
Eof = static_cast <char> (-1)
};
private:
uint8 *m_data = nullptr;
@ -231,7 +233,7 @@ public:
char getChar () {
if (!m_data || m_pos >= m_length) {
return kEOF;
return Eof;
}
auto ch = m_data[m_pos];
++m_pos;
@ -266,7 +268,7 @@ public:
line.clear ();
char ch;
while ((ch = getChar ()) != kEOF) {
while ((ch = getChar ()) != Eof) {
line += ch;
if (ch == '\n') {

View file

@ -198,7 +198,9 @@ namespace detail {
// simple http client for downloading/uploading files only
class HttpClient final : public Singleton <HttpClient> {
private:
static constexpr int32 kMaxRecvErrors = 12;
enum : int32 {
MaxReceiveErrors = 12
};
private:
Socket m_socket;
@ -218,7 +220,7 @@ private:
// prase response header
while (!isFinished && pos < m_chunkSize) {
if (m_socket.recv (&buffer[pos], 1) < 1) {
if (++errors > kMaxRecvErrors) {
if (++errors > MaxReceiveErrors) {
isFinished = true;
}
else {