- Add 'explicit' where needed
- Don't specify the return type of lambdas
- Verify that this != that before everything in the operator=
- Remove ';' in the comments to not fool the commented code detection mechanism
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
+
std::thread::id root_id;
static void ensure_root_tid() {
std::thread::id root_id;
static void ensure_root_tid() {
* The first step is to declare the code of your actors (what they do exactly does not matter to this example) and then
* you ask SimGrid to start your actors. There is three ways of doing so:
* - Directly, by instantiating your actor as parameter to Actor::create()
* The first step is to declare the code of your actors (what they do exactly does not matter to this example) and then
* you ask SimGrid to start your actors. There is three ways of doing so:
* - Directly, by instantiating your actor as parameter to Actor::create()
- * - By first registering your actors before instantiating it;
+ * - By first registering your actors before instantiating it
* - Through the deployment file.
*
* This example shows all these solutions, even if you obviously should use only one of these solutions to start your
* - Through the deployment file.
*
* This example shows all these solutions, even if you obviously should use only one of these solutions to start your
*
* For example, create a pure computation task (i.e., with no communication) like this:
*
*
* For example, create a pure computation task (i.e., with no communication) like this:
*
- * SD_task_schedule(task, my_host_count, my_host_list, my_flops_amount, SD_SCHED_NO_COST, my_rate);
+ * SD_task_schedule(task, my_host_count, my_host_list, my_flops_amount, SD_SCHED_NO_COST, my_rate)
*/
#define SD_SCHED_NO_COST NULL
*/
#define SD_SCHED_NO_COST NULL
-/* Copyright (c) 2016-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2016-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
* returns a `simgrid::kernel::Future<T>`. The kernel blocks the actor
* until the Future is ready and:
*
* returns a `simgrid::kernel::Future<T>`. The kernel blocks the actor
* until the Future is ready and:
*
- * - either returns the value wrapped in the future to the actor;
+ * - either returns the value wrapped in the future to the actor
*
* - or raises the exception stored in the future in the actor.
*
*
* - or raises the exception stored in the future in the actor.
*
}
string& operator=(string const& s)
{
}
string& operator=(string const& s)
{
- assign(s.c_str(), s.size());
+ if (this != &s)
+ assign(s.c_str(), s.size());
return *this;
}
string& operator=(std::string const& s)
return *this;
}
string& operator=(std::string const& s)
}
ChunkedData& operator=(ChunkedData const& that)
{
}
ChunkedData& operator=(ChunkedData const& that)
{
- this->clear();
- store_ = that.store_;
- pagenos_ = that.pagenos_;
- for (std::size_t const& pageno : pagenos_)
- store_->ref_page(pageno);
+ if (this != &that) {
+ this->clear();
+ store_ = that.store_;
+ pagenos_ = that.pagenos_;
+ for (std::size_t const& pageno : pagenos_)
+ store_->ref_page(pageno);
+ }
return *this;
}
ChunkedData& operator=(ChunkedData&& that)
return *this;
}
ChunkedData& operator=(ChunkedData&& that)
namespace xbt {
class XBT_PUBLIC OsSemaphore {
public:
namespace xbt {
class XBT_PUBLIC OsSemaphore {
public:
- inline OsSemaphore(unsigned int uiCount) : capa_(uiCount) {}
+ explicit inline OsSemaphore(unsigned int capa) : capa_(capa) {}
inline void acquire()
{
std::unique_lock<std::mutex> lock(mutex_);
inline void acquire()
{
std::unique_lock<std::mutex> lock(mutex_);
- condition_.wait(lock, [&]() -> bool { return capa_ > 0; });
+ condition_.wait(lock, [this]() { return capa_ > 0; });