Remove nolint comments (#7020)
* Remove nolint comments * Fixed comment
This commit is contained in:
parent
b1f009d470
commit
22f29f092c
@ -142,8 +142,6 @@ if (TBBBIND_2_4_FOUND)
|
||||
target_link_libraries(${TARGET_NAME}_obj PRIVATE ${TBBBIND_2_4_IMPORTED_TARGETS})
|
||||
endif()
|
||||
|
||||
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
|
||||
|
||||
# Create shared library file from object library
|
||||
|
||||
add_library(${TARGET_NAME} SHARED
|
||||
@ -152,6 +150,8 @@ add_library(${TARGET_NAME} SHARED
|
||||
${vs_version_file}
|
||||
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
|
||||
|
||||
add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${IE_STATIC_DEPENDENT_FILES} ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${PUBLIC_HEADERS})
|
||||
|
||||
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
|
||||
INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/openvino"
|
||||
ADDITIONAL_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
/**
|
||||
* @brief The PreAllocator class does not utilize this function
|
||||
*/
|
||||
void unlock(void*) noexcept override {} // NOLINT
|
||||
void unlock(void*) noexcept override {}
|
||||
|
||||
/**
|
||||
* @brief Returns a pointer to preallocated memory
|
||||
@ -55,7 +55,7 @@ public:
|
||||
* @brief The PreAllocator class cannot release the handle
|
||||
* @return false
|
||||
*/
|
||||
bool free(void*) noexcept override { // NOLINT
|
||||
bool free(void*) noexcept override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -119,7 +119,7 @@ IE_DO_PRAGMA(warning(disable : 1786))
|
||||
# else
|
||||
# define INFERENCE_PLUGIN_API(type) extern "C" type
|
||||
# endif
|
||||
#elif (__GNUC__ >= 4) // NOLINT
|
||||
#elif (__GNUC__ >= 4)
|
||||
# ifdef IMPLEMENT_INFERENCE_ENGINE_PLUGIN
|
||||
# define INFERENCE_PLUGIN_API(type) extern "C" __attribute__((visibility("default"))) type
|
||||
# else
|
||||
|
@ -439,7 +439,7 @@ struct ThrowNow final {
|
||||
#ifdef NDEBUG
|
||||
# define IE_ASSERT(EXPRESSION) \
|
||||
if (!(EXPRESSION)) \
|
||||
IE_THROW(GeneralError) << " AssertionFailed: " << #EXPRESSION // NOLINT
|
||||
IE_THROW(GeneralError) << " AssertionFailed: " << #EXPRESSION
|
||||
#else
|
||||
/**
|
||||
* @private
|
||||
|
@ -110,7 +110,7 @@ inline int parallel_get_env_threads() {
|
||||
}
|
||||
|
||||
#elif IE_THREAD == IE_THREAD_SEQ
|
||||
# include <algorithm> // NOLINT
|
||||
# include <algorithm>
|
||||
inline int parallel_get_env_threads() {
|
||||
return 1;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
template <class T,
|
||||
typename = typename std::enable_if<!std::is_same<typename std::decay<T>::type, Parameter>::value &&
|
||||
!std::is_abstract<typename std::decay<T>::type>::value>::type>
|
||||
Parameter(T&& parameter) { // NOLINT
|
||||
Parameter(T&& parameter) {
|
||||
static_assert(!std::is_same<typename std::decay<T>::type, Parameter>::value, "To prevent recursion");
|
||||
ptr = new RealData<typename std::decay<T>::type>(std::forward<T>(parameter));
|
||||
}
|
||||
@ -72,7 +72,7 @@ public:
|
||||
*
|
||||
* @param str char array
|
||||
*/
|
||||
Parameter(const char* str) : Parameter(std::string(str)) {} // NOLINT
|
||||
Parameter(const char* str) : Parameter(std::string(str)) {}
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
* @brief Constructor with specified precision
|
||||
* @param value A value of ePrecision to create an object from
|
||||
*/
|
||||
Precision(const Precision::ePrecision value) { // NOLINT
|
||||
Precision(const Precision::ePrecision value) {
|
||||
precisionInfo = getPrecisionInfo(value);
|
||||
}
|
||||
|
||||
|
@ -7,21 +7,22 @@
|
||||
#include <string>
|
||||
|
||||
#ifdef __MACH__
|
||||
#include <mach/clock.h>
|
||||
#include <mach/mach.h>
|
||||
# include <mach/clock.h>
|
||||
# include <mach/mach.h>
|
||||
#endif
|
||||
|
||||
#include <file_utils.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "ie_common.h"
|
||||
#ifndef _WIN32
|
||||
# include <dlfcn.h>
|
||||
# include <limits.h>
|
||||
# include <unistd.h>
|
||||
# include <dlfcn.h>
|
||||
# ifdef ENABLE_UNICODE_PATH_SUPPORT
|
||||
# include <locale>
|
||||
# include <codecvt>
|
||||
# include <locale>
|
||||
# endif
|
||||
#else
|
||||
# if defined(WINAPI_FAMILY) && !WINAPI_PARTITION_DESKTOP
|
||||
@ -35,62 +36,62 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <direct.h>
|
||||
# include <direct.h>
|
||||
|
||||
// Copied from linux libc sys/stat.h:
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
|
||||
|
||||
/// @brief Windows-specific 'mkdir' wrapper
|
||||
#define makedir(dir) _mkdir(dir)
|
||||
# define makedir(dir) _mkdir(dir)
|
||||
|
||||
/// @brief Max length of absolute file path
|
||||
#define MAX_ABS_PATH _MAX_PATH
|
||||
# define MAX_ABS_PATH _MAX_PATH
|
||||
/// @brief Get absolute file path, returns NULL in case of error
|
||||
#define get_absolute_path(result, path) _fullpath(result, path.c_str(), MAX_ABS_PATH)
|
||||
# define get_absolute_path(result, path) _fullpath(result, path.c_str(), MAX_ABS_PATH)
|
||||
|
||||
/// @brief Windows-specific 'stat' wrapper
|
||||
#define stat _stat
|
||||
# define stat _stat
|
||||
|
||||
#else
|
||||
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
|
||||
/// @brief mkdir wrapper
|
||||
#define makedir(dir) mkdir(dir, 0755)
|
||||
# define makedir(dir) mkdir(dir, 0755)
|
||||
|
||||
/// @brief Max length of absolute file path
|
||||
#define MAX_ABS_PATH PATH_MAX
|
||||
# define MAX_ABS_PATH PATH_MAX
|
||||
/// @brief Get absolute file path, returns NULL in case of error
|
||||
#define get_absolute_path(result, path) realpath(path.c_str(), result)
|
||||
# define get_absolute_path(result, path) realpath(path.c_str(), result)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_UNICODE_PATH_SUPPORT
|
||||
|
||||
std::string FileUtils::wStringtoMBCSstringChar(const std::wstring& wstr) {
|
||||
#ifdef _WIN32
|
||||
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL); // NOLINT
|
||||
# ifdef _WIN32
|
||||
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL);
|
||||
std::string strTo(size_needed, 0);
|
||||
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL); // NOLINT
|
||||
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL);
|
||||
return strTo;
|
||||
#else
|
||||
# else
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_decoder;
|
||||
return wstring_decoder.to_bytes(wstr);
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
std::wstring FileUtils::multiByteCharToWString(const char* str) {
|
||||
#ifdef _WIN32
|
||||
# ifdef _WIN32
|
||||
int strSize = static_cast<int>(std::strlen(str));
|
||||
int size_needed = MultiByteToWideChar(CP_UTF8, 0, str, strSize, NULL, 0);
|
||||
std::wstring wstrTo(size_needed, 0);
|
||||
MultiByteToWideChar(CP_UTF8, 0, str, strSize, &wstrTo[0], size_needed);
|
||||
return wstrTo;
|
||||
#else
|
||||
# else
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_encoder;
|
||||
std::wstring result = wstring_encoder.from_bytes(str);
|
||||
return result;
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif // ENABLE_UNICODE_PATH_SUPPORT
|
||||
@ -123,7 +124,7 @@ std::string FileUtils::absoluteFilePath(const std::string& filePath) {
|
||||
return absolutePath;
|
||||
}
|
||||
|
||||
bool FileUtils::directoryExists(const std::string &path) {
|
||||
bool FileUtils::directoryExists(const std::string& path) {
|
||||
struct stat sb;
|
||||
|
||||
if (stat(path.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
|
||||
@ -145,8 +146,7 @@ void FileUtils::createDirectoryRecursive(const std::string& dirPath) {
|
||||
int err = makedir(dirPath.c_str());
|
||||
if (err != 0 && errno != EEXIST) {
|
||||
// TODO: in case of exception it may be needed to remove all created sub-directories
|
||||
IE_THROW() << "Couldn't create directory ["
|
||||
<< dirPath << "], err=" << strerror(errno) << ")";
|
||||
IE_THROW() << "Couldn't create directory [" << dirPath << "], err=" << strerror(errno) << ")";
|
||||
}
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ namespace InferenceEngine {
|
||||
|
||||
namespace {
|
||||
|
||||
template <typename C, typename = InferenceEngine::details::enableIfSupportedChar<C> >
|
||||
template <typename C, typename = InferenceEngine::details::enableIfSupportedChar<C>>
|
||||
std::basic_string<C> getPathName(const std::basic_string<C>& s) {
|
||||
size_t i = s.rfind(FileUtils::FileTraits<C>::FileSeparator, s.length());
|
||||
if (i != std::string::npos) {
|
||||
@ -171,7 +171,8 @@ static std::string getIELibraryPathA() {
|
||||
CHAR ie_library_path[MAX_PATH];
|
||||
HMODULE hm = NULL;
|
||||
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
reinterpret_cast<LPSTR>(getIELibraryPath), &hm)) {
|
||||
reinterpret_cast<LPSTR>(getIELibraryPath),
|
||||
&hm)) {
|
||||
IE_THROW() << "GetModuleHandle returned " << GetLastError();
|
||||
}
|
||||
GetModuleFileNameA(hm, (LPSTR)ie_library_path, sizeof(ie_library_path));
|
||||
@ -187,7 +188,7 @@ static std::string getIELibraryPathA() {
|
||||
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
|
||||
std::string path = getPathName(std::string(result, (count > 0) ? count : 0));
|
||||
# endif // __APPLE__
|
||||
return FileUtils::makePath(path, std::string( "lib"));
|
||||
return FileUtils::makePath(path, std::string("lib"));
|
||||
# else
|
||||
Dl_info info;
|
||||
dladdr(reinterpret_cast<void*>(getIELibraryPath), &info);
|
||||
@ -201,20 +202,21 @@ static std::string getIELibraryPathA() {
|
||||
#ifdef ENABLE_UNICODE_PATH_SUPPORT
|
||||
|
||||
std::wstring getIELibraryPathW() {
|
||||
#ifdef _WIN32
|
||||
# ifdef _WIN32
|
||||
WCHAR ie_library_path[MAX_PATH];
|
||||
HMODULE hm = NULL;
|
||||
if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
reinterpret_cast<LPCWSTR>(getIELibraryPath), &hm)) {
|
||||
reinterpret_cast<LPCWSTR>(getIELibraryPath),
|
||||
&hm)) {
|
||||
IE_THROW() << "GetModuleHandle returned " << GetLastError();
|
||||
}
|
||||
GetModuleFileNameW(hm, (LPWSTR)ie_library_path, sizeof(ie_library_path) / sizeof(ie_library_path[0]));
|
||||
return getPathName(std::wstring(ie_library_path));
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
# elif defined(__linux__) || defined(__APPLE__)
|
||||
return ::FileUtils::multiByteCharToWString(getIELibraryPathA().c_str());
|
||||
#else
|
||||
# else
|
||||
# error "Unsupported OS"
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif // ENABLE_UNICODE_PATH_SUPPORT
|
||||
|
Loading…
Reference in New Issue
Block a user