/* Functions related to the java task instances. */
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2020. 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. */
}
JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName(JNIEnv * env, jobject jtask) {
- msg_task_t task = jtask_to_native(jtask, env);
+ const_msg_task_t task = jtask_to_native(jtask, env);
if (not task) {
jxbt_throw_notbound(env, "task", jtask);
}
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender(JNIEnv * env, jobject jtask) {
- msg_process_t process;
-
- msg_task_t task = jtask_to_native(jtask, env);
+ const_msg_task_t task = jtask_to_native(jtask, env);
if (not task) {
jxbt_throw_notbound(env, "task", jtask);
return nullptr;
}
- process = MSG_task_get_sender(task);
+ auto const* process = MSG_task_get_sender(task);
if (process == nullptr) {
return nullptr;
}
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource(JNIEnv * env, jobject jtask)
{
- msg_task_t task = jtask_to_native(jtask, env);
+ const_msg_task_t task = jtask_to_native(jtask, env);
if (not task) {
jxbt_throw_notbound(env, "task", jtask);
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount(JNIEnv * env, jobject jtask)
{
- msg_task_t ptask = jtask_to_native(jtask, env);
+ const_msg_task_t ptask = jtask_to_native(jtask, env);
if (not ptask) {
jxbt_throw_notbound(env, "task", jtask);