XBT_INFO("------------------- Schedule tasks ---------------------------");
sg_host_t *host_list = sg_host_list();
int hosts_count = sg_host_count();
- qsort((void *) host_list, hosts_count, sizeof(sg_host_t), name_compare_hosts);
+ qsort(host_list, hosts_count, sizeof(sg_host_t), name_compare_hosts);
xbt_dynar_foreach(dax, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
SD_task_t taskD = SD_task_create("Task D", nullptr, 60.0);
/* try to attach and retrieve user data to a task */
- SD_task_set_data(taskA, static_cast<void*>(&comp_amount1));
+ SD_task_set_data(taskA, &comp_amount1);
if (fabs(comp_amount1 - (*(static_cast<double*>(SD_task_get_data(taskA))))) > 1e-12)
XBT_ERROR("User data was corrupted by a simple set/get");
{
ensure_root_tid();
auto* payload = new std::string("some message");
- simgrid::s4u::Mailbox::by_name("some mailbox")->put((void*)payload, 10e8);
+ simgrid::s4u::Mailbox::by_name("some mailbox")->put(payload, 10e8);
}
static void receiver()
if (that.vtable_ && that.vtable_->move)
that.vtable_->move(buffer_, that.buffer_);
else
- std::memcpy(static_cast<void*>(&buffer_), static_cast<void*>(&that.buffer_), sizeof(buffer_));
+ std::memcpy(&buffer_, &that.buffer_, sizeof(buffer_));
vtable_ = std::move(that.vtable_);
that.vtable_ = nullptr;
}
if (that.vtable_ && that.vtable_->move)
that.vtable_->move(buffer_, that.buffer_);
else
- std::memcpy(static_cast<void*>(&buffer_), static_cast<void*>(&that.buffer_), sizeof(buffer_));
+ std::memcpy(&buffer_, &that.buffer_, sizeof(buffer_));
vtable_ = std::move(that.vtable_);
that.vtable_ = nullptr;
return *this;
jhost_bind(jhost, host, env);
/* the native host data field is set with the global reference to the java host returned by this function */
- host->extension_set(JAVA_HOST_LEVEL, (void *)jhost);
+ host->extension_set(JAVA_HOST_LEVEL, jhost);
}
/* return the global reference to the java host instance */
env->SetObjectField(jhost, jhost_field_Host_name, jname);
/* Bind & store it */
jhost_bind(jhost, host, env);
- host->extension_set(JAVA_HOST_LEVEL, (void *) jhost);
+ host->extension_set(JAVA_HOST_LEVEL, jhost);
} else {
jhost = (jobject) host->extension(JAVA_HOST_LEVEL);
}
}
/* Add a global ref into the Ctask so that the receiver can use it */
- MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
+ MSG_task_set_data(task, env->NewGlobalRef(jtask));
const char* alias = env->GetStringUTFChars(jalias, nullptr);
msg_error_t res = MSG_task_send_with_timeout_bounded(task, alias, jtimeout, maxrate);
return nullptr;
}
- MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
+ MSG_task_set_data(task, env->NewGlobalRef(jtask));
comm = MSG_task_isend(task,mailbox);
env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
return nullptr;
}
- MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
+ MSG_task_set_data(task, env->NewGlobalRef(jtask));
comm = MSG_task_isend_bounded(task,mailbox,maxrate);
env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
}
/* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */
- MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
+ MSG_task_set_data(task, env->NewGlobalRef(jtask));
MSG_task_dsend(task, alias, msg_task_cancel_on_failed_dsend);
env->ReleaseStringUTFChars(jalias, alias);
}
/* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */
- MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
+ MSG_task_set_data(task, env->NewGlobalRef(jtask));
MSG_task_dsend_bounded(task, alias, msg_task_cancel_on_failed_dsend, maxrate);
env->ReleaseStringUTFChars(jalias, alias);
jvm_bind(env, jVm, vm);
jVm = env->NewGlobalRef(jVm);
// We use the extension level of the host, even if that's somehow disturbing
- vm->extension_set(JAVA_HOST_LEVEL, (void*)jVm);
+ vm->extension_set(JAVA_HOST_LEVEL, jVm);
}
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_VM_all(JNIEnv* env, jclass cls_arg)
void sg_zone_get_sons(const_sg_netzone_t netzone, xbt_dict_t whereto)
{
for (auto const& elem : netzone->get_children()) {
- xbt_dict_set(whereto, elem->get_cname(), static_cast<void*>(elem));
+ xbt_dict_set(whereto, elem->get_cname(), elem);
}
}
if (mutex)
mutex->lock();
- mb->put(static_cast<void*>(payload), 8);
+ mb->put(payload, 8);
if (mutex)
mutex->unlock();
switch (args[0][test - 1]) {
case 'r':
XBT_INFO("Test %u: r (regular send)", test);
- mbox->put((void*)mboxName, 42.0);
+ mbox->put(mboxName, 42.0);
break;
case 'R':
XBT_INFO("Test %u: R (sleep + regular send)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- mbox->put((void*)mboxName, 42.0);
+ mbox->put(mboxName, 42.0);
break;
case 'i':
XBT_INFO("Test %u: i (asynchronous isend)", test);
- mbox->put_async((void*)mboxName, 42.0)->wait();
+ mbox->put_async(mboxName, 42.0)->wait();
break;
case 'I':
XBT_INFO("Test %u: I (sleep + isend)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- mbox->put_async((void*)mboxName, 42.0)->wait();
+ mbox->put_async(mboxName, 42.0)->wait();
break;
case 'd':
XBT_INFO("Test %u: d (detached send)", test);
- mbox->put_init((void*)mboxName, 42.0)->detach();
+ mbox->put_init(mboxName, 42.0)->detach();
break;
case 'D':
XBT_INFO("Test %u: D (sleep + detached send)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- mbox->put_init((void*)mboxName, 42.0)->detach();
+ mbox->put_init(mboxName, 42.0)->detach();
break;
default:
xbt_die("Unknown sender spec for test %u: '%c'", test, args[0][test - 1]);
sg_host_t *hosts = sg_host_list();
size_t totalHosts = sg_host_count();
- qsort((void *) hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts);
+ qsort(hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts);
xbt_dynar_foreach(dax, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {