diff --git a/parser/caffe/caffe_parser.h b/parser/caffe/caffe_parser.h index 8b08b9a..aeb07aa 100644 --- a/parser/caffe/caffe_parser.h +++ b/parser/caffe/caffe_parser.h @@ -57,7 +57,7 @@ static std::map, std::vector> params_share class PARSER_FUNC_VISIBILITY CaffeModelParser : public domi::ModelParser { public: CaffeModelParser() {} - virtual ~CaffeModelParser() override {} + ~CaffeModelParser() override {} /** * @ingroup domi_omg diff --git a/parser/common/acl_graph_parser_util.cc b/parser/common/acl_graph_parser_util.cc index 2721c01..f8e66d0 100644 --- a/parser/common/acl_graph_parser_util.cc +++ b/parser/common/acl_graph_parser_util.cc @@ -309,10 +309,10 @@ domi::Status AclGrphParseUtil::ParseAclOutputNodes(const string &out_nodes) { return PARAM_INVALID; } - auto iter = ge::GetParserContext().out_nodes_map.find(key_value_v[0]); + const auto iter = ge::GetParserContext().out_nodes_map.find(key_value_v[0]); int32_t index = stoi(StringUtils::Trim(key_value_v[1])); GELOGD("Get output info: node[%s] and index[%d]", key_value_v[0].c_str(), index); - if (iter != ge::GetParserContext().out_nodes_map.end()) { + if (iter != ge::GetParserContext().out_nodes_map.cend()) { iter->second.emplace_back(index); } else { std::vector index_v; @@ -943,7 +943,7 @@ FMK_FUNC_HOST_VISIBILITY bool ValidateStr(const std::string &filePath, const std regex_t reg; int cflags = REG_EXTENDED | REG_NOSUB; int ret = regcomp(®, mode.c_str(), cflags); - if (ret) { + if (ret != 0) { regerror(ret, ®, ebuff, kMaxBuffSize); GELOGW("regcomp failed, reason: %s", ebuff); regfree(®); @@ -951,7 +951,7 @@ FMK_FUNC_HOST_VISIBILITY bool ValidateStr(const std::string &filePath, const std } ret = regexec(®, filePath.c_str(), 0, nullptr, 0); - if (ret) { + if (ret != 0) { regerror(ret, ®, ebuff, kMaxBuffSize); GELOGE(ge::PARAM_INVALID, "[Invoke][RegExec] failed, reason: %s", ebuff); regfree(®); diff --git a/parser/common/model_saver.cc b/parser/common/model_saver.cc index 2963ad3..ae9d078 100644 --- a/parser/common/model_saver.cc +++ b/parser/common/model_saver.cc @@ -74,10 +74,9 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelSaver::SaveJsonToFi GELOGE(FAILED, "[Open][File] [%s] failed. %s", file_path, err_msg); return FAILED; } - const char *model_char = model_str.c_str(); uint32_t len = static_cast(model_str.length()); // Write data to file - mmSsize_t mmpa_ret = mmWrite(fd, const_cast((const void *)model_char), len); + mmSsize_t mmpa_ret = mmWrite(fd, const_cast(static_cast(model_str.c_str())), len); if (mmpa_ret == EN_ERROR || mmpa_ret == EN_INVALID_PARAM) { char_t err_buf[kMaxErrStrLen + 1U] = {}; const auto err_msg = mmGetErrorFormatMessage(mmGetErrorCode(), &err_buf[0], kMaxErrStrLen); @@ -176,4 +175,4 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int ModelSaver::CreateDirectory } } // namespace parser -} // namespace ge \ No newline at end of file +} // namespace ge