Fix old-style C-Casts

This commit is contained in:
Kai Wolf
2019-02-23 17:31:38 +01:00
parent ff22e75f95
commit b521719b6f
21 changed files with 103 additions and 105 deletions
+3 -3
View File
@@ -109,7 +109,7 @@ uint8_t ParsedJson::iterator::get_type() const {
int64_t ParsedJson::iterator::get_integer() const {
if(location + 1 >= tape_length) { return 0;// default value in case of error
}
return (int64_t) pj.tape[location + 1];
return static_cast<int64_t>(pj.tape[location + 1]);
}
double ParsedJson::iterator::get_double() const {
@@ -121,7 +121,7 @@ double ParsedJson::iterator::get_double() const {
}
const char * ParsedJson::iterator::get_string() const {
return (const char *)(pj.string_buf + (current_val & JSONVALUEMASK)) ;
return reinterpret_cast<const char *>(pj.string_buf + (current_val & JSONVALUEMASK)) ;
}
@@ -292,7 +292,7 @@ bool ParsedJson::iterator::print(std::ostream &os, bool escape_strings) const {
case '}': // we end an object
case '[': // we start an array
case ']': // we end an array
os << (char) current_type;
os << static_cast<char>(current_type);
break;
default:
return false;