From 35e4200d95d12030296f98acff463652904c052e Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sat, 20 Oct 2018 18:47:08 +0300 Subject: Fixed Linux build --- JSImpl/src/ASTPrinter.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'JSImpl/src/ASTPrinter.cpp') diff --git a/JSImpl/src/ASTPrinter.cpp b/JSImpl/src/ASTPrinter.cpp index 85bd9ab..b77f54c 100644 --- a/JSImpl/src/ASTPrinter.cpp +++ b/JSImpl/src/ASTPrinter.cpp @@ -1,6 +1,8 @@ #include "ASTPrinter.h" #include "Expression.h" +#include + ASTPrinter::ASTPrinter(std::ostream& os) : os(os) {} @@ -18,7 +20,7 @@ void Print(std::ostream& os, ASTPrinter &printer, const char* name, const Expres void Print(std::ostream& os, ASTPrinter &printer, const char* name, const IPLVector& list, bool isLast) { os << "\"" << name << "\" : [ \n"; - for (auto i = 0; i < list.size(); ++i) + for (auto i = 0u; i < list.size(); ++i) { list[i]->Accept(printer); if (i + 1 != list.size()) @@ -34,10 +36,10 @@ void Print(std::ostream& os, ASTPrinter &printer, const char* name, const IPLVec os << "\n"; } -void Print(std::ostream& os, ASTPrinter &printer, const char* name, const IPLVector& list, bool isLast) +void Print(std::ostream& os, ASTPrinter & /*printer*/, const char* name, const IPLVector& list, bool isLast) { os << "\"" << name << "\" : ["; - for (auto i = 0; i < list.size(); ++i) + for (auto i = 0u; i < list.size(); ++i) { os << "\"" << list[i] << "\""; if (i + 1 != list.size()) @@ -54,7 +56,7 @@ void Print(std::ostream& os, ASTPrinter &printer, const char* name, const IPLVec } template -void Print(std::ostream& os, ASTPrinter &printer, const char* name, T member, bool isLast) +void Print(std::ostream& os, ASTPrinter &/*printer*/, const char* name, T member, bool isLast) { os << "\"" << name << "\" :" << member; if (!isLast) @@ -65,7 +67,7 @@ void Print(std::ostream& os, ASTPrinter &printer, const char* name, T member, bo } template<> -void Print(std::ostream& os, ASTPrinter &printer, const char* name, IPLString member, bool isLast) +void Print(std::ostream& os, ASTPrinter &/*printer*/, const char* name, IPLString member, bool isLast) { os << "\"" << name << "\" : \"" << member << "\""; if (!isLast) @@ -76,7 +78,7 @@ void Print(std::ostream& os, ASTPrinter &printer, const char* name, I } template<> -void Print(std::ostream& os, ASTPrinter &printer, const char* name, const IPLString& member, bool isLast) +void Print(std::ostream& os, ASTPrinter &/*printer*/, const char* name, const IPLString& member, bool isLast) { os << "\"" << name << "\" : \"" << member << "\""; if (!isLast) @@ -191,6 +193,7 @@ std::ostream& operator<<(std::ostream& os, const TokenType& t) void ASTPrinter::Visit(ClassName* e) \ { \ int membersCount = 0, currentVisitCount = 0; \ + (void)currentVisitCount;(void)e; \ MEMBERS_ITERATOR(MEMBERS_COUNT); \ if(membersCount) \ os << "{\n \"ExpresionType\": \"" << #ClassName "\","<< '\n'; \ @@ -201,4 +204,4 @@ std::ostream& operator<<(std::ostream& os, const TokenType& t) } -EXPRESSION_DEFINITION_ITERATOR(GENERATE_AST_PRINTER_FUNCTION); \ No newline at end of file +EXPRESSION_DEFINITION_ITERATOR(GENERATE_AST_PRINTER_FUNCTION); -- cgit v1.3.1-23-gd82d