From 72bc8f23d37c6efd68ad4a0f86ba87b6cd3db4d2 Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Thu, 26 Jan 2017 01:15:49 -0500 Subject: make scaninc build under GCC (#218) --- tools/scaninc/Makefile | 2 +- tools/scaninc/c_file.cpp | 4 ++-- tools/scaninc/c_file.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/scaninc/Makefile b/tools/scaninc/Makefile index 71c4389ef..c408e4a6e 100644 --- a/tools/scaninc/Makefile +++ b/tools/scaninc/Makefile @@ -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 diff --git a/tools/scaninc/c_file.cpp b/tools/scaninc/c_file.cpp index 4af741f6e..970fbe135 100644 --- a/tools/scaninc/c_file.cpp +++ b/tools/scaninc/c_file.cpp @@ -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; diff --git a/tools/scaninc/c_file.h b/tools/scaninc/c_file.h index fcd327d28..2503acac1 100644 --- a/tools/scaninc/c_file.h +++ b/tools/scaninc/c_file.h @@ -42,11 +42,11 @@ private: std::string m_path; std::set m_incbins; - void CFile::RemoveComments(); + void RemoveComments(); bool ConsumeHorizontalWhitespace(); bool ConsumeNewline(); void SkipWhitespace(); - std::unique_ptr CFile::ReadWholeFile(const std::string& path, int& size); + std::unique_ptr ReadWholeFile(const std::string& path, int& size); bool CheckIdentifier(const std::string& ident); void CheckIncbin(); }; -- cgit v1.2.3