make scaninc build under GCC (#218)

This commit is contained in:
Cameron Hall 2017-01-26 01:15:49 -05:00 committed by YamaArashi
parent 448acff16e
commit 72bc8f23d3
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
CXX = g++
CXXFLAGS = -Wall -std=c++11 -O2
CXXFLAGS = -Wall -std=c++14 -O2
SRCS = scaninc.cpp c_file.cpp asm_file.cpp

View File

@ -202,9 +202,9 @@ void CFile::SkipWhitespace()
bool CFile::CheckIdentifier(const std::string& ident)
{
int i;
unsigned int i;
for (i = 0; (unsigned)i < ident.length() && m_pos + i < m_size; i++)
for (i = 0; i < ident.length() && m_pos + i < (unsigned)m_size; i++)
if (ident[i] != m_buffer[m_pos + i])
return false;

View File

@ -42,11 +42,11 @@ private:
std::string m_path;
std::set<std::string> m_incbins;
void CFile::RemoveComments();
void RemoveComments();
bool ConsumeHorizontalWhitespace();
bool ConsumeNewline();
void SkipWhitespace();
std::unique_ptr<unsigned char[]> CFile::ReadWholeFile(const std::string& path, int& size);
std::unique_ptr<unsigned char[]> ReadWholeFile(const std::string& path, int& size);
bool CheckIdentifier(const std::string& ident);
void CheckIncbin();
};