A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use boost::lexical_cast instead of xbt_str_parse_* in C++ files.
[simgrid.git]
/
src
/
smpi
/
internals
/
smpi_replay.cpp
diff --git
a/src/smpi/internals/smpi_replay.cpp
b/src/smpi/internals/smpi_replay.cpp
index a51870665fe13758cc4415b1c3efee26204e1712..51e0992e623f92457f7068e4e46ec2b89cb562cd 100644
(file)
--- a/
src/smpi/internals/smpi_replay.cpp
+++ b/
src/smpi/internals/smpi_replay.cpp
@@
-15,6
+15,7
@@
#include "xbt/replay.hpp"
#include "xbt/str.h"
#include "xbt/replay.hpp"
#include "xbt/str.h"
+#include <boost/lexical_cast.hpp>
#include <cmath>
#include <limits>
#include <memory>
#include <cmath>
#include <limits>
#include <memory>
@@
-75,7
+76,11
@@
void log_timed_action(const simgrid::xbt::ReplayAction& action, double clock)
/* Helper functions */
static double parse_double(const std::string& string)
{
/* Helper functions */
static double parse_double(const std::string& string)
{
- return xbt_str_parse_double(string.c_str(), "not a double");
+ try {
+ return boost::lexical_cast<double>(string);
+ } catch (boost::bad_lexical_cast const&) {
+ throw std::invalid_argument("not a double: " + string);
+ }
}
template <typename T> static T parse_integer(const std::string& string)
}
template <typename T> static T parse_integer(const std::string& string)
@@
-564,7
+569,7
@@
void SleepAction::kernel(simgrid::xbt::ReplayAction&)
void LocationAction::kernel(simgrid::xbt::ReplayAction&)
{
const LocationParser& args = get_args();
void LocationAction::kernel(simgrid::xbt::ReplayAction&)
{
const LocationParser& args = get_args();
- smpi_trace_set_call_location(args.filename.c_str(), args.line, "");
+ smpi_trace_set_call_location(args.filename.c_str(), args.line, "
replay_action
");
}
void TestAction::kernel(simgrid::xbt::ReplayAction&)
}
void TestAction::kernel(simgrid::xbt::ReplayAction&)