diff options
author | Cameron Hall <camthesaxman@users.noreply.github.com> | 2017-01-24 19:50:28 -0600 |
---|---|---|
committer | YamaArashi <YamaArashi@users.noreply.github.com> | 2017-01-24 17:50:28 -0800 |
commit | 3f2ea6a1f076575d0c61ca0b71917704e38f6dd7 (patch) | |
tree | 84620f8bf433f86ba7b451b7f22c7f251802a4e9 | |
parent | c8542506580c0fa247bbb44c169a2cb1244577e4 (diff) |
make preproc build under GCC (#215)
-rw-r--r-- | tools/preproc/Makefile | 2 | ||||
-rw-r--r-- | tools/preproc/c_file.cpp | 4 | ||||
-rw-r--r-- | tools/preproc/c_file.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tools/preproc/Makefile b/tools/preproc/Makefile index 2d577c79f..24f60e3f6 100644 --- a/tools/preproc/Makefile +++ b/tools/preproc/Makefile @@ -1,6 +1,6 @@ CXX := g++ -CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch +CXXFLAGS := -std=c++14 -O2 -Wall -Wno-switch SRCS := asm_file.cpp c_file.cpp charmap.cpp preproc.cpp string_parser.cpp \ utf8.cpp diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index cd11c8f6d..3b4024efe 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -236,9 +236,9 @@ void CFile::TryConvertString() 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; diff --git a/tools/preproc/c_file.h b/tools/preproc/c_file.h index ddd57fd84..7369aba85 100644 --- a/tools/preproc/c_file.h +++ b/tools/preproc/c_file.h @@ -47,7 +47,7 @@ private: bool ConsumeNewline(); void SkipWhitespace(); void TryConvertString(); - 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 TryConvertIncbin(); void ReportDiagnostic(const char* type, const char* format, std::va_list args); |