!20158 fix codex issues 20210713 add "const" && fix snprintf_s

Merge pull request !20158 from ZeyangGAO/fixcodexbug
This commit is contained in:
i-robot 2021-07-14 06:06:18 +00:00 committed by Gitee
commit 6e1a0ca95b
16 changed files with 31 additions and 31 deletions

View File

@ -101,8 +101,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -63,8 +63,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput = outputs[i].Data();

View File

@ -64,8 +64,8 @@ std::vector<std::string> GetImagesById(const std::string &idFile, const std::str
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput = outputs[i].Data();

View File

@ -157,7 +157,7 @@ int main(int argc, char **argv) {
average = average/infer_cnt;
snprintf(tmpCh, sizeof(tmpCh), "NN inference cost average time: %4.3f ms of infer_count %d\n", average, infer_cnt);
snprintf_s(tmpCh, sizeof(tmpCh), "NN infer cost average time: %4.3f ms of infer_count %d\n", average, infer_cnt);
std::cout << "NN inference cost average time: "<< average << "ms of infer_count " << infer_cnt << std::endl;
std::string file_name = "./time_Result" + std::string("/test_perform_static.txt");
std::ofstream file_stream(file_name.c_str(), std::ios::trunc);

View File

@ -63,8 +63,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -101,8 +101,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -101,8 +101,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;

View File

@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
std::string homePath = "./result_Files";
int INVALID_POINTER = -1;
int ERROR = -2;
const int INVALID_POINTER = -1;
const int ERROR = -2;
for (size_t i = 0; i < outputs.size(); ++i) {
size_t outputSize;
std::shared_ptr<const void> netOutput;