From: Martin Quinson Date: Mon, 24 Jul 2017 20:33:30 +0000 (+0200) Subject: cosmetics in instr: use sensible identifier names X-Git-Tag: v3_17~322^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ff8cc1407a3ae6159a92caa86472cb669062f3bb cosmetics in instr: use sensible identifier names --- diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 7c17b8434e..726b68ac9c 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -196,7 +196,7 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar mark_color = white; XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color); - s_val rett(mark_value, mark_color, type); + value rett(mark_value, mark_color, type); } /** \ingroup TRACE_mark @@ -247,9 +247,8 @@ void TRACE_mark(const char *mark_type, const char *mark_value) THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type); } - val_t value = s_val::PJ_value_get (mark_value, type); XBT_DEBUG("MARK %s %s", mark_type, mark_value); - new NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value); + new NewEvent(MSG_get_clock(), PJ_container_get_root(), type, value::get(mark_value, type)); } /** \ingroup TRACE_mark @@ -946,11 +945,12 @@ void TRACE_host_state_declare_value (const char *state, const char *value, const * * \see TRACE_host_state_declare, TRACE_host_push_state, TRACE_host_pop_state, TRACE_host_reset_state */ -void TRACE_host_set_state (const char *host, const char *state, const char *value) +void TRACE_host_set_state(const char* host, const char* state, const char* value_str) { container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); - val_t val = s_val::PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ + value* val = + value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ new SetStateEvent(MSG_get_clock(), container, type, val); } @@ -965,11 +965,12 @@ void TRACE_host_set_state (const char *host, const char *state, const char *valu * * \see TRACE_host_state_declare, TRACE_host_set_state, TRACE_host_pop_state, TRACE_host_reset_state */ -void TRACE_host_push_state (const char *host, const char *state, const char *value) +void TRACE_host_push_state(const char* host, const char* state, const char* value_str) { container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); - val_t val = s_val::PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ + value* val = + value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ new PushStateEvent(MSG_get_clock(), container, type, val); } diff --git a/src/instr/instr_paje_trace.cpp b/src/instr/instr_paje_trace.cpp index cfaf78f6fe..c7c4f7c168 100644 --- a/src/instr/instr_paje_trace.cpp +++ b/src/instr/instr_paje_trace.cpp @@ -284,16 +284,16 @@ if (instr_fmt_type == instr_fmt_paje) { } } -void LogEntityValue (val_t value) +void LogEntityValue(value* val) { XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue); //print it if (instr_fmt_type == instr_fmt_paje) { stream << std::fixed << std::setprecision(TRACE_precision()); stream << PAJE_DefineEntityValue; - stream << " " << value->id << " " << value->father->id << " " << value->name; - if (value->color) - stream << " \"" << value->color << "\""; + stream << " " << val->id << " " << val->father->id << " " << val->name; + if (val->color) + stream << " \"" << val->color << "\""; print_row(); } else if (instr_fmt_type == instr_fmt_TI) { /* Nothing to do */ @@ -467,13 +467,13 @@ void SubVariableEvent::print() { } } -SetStateEvent::SetStateEvent (double timestamp, container_t container, type_t type, val_t value) +SetStateEvent::SetStateEvent(double timestamp, container_t container, type_t type, value* val) { this->event_type = PAJE_SetState; this->timestamp = timestamp; this->type = type; this->container = container; - this->value = value; + this->val = val; #if HAVE_SMPI if (xbt_cfg_get_boolean("smpi/trace-call-location")) { @@ -495,7 +495,7 @@ void SetStateEvent::print() { stream << (int)this->event_type; print_timestamp(this); stream << " " << type->id << " " << container->id; - stream << " " << value->id; + stream << " " << val->id; #if HAVE_SMPI if (xbt_cfg_get_boolean("smpi/trace-call-location")) { stream << " \"" << filename << "\" " << linenumber; @@ -509,13 +509,13 @@ void SetStateEvent::print() { } } -PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value, void* extra) +PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra) { this->event_type = PAJE_PushState; this->timestamp = timestamp; this->type = type; this->container = container; - this->value = value; + this->val = val; this->extra_ = extra; #if HAVE_SMPI @@ -531,8 +531,8 @@ PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t insert_into_buffer (this); } -PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value) - : PushStateEvent(timestamp, container, type, value, nullptr) +PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val) + : PushStateEvent(timestamp, container, type, val, nullptr) {} void PushStateEvent::print() { if (instr_fmt_type == instr_fmt_paje) { @@ -541,7 +541,7 @@ void PushStateEvent::print() { stream << (int)this->event_type; print_timestamp(this); stream << " " << type->id << " " << container->id; - stream << " " << value->id; + stream << " " << val->id; if (TRACE_display_sizes()) { stream << " "; @@ -680,7 +680,7 @@ void PushStateEvent::print() { case TRACING_SSEND: case TRACING_ISSEND: default: - XBT_WARN("Call from %s impossible to translate into replay command : Not implemented (yet)", value->name); + XBT_WARN("Call from %s impossible to translate into replay command : Not implemented (yet)", val->name); break; } @@ -837,13 +837,13 @@ void EndLinkEvent::print() { } } -NewEvent::NewEvent (double timestamp, container_t container, type_t type, val_t value) +NewEvent::NewEvent(double timestamp, container_t container, type_t type, value* val) { this->event_type = PAJE_NewEvent; this->timestamp = timestamp; this->type = type; this->container = container; - this->value = value; + this->val = val; XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp); @@ -856,7 +856,7 @@ void NewEvent::print () { stream << std::fixed << std::setprecision(TRACE_precision()); stream << (int)this->event_type; print_timestamp(this); - stream << " " << type->id << " " << container->id << " " << value->id; + stream << " " << type->id << " " << container->id << " " << val->id; print_row(); } else if (instr_fmt_type == instr_fmt_TI) { /* Nothing to do */ diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 872e8902b8..494ef42947 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -47,15 +47,15 @@ static type_t newType (const char *typeNameBuff, const char *key, const char *co void PJ_type_free (type_t type) { - val_t value; + value* val; char *value_name; xbt_dict_cursor_t cursor = nullptr; - xbt_dict_foreach(type->values, cursor, value_name, value) { - XBT_DEBUG("free value %s, child of %s", value->name, value->father->name); - xbt_free(value->name); - xbt_free(value->color); - xbt_free(value->id); - xbt_free(value); + xbt_dict_foreach (type->values, cursor, value_name, val) { + XBT_DEBUG("free value %s, child of %s", val->name, val->father->name); + xbt_free(val->name); + xbt_free(val->color); + xbt_free(val->id); + xbt_free(val); } xbt_dict_free (&type->values); xbt_free (type->name); diff --git a/src/instr/instr_paje_values.cpp b/src/instr/instr_paje_values.cpp index 10060e234f..0eaefe26fe 100644 --- a/src/instr/instr_paje_values.cpp +++ b/src/instr/instr_paje_values.cpp @@ -10,11 +10,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)"); -s_val::s_val(const char *name, const char *color, type_t father){ +value::value(const char* name, const char* color, type_t father) +{ if (name == nullptr || father == nullptr){ THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)"); } - this->ret = xbt_new0(s_val, 1); + this->ret = xbt_new0(value, 1); this->ret->name = xbt_strdup (name); this->ret->father = father; this->ret->color = xbt_strdup (color); @@ -28,20 +29,20 @@ s_val::s_val(const char *name, const char *color, type_t father){ LogEntityValue(this->ret); }; -val_t s_val::PJ_value_get_or_new (const char *name, const char *color, type_t father) +value* value::get_or_new(const char* name, const char* color, type_t father) { - val_t ret = 0; + value* ret = 0; try { - ret = s_val::PJ_value_get(name, father); + ret = value::get(name, father); } catch(xbt_ex& e) { - s_val rett(name, color, father); + value rett(name, color, father); ret = rett.ret; } return ret; } -val_t s_val::PJ_value_get (const char *name, type_t father) +value* value::get(const char* name, type_t father) { if (name == nullptr || father == nullptr){ THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)"); @@ -49,7 +50,7 @@ val_t s_val::PJ_value_get (const char *name, type_t father) if (father->kind == TYPE_VARIABLE) THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name); - val_t ret = (val_t)xbt_dict_get_or_null (father->values, name); + value* ret = (value*)xbt_dict_get_or_null(father->values, name); if (ret == nullptr) { THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name); } diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 17f635ca28..a15dc2b6f2 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -72,19 +72,16 @@ class s_type { typedef s_type s_type_t; //-------------------------------------------------- -class s_val; -typedef s_val *val_t; - -class s_val { - public: +class value { +public: char *id; char *name; char *color; type_t father; - val_t ret; - s_val(const char *name, const char *color, type_t father); - static val_t PJ_value_get_or_new (const char *name, const char *color, type_t father); - static val_t PJ_value_get (const char *name, type_t father); + value* ret; + value(const char* name, const char* color, type_t father); + static value* get_or_new(const char* name, const char* color, type_t father); + static value* get(const char* name, type_t father); }; @@ -185,12 +182,12 @@ class SetStateEvent : public PajeEvent { private: container_t container; type_t type; - val_t value; + value* val; const char* filename; int linenumber; public: - SetStateEvent (double timestamp, container_t container, type_t type, val_t value); - void print() override; + SetStateEvent(double timestamp, container_t container, type_t type, value* val); + void print() override; }; @@ -198,16 +195,15 @@ class PushStateEvent : public PajeEvent { public: container_t container; type_t type; - val_t value; + value* val; int size; const char* filename; int linenumber; void* extra_; public: - PushStateEvent (double timestamp, container_t container, type_t type, val_t value); - PushStateEvent (double timestamp, container_t container, type_t type, val_t value, - void* extra); - void print() override; + PushStateEvent(double timestamp, container_t container, type_t type, value* val); + PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra); + void print() override; }; class PopStateEvent : public PajeEvent { @@ -261,9 +257,10 @@ class NewEvent : public PajeEvent { public: container_t container; type_t type; - val_t value; - public: - NewEvent (double timestamp, container_t container, type_t type, val_t value); + value* val; + +public: + NewEvent(double timestamp, container_t container, type_t type, value* val); void print() override; }; @@ -433,7 +430,7 @@ void DefineContainerEvent(type_t type); void LogVariableTypeDefinition(type_t type); void LogStateTypeDefinition(type_t type); void LogLinkTypeDefinition(type_t type, type_t source, type_t dest); -void LogEntityValue (val_t value); +void LogEntityValue(value* val); void LogContainerCreation (container_t container); void LogContainerDestruction (container_t container); void LogDefineEventType(type_t type); diff --git a/src/msg/instr_msg_process.cpp b/src/msg/instr_msg_process.cpp index b0ad4301b0..3ce2884820 100644 --- a/src/msg/instr_msg_process.cpp +++ b/src/msg/instr_msg_process.cpp @@ -94,8 +94,8 @@ void TRACE_msg_process_suspend(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = s_val::PJ_value_get ("suspend", type); - new PushStateEvent (MSG_get_clock(), process_container, type, value); + value* val = value::get("suspend", type); + new PushStateEvent(MSG_get_clock(), process_container, type, val); } } @@ -119,8 +119,8 @@ void TRACE_msg_process_sleep_in(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = s_val::PJ_value_get ("sleep", type); - new PushStateEvent (MSG_get_clock(), process_container, type, value); + value* val = value::get("sleep", type); + new PushStateEvent(MSG_get_clock(), process_container, type, val); } } diff --git a/src/msg/instr_msg_task.cpp b/src/msg/instr_msg_task.cpp index c1190d81f2..1ac51f1190 100644 --- a/src/msg/instr_msg_task.cpp +++ b/src/msg/instr_msg_task.cpp @@ -54,8 +54,8 @@ void TRACE_msg_task_execute_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = s_val::PJ_value_get ("task_execute", type); - new PushStateEvent (MSG_get_clock(), process_container, type, value); + value* val = value::get("task_execute", type); + new PushStateEvent(MSG_get_clock(), process_container, type, val); } } @@ -94,8 +94,8 @@ void TRACE_msg_task_get_start() container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = s_val::PJ_value_get ("receive", type); - new PushStateEvent (MSG_get_clock(), process_container, type, value); + value* val = value::get("receive", type); + new PushStateEvent(MSG_get_clock(), process_container, type, val); } } @@ -129,8 +129,8 @@ int TRACE_msg_task_put_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = s_val::PJ_value_get ("send", type); - new PushStateEvent (MSG_get_clock(), process_container, type, value); + value* val = value::get("send", type); + new PushStateEvent(MSG_get_clock(), process_container, type, val); char key[INSTR_DEFAULT_STR_SIZE]; snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter); diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index f82eb1180e..99a3c5d15a 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -215,8 +215,8 @@ void MSG_vm_start(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type); - val_t value = s_val::PJ_value_get_or_new("start", "0 0 1", type); // start is blue - new PushStateEvent(MSG_get_clock(), vm_container, type, value); + value* val = value::get_or_new("start", "0 0 1", type); // start is blue + new PushStateEvent(MSG_get_clock(), vm_container, type, val); } } @@ -815,8 +815,8 @@ void MSG_vm_suspend(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type); - val_t value = s_val::PJ_value_get_or_new("suspend", "1 0 0", type); // suspend is red - new PushStateEvent(MSG_get_clock(), vm_container, type, value); + value* val = value::get_or_new("suspend", "1 0 0", type); // suspend is red + new PushStateEvent(MSG_get_clock(), vm_container, type, val); } } diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index e3367854b2..017e61e077 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -22,8 +22,8 @@ } \ char cont_name[25]; \ snprintf(cont_name, 25, "rank-%d", smpi_process()->index()); \ - val_t value = s_val::PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \ - new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, value); \ + value* val = value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \ + new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val); \ } #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2) \ diff --git a/src/smpi/internals/instr_smpi.cpp b/src/smpi/internals/instr_smpi.cpp index 0eeccfa8da..52e6e4bb15 100644 --- a/src/smpi/internals/instr_smpi.cpp +++ b/src/smpi/internals/instr_smpi.cpp @@ -245,8 +245,8 @@ void TRACE_smpi_collective_in(int rank, const char *operation, instr_extra_data container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color (operation); - val_t value = s_val::PJ_value_get_or_new (operation, color, type); - new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + value* val = value::get_or_new(operation, color, type); + new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } void TRACE_smpi_collective_out(int rank, const char *operation) @@ -273,8 +273,7 @@ void TRACE_smpi_computing_init(int rank) container_t container = PJ_container_get(str); type_t type = PJ_type_get("MPI_STATE", container->type); const char* color = instr_find_color("computing"); - val_t value = s_val::PJ_value_get_or_new("computing", color, type); - new PushStateEvent(SIMIX_get_clock(), container, type, value); + new PushStateEvent(SIMIX_get_clock(), container, type, value::get_or_new("computing", color, type)); } void TRACE_smpi_computing_in(int rank, instr_extra_data extra) @@ -289,8 +288,8 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - val_t value = s_val::PJ_value_get_or_new ("computing", nullptr, type); - new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + value* val = value::get_or_new("computing", nullptr, type); + new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } void TRACE_smpi_computing_out(int rank) @@ -315,8 +314,8 @@ void TRACE_smpi_sleeping_init(int rank) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color ("sleeping"); - val_t value = s_val::PJ_value_get_or_new ("sleeping", color, type); - new PushStateEvent (SIMIX_get_clock(), container, type, value); + value* val = value::get_or_new("sleeping", color, type); + new PushStateEvent(SIMIX_get_clock(), container, type, val); } void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) @@ -331,8 +330,8 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - val_t value = s_val::PJ_value_get_or_new ("sleeping", nullptr, type); - new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + value* val = value::get_or_new("sleeping", nullptr, type); + new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } void TRACE_smpi_sleeping_out(int rank) @@ -358,8 +357,8 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - val_t value = s_val::PJ_value_get_or_new ("test", nullptr, type); - new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + value* val = value::get_or_new("test", nullptr, type); + new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } void TRACE_smpi_testing_out(int rank) @@ -385,8 +384,8 @@ void TRACE_smpi_ptp_in(int rank, const char *operation, instr_extra_data extra) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color (operation); - val_t value = s_val::PJ_value_get_or_new (operation, color, type); - new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + value* val = value::get_or_new(operation, color, type); + new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } void TRACE_smpi_ptp_out(int rank, int dst, const char *operation) diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index fab1c56f42..588afb731b 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -267,11 +267,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (msg_process == nullptr){ msg_process = PJ_type_container_new("MSG_PROCESS", container->type); type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process); - s_val PJ_value("suspend", "1 0 1", state); - s_val::PJ_value_get_or_new("sleep", "1 1 0", state); - s_val::PJ_value_get_or_new("receive", "1 0 0", state); - s_val::PJ_value_get_or_new("send", "0 0 1", state); - s_val::PJ_value_get_or_new("task_execute", "0 1 1", state); + value PJ_value("suspend", "1 0 1", state); + value::get_or_new("sleep", "1 1 0", state); + value::get_or_new("receive", "1 0 0", state); + value::get_or_new("send", "0 0 1", state); + value::get_or_new("task_execute", "0 1 1", state); PJ_type_link_new ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process); PJ_type_link_new ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process); } @@ -282,11 +282,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (msg_vm == nullptr){ msg_vm = PJ_type_container_new("MSG_VM", container->type); type_t state = PJ_type_state_new ("MSG_VM_STATE", msg_vm); - s_val PJ_value("suspend", "1 0 1", state); - s_val::PJ_value_get_or_new ("sleep", "1 1 0", state); - s_val::PJ_value_get_or_new ("receive", "1 0 0", state); - s_val::PJ_value_get_or_new ("send", "0 0 1", state); - s_val::PJ_value_get_or_new ("task_execute", "0 1 1", state); + value PJ_value("suspend", "1 0 1", state); + value::get_or_new("sleep", "1 1 0", state); + value::get_or_new("receive", "1 0 0", state); + value::get_or_new("send", "0 0 1", state); + value::get_or_new("task_execute", "0 1 1", state); PJ_type_link_new ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm); PJ_type_link_new ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm); } @@ -400,16 +400,16 @@ void instr_new_user_state_type (const char *father_type, const char *new_typenam recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root()); } -static void recursiveNewValueForUserStateType (const char *type_name, const char *value, const char *color, type_t root) +static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, type_t root) { if (not strcmp(root->name, type_name)) { - s_val PJ_value (value, color, root); + value PJ_value(val, color, root); } xbt_dict_cursor_t cursor = nullptr; type_t child_type; char *name; xbt_dict_foreach(root->children, cursor, name, child_type) { - recursiveNewValueForUserStateType (type_name, value, color, child_type); + recursiveNewValueForUserStateType(type_name, val, color, child_type); } }