From 61302ab3da72749ae0972c1d2fec766746737600 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Thu, 17 Sep 2015 14:26:05 +0200 Subject: [PATCH] [mc] Use string::compare instead of strcmp --- src/mc/mc_dwarf.hpp | 2 +- src/mc/mcer_ignore.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mc/mc_dwarf.hpp b/src/mc/mc_dwarf.hpp index 8e73e280e7..7cde115027 100644 --- a/src/mc/mc_dwarf.hpp +++ b/src/mc/mc_dwarf.hpp @@ -190,7 +190,7 @@ static inline 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/mc/mcer_ignore.cpp b/src/mc/mcer_ignore.cpp index 1233e9312f..f9cc9e7fe2 100644 --- a/src/mc/mcer_ignore.cpp +++ b/src/mc/mcer_ignore.cpp @@ -126,7 +126,7 @@ void MCer_ignore_global_variable(const char *name) while (start <= end) { unsigned int cursor = (start + end) / 2; simgrid::mc::Variable* current_var = &info->global_variables[cursor]; - int cmp = strcmp(current_var->name.c_str(), name); + int cmp = current_var->name.compare(name); if (cmp == 0) { info->global_variables.erase( info->global_variables.begin() + cursor); @@ -202,7 +202,7 @@ static void mc_ignore_local_variable_in_scope(const char *var_name, int cursor = (start + end) / 2; simgrid::mc::Variable* current_var = &scope->variables[cursor]; - int compare = strcmp(current_var->name.c_str(), var_name); + int compare = current_var->name.compare(var_name); if (compare == 0) { // Variable found, remove it: scope->variables.erase(scope->variables.begin() + cursor); -- 2.20.1