# HG changeset patch # User amazy # Date 1552411705 -3600 # Node ID 9e241cef32a4c02c8613ee550ca5691effc81b01 # Parent aa00a49444c6025a6cb5a3aa4a1e8fc1e3e7d66c fix warning diff -r aa00a49444c6 -r 9e241cef32a4 Resources/CodeGeneration/template.in.h.j2 --- a/Resources/CodeGeneration/template.in.h.j2 Tue Mar 12 15:02:05 2019 +0100 +++ b/Resources/CodeGeneration/template.in.h.j2 Tue Mar 12 18:28:25 2019 +0100 @@ -86,7 +86,7 @@ return result; } - inline std::string MakeIndent(int indent) + inline std::string MakeIndent(size_t indent) { char* txt = reinterpret_cast(malloc(indent+1)); // NO EXCEPTION BELOW!!!!!!!!!!!! for(size_t i = 0; i < indent; ++i) @@ -99,14 +99,14 @@ // generic dumper template - std::ostream& StoneDumpValue(std::ostream& out, const T& value, int indent) + std::ostream& StoneDumpValue(std::ostream& out, const T& value, size_t indent) { out << MakeIndent(indent) << value; return out; } // string dumper - inline std::ostream& StoneDumpValue(std::ostream& out, const std::string& value, int indent) + inline std::ostream& StoneDumpValue(std::ostream& out, const std::string& value, size_t indent) { out << MakeIndent(indent) << "\"" << value << "\""; return out; @@ -148,7 +148,7 @@ } template - std::ostream& StoneDumpValue(std::ostream& out, const std::map& value, int indent) + std::ostream& StoneDumpValue(std::ostream& out, const std::map& value, size_t indent) { out << MakeIndent(indent) << "{\n"; for (typename std::map::const_iterator it = value.cbegin(); @@ -188,7 +188,7 @@ } template - std::ostream& StoneDumpValue(std::ostream& out, const std::vector& value, int indent) + std::ostream& StoneDumpValue(std::ostream& out, const std::vector& value, size_t indent) { out << MakeIndent(indent) << "[\n"; for (size_t i = 0; i < value.size(); ++i) @@ -273,7 +273,7 @@ return Json::Value(strValue); } - inline std::ostream& StoneDumpValue(std::ostream& out, const {{enum['name']}}& value, int indent = 0) + inline std::ostream& StoneDumpValue(std::ostream& out, const {{enum['name']}}& value, size_t indent = 0) { {% for key in enum['fields']%} if( value == {{enum['name']}}_{{key}}) { @@ -311,7 +311,7 @@ return result; } - inline std::ostream& StoneDumpValue(std::ostream& out, const {{struct['name']}}& value, int indent = 0) + inline std::ostream& StoneDumpValue(std::ostream& out, const {{struct['name']}}& value, size_t indent = 0) { out << MakeIndent(indent) << "{\n"; {% if struct %}{% if struct['fields'] %}{% for key in struct['fields']%} out << MakeIndent(indent) << "{{key}}:\n";