Skip to content

Commit 3c47650

Browse files
Fix minor C++ warnings.
1 parent 0e1926f commit 3c47650

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

  • lib/mmsolverlibs/include/mmsolverlibs

lib/mmsolverlibs/include/mmsolverlibs/assert.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace assert {
116116
namespace {
117117

118118
std::string to_canonical_path(const char* input) {
119-
if (!input) {
119+
if (!static_cast<bool>(input)) {
120120
// Handle null pointer.
121121
return "";
122122
}
@@ -147,7 +147,7 @@ inline const char* get_relative_path(const char* file_path) {
147147
const std::string project_root_clean = to_canonical_path(project_root);
148148

149149
const size_t index = file_path_clean.find(project_root_clean);
150-
const bool found = index != file_path_clean.npos;
150+
const bool found = index != std::string::npos;
151151
if (!found && index == 0) {
152152
// Project root not found in path.
153153
return file_path;
@@ -164,17 +164,17 @@ inline void ostream_add_function_line(std::ostream& ostream, const char* file,
164164
}
165165

166166
inline void ostream_add_build_info_end(std::ostream& ostream) {
167-
const auto project_name = MMASSERT_PROJECT_NAME;
168-
const auto project_version = MMASSERT_PROJECT_VERSION;
169-
const auto system = MMASSERT_SYSTEM;
170-
const auto build_type = MMASSERT_BUILD_TYPE;
171-
const auto build_date_time = MMASSERT_BUILD_DATE_TIME;
172-
const auto git_branch = MMASSERT_GIT_BRANCH;
173-
const auto git_commit_hash_long = MMASSERT_GIT_COMMIT_HASH_LONG;
174-
const auto cmake_version = MMASSERT_CMAKE_VERSION;
175-
const auto cmake_generator = MMASSERT_CMAKE_GENERATOR;
176-
const auto cxx_compiler = MMASSERT_CXX_COMPILER;
177-
const auto cxx_linker = MMASSERT_CXX_LINKER;
167+
const auto* const project_name = MMASSERT_PROJECT_NAME;
168+
const auto* const project_version = MMASSERT_PROJECT_VERSION;
169+
const auto* const system = MMASSERT_SYSTEM;
170+
const auto* const build_type = MMASSERT_BUILD_TYPE;
171+
const auto* const build_date_time = MMASSERT_BUILD_DATE_TIME;
172+
const auto* const git_branch = MMASSERT_GIT_BRANCH;
173+
const auto* const git_commit_hash_long = MMASSERT_GIT_COMMIT_HASH_LONG;
174+
const auto* const cmake_version = MMASSERT_CMAKE_VERSION;
175+
const auto* const cmake_generator = MMASSERT_CMAKE_GENERATOR;
176+
const auto* const cxx_compiler = MMASSERT_CXX_COMPILER;
177+
const auto* const cxx_linker = MMASSERT_CXX_LINKER;
178178

179179
ostream << "- Project: " << project_name << "\n"
180180
<< "- Project Version: " << project_version << "\n"

0 commit comments

Comments
 (0)