From: Arnaud Giersch Date: Mon, 25 Mar 2019 10:13:25 +0000 (+0100) Subject: Use string::compare with C++ strings. X-Git-Tag: v3_22~37 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5fd5c2b8932f9288216e47e78580d31aca2892a1 Use string::compare with C++ strings. --- diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 40d650aef5..ec22c9a71e 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -447,7 +447,7 @@ static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit) static bool MC_compare_variable( simgrid::mc::Variable const& a, simgrid::mc::Variable const& b) { - int cmp = strcmp(a.name.c_str(), b.name.c_str()); + int cmp = a.name.compare(b.name); if (cmp < 0) return true; else if (cmp > 0) diff --git a/src/plugins/file_system/s4u_FileSystem.cpp b/src/plugins/file_system/s4u_FileSystem.cpp index 74227e3c83..b28d3d846f 100644 --- a/src/plugins/file_system/s4u_FileSystem.cpp +++ b/src/plugins/file_system/s4u_FileSystem.cpp @@ -193,7 +193,7 @@ sg_size_t File::tell() void File::move(const std::string& fullpath) { /* Check if the new full path is on the same mount point */ - if (not strncmp(mount_point_.c_str(), fullpath.c_str(), mount_point_.length())) { + if (fullpath.compare(0, mount_point_.length(), mount_point_) == 0) { std::map* content = local_storage_->extension()->get_content(); auto sz = content->find(path_); if (sz != content->end()) { // src file exists