mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-22 23:38:52 +00:00
Merge pull request #3494 from parnic/fix-vs2012-static-analysis
Fixed MS static analysis warnings
This commit is contained in:
@@ -210,7 +210,7 @@ inline void EnsureDirExists(const std::string &filepath) {
|
|||||||
auto parent = StripFileName(filepath);
|
auto parent = StripFileName(filepath);
|
||||||
if (parent.length()) EnsureDirExists(parent);
|
if (parent.length()) EnsureDirExists(parent);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
_mkdir(filepath.c_str());
|
(void)_mkdir(filepath.c_str());
|
||||||
#else
|
#else
|
||||||
mkdir(filepath.c_str(), S_IRWXU|S_IRGRP|S_IXGRP);
|
mkdir(filepath.c_str(), S_IRWXU|S_IRGRP|S_IXGRP);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ std::string Parser::TokenToStringId(int t) {
|
|||||||
// Parses exactly nibbles worth of hex digits into a number, or error.
|
// Parses exactly nibbles worth of hex digits into a number, or error.
|
||||||
CheckedError Parser::ParseHexNum(int nibbles, int64_t *val) {
|
CheckedError Parser::ParseHexNum(int nibbles, int64_t *val) {
|
||||||
for (int i = 0; i < nibbles; i++)
|
for (int i = 0; i < nibbles; i++)
|
||||||
if (!isxdigit(cursor_[i]))
|
if (!isxdigit(static_cast<const unsigned char>(cursor_[i])))
|
||||||
return Error("escape code must be followed by " + NumToString(nibbles) +
|
return Error("escape code must be followed by " + NumToString(nibbles) +
|
||||||
" hex digits");
|
" hex digits");
|
||||||
std::string target(cursor_, cursor_ + nibbles);
|
std::string target(cursor_, cursor_ + nibbles);
|
||||||
@@ -214,7 +214,7 @@ CheckedError Parser::Next() {
|
|||||||
case '{': case '}': case '(': case ')': case '[': case ']':
|
case '{': case '}': case '(': case ')': case '[': case ']':
|
||||||
case ',': case ':': case ';': case '=': return NoError();
|
case ',': case ':': case ';': case '=': return NoError();
|
||||||
case '.':
|
case '.':
|
||||||
if(!isdigit(*cursor_)) return NoError();
|
if(!isdigit(static_cast<const unsigned char>(*cursor_))) return NoError();
|
||||||
return Error("floating point constant can\'t start with \".\"");
|
return Error("floating point constant can\'t start with \".\"");
|
||||||
case '\"':
|
case '\"':
|
||||||
case '\'':
|
case '\'':
|
||||||
|
|||||||
Reference in New Issue
Block a user