!10487 Fix warning info

From: @lizhenglong1992
Reviewed-by: @pandoublefeng,@heleiwang
Signed-off-by: @liucunwei
pull/10487/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 724ded7ad2

@ -24,7 +24,6 @@
#include <string>
#include <map>
#include <climits>
#include <string>
#include <iostream>
#include <memory>
#include "acl/acl.h"

@ -983,12 +983,6 @@ APP_ERROR DvppCommon::CombineJpegdProcess(const RawData &imageInfo, acldvppPixel
* @return: APP_ERR_OK if success, other values if failure
*/
APP_ERROR DvppCommon::TransferImageH2D(const RawData &imageInfo, const std::shared_ptr<DvppDataInfo> &jpegInput) {
// Check image buffer size validity
if (imageInfo.lenOfByte <= 0) {
MS_LOG(ERROR) << "The input buffer size on host should not be empty.";
return APP_ERR_COMM_INVALID_PARAM;
}
uint8_t *inDevBuff = nullptr;
APP_ERROR ret = acldvppMalloc((void **)&inDevBuff, imageInfo.lenOfByte);
if (ret != APP_ERR_OK) {

@ -37,14 +37,13 @@ std::string GetAppErrCodeInfo(const APP_ERROR err) {
}
}
void AssertErrorCode(const int code, const std::string file, const std::string function, const int line) {
void AssertErrorCode(const int code, const std::string &file, const std::string &function, const int line) {
if (code != APP_ERR_OK) {
MS_LOG(ERROR) << "Failed at " << file << "->" << function << "->" << line << ": error code=" << code;
exit(code);
}
}
void CheckErrorCode(const int code, const std::string file, const std::string function, const int line) {
void CheckErrorCode(const int code, const std::string &file, const std::string &function, const int line) {
if (code != APP_ERR_OK) {
MS_LOG(ERROR) << "Failed at " << file << "->" << function << "->" << line << ": error code=" << code;
}

@ -249,8 +249,8 @@ const std::string APP_ERR_FACE_LOG_STRING[] = {
};
std::string GetAppErrCodeInfo(APP_ERROR err);
void AssertErrorCode(const int code, const std::string file, const std::string function, const int line);
void CheckErrorCode(const int code, const std::string file, const std::string function, const int line);
void AssertErrorCode(const int code, const std::string &file, const std::string &function, const int line);
void CheckErrorCode(const int code, const std::string &file, const std::string &function, const int line);
#define RtAssert(code) AssertErrorCode(code, __FILE__, __FUNCTION__, __LINE__);
#define RtCheckError(code) CheckErrorCode(code, __FILE__, __FUNCTION__, __LINE__);

@ -29,15 +29,15 @@ std::shared_ptr<ResourceManager> ResourceManager::ptr_ = nullptr;
*/
APP_ERROR ExistFile(const std::string &filePath) {
struct stat fileSat = {0};
char c[PATH_MAX + 1] = {0x00};
size_t count = filePath.copy(c, PATH_MAX + 1);
char c[PATH_MAX_ASCEND + 1] = {0x00};
size_t count = filePath.copy(c, PATH_MAX_ASCEND + 1);
if (count != filePath.length()) {
MS_LOG(ERROR) << "Failed to strcpy" << c;
return APP_ERR_COMM_FAILURE;
}
// Get the absolute path of input directory
char path[PATH_MAX + 1] = {0x00};
if ((strlen(c) > PATH_MAX) || (realpath(c, path) == nullptr)) {
char path[PATH_MAX_ASCEND + 1] = {0x00};
if ((strlen(c) > PATH_MAX_ASCEND) || (realpath(c, path) == nullptr)) {
MS_LOG(ERROR) << "Failed to get canonicalize path";
return APP_ERR_COMM_EXIST;
}

@ -29,7 +29,7 @@
#include "mindspore/core/utils/log_adapter.h"
#include "mindspore/ccsrc/cxx_api/graph/acl/acl_env_guard.h"
#define PATH_MAX 4096
#define PATH_MAX_ASCEND 4096
enum ModelLoadMethod {
LOAD_FROM_FILE = 0, // Loading from file, memory of model and weights are managed by ACL

Loading…
Cancel
Save