Fix warnings (VS2017 x64). (#133)

* Fix warnings (VS2017 x64).

* Update single_include/inja.hpp.
This commit is contained in:
Christof Krüger
2020-01-27 22:52:43 +01:00
committed by pantor
parent 652e378dd9
commit 3f071a2aac
4 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -297,7 +297,7 @@ class Parser {
}
// update all previous unconditional jumps to here
for (unsigned int i: if_data.uncond_jumps) {
for (size_t i: if_data.uncond_jumps) {
tmpl.bytecodes[i].args = tmpl.bytecodes.size();
}
@@ -530,7 +530,7 @@ class Parser {
const ParserStatic& m_static;
struct IfData {
using jump_t = unsigned int;
using jump_t = size_t;
jump_t prev_cond_jump;
std::vector<jump_t> uncond_jumps;
@@ -541,7 +541,7 @@ class Parser {
};
std::vector<IfData> m_if_stack;
std::vector<unsigned int> m_loop_stack;
std::vector<size_t> m_loop_stack;
void get_next_token() {
if (m_have_peek_tok) {
+1 -1
View File
@@ -224,7 +224,7 @@ class Renderer {
case Bytecode::Op::Length: {
const json& val = *get_args(bc)[0];
int result;
size_t result;
if (val.is_string()) {
result = val.get_ref<const std::string&>().length();
} else {
+1 -1
View File
@@ -23,7 +23,7 @@ inline std::ifstream open_file_or_throw(const std::string& path) {
file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
try {
file.open(path);
} catch(const std::ios_base::failure& e) {
} catch(const std::ios_base::failure& /*e*/) {
inja_throw("file_error", "failed accessing file at '" + path + "'");
}
return file;
+5 -5
View File
@@ -1945,7 +1945,7 @@ inline std::ifstream open_file_or_throw(const std::string& path) {
file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
try {
file.open(path);
} catch(const std::ios_base::failure& e) {
} catch(const std::ios_base::failure& /*e*/) {
inja_throw("file_error", "failed accessing file at '" + path + "'");
}
return file;
@@ -2589,7 +2589,7 @@ class Parser {
}
// update all previous unconditional jumps to here
for (unsigned int i: if_data.uncond_jumps) {
for (size_t i: if_data.uncond_jumps) {
tmpl.bytecodes[i].args = tmpl.bytecodes.size();
}
@@ -2822,7 +2822,7 @@ class Parser {
const ParserStatic& m_static;
struct IfData {
using jump_t = unsigned int;
using jump_t = size_t;
jump_t prev_cond_jump;
std::vector<jump_t> uncond_jumps;
@@ -2833,7 +2833,7 @@ class Parser {
};
std::vector<IfData> m_if_stack;
std::vector<unsigned int> m_loop_stack;
std::vector<size_t> m_loop_stack;
void get_next_token() {
if (m_have_peek_tok) {
@@ -3142,7 +3142,7 @@ class Renderer {
case Bytecode::Op::Length: {
const json& val = *get_args(bc)[0];
int result;
size_t result;
if (val.is_string()) {
result = val.get_ref<const std::string&>().length();
} else {