X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d5cf915bd09762c921e587f376420993f216a239..dccf1b41e9c7b5a696f01abceaa2779fe65f154f:/src/bindings/java/jmsg_as.cpp diff --git a/src/bindings/java/jmsg_as.cpp b/src/bindings/java/jmsg_as.cpp index df66f45f33..ea4134969c 100644 --- a/src/bindings/java/jmsg_as.cpp +++ b/src/bindings/java/jmsg_as.cpp @@ -6,8 +6,12 @@ /* 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. */ -#include "xbt/str.h" -#include "xbt/dict.h" +#include +#include +#include + +#include + #include "simgrid/msg.h" #include "jmsg_as.h" #include "jmsg_host.h" @@ -69,7 +73,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, job return nullptr; } - jtable = env->NewObjectArray((jsize) count, cls, nullptr); + jtable = env->NewObjectArray(static_cast(count), cls, nullptr); if (!jtable) { jxbt_throw_jni(env, "Hosts table allocation failed"); @@ -105,7 +109,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobje jxbt_throw_notbound(env, "as", jas); return nullptr; } - const char *name = env->GetStringUTFChars((jstring) jname, 0); + const char *name = env->GetStringUTFChars(static_cast(jname), 0); const char *property = MSG_environment_as_get_property_value(as, name); if (!property) { @@ -114,7 +118,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobje jobject jproperty = env->NewStringUTF(property); - env->ReleaseStringUTFChars((jstring) jname, name); + env->ReleaseStringUTFChars(static_cast(jname), name); return jproperty; } @@ -137,7 +141,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo return nullptr; } - jtable = env->NewObjectArray((jsize) count, cls, nullptr); + jtable = env->NewObjectArray(static_cast(count), cls, nullptr); if (!jtable) { jxbt_throw_jni(env, "Hosts table allocation failed"); @@ -147,9 +151,9 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo for (index = 0; index < count; index++) { host = xbt_dynar_get_as(table,index,msg_host_t); - jhost = (jobject) host->extension(JAVA_HOST_LEVEL); + jhost = static_cast(host->extension(JAVA_HOST_LEVEL)); if (!jhost) { - jname = env->NewStringUTF(MSG_host_get_name(host)); + jname = env->NewStringUTF(host->cname()); jhost = Java_org_simgrid_msg_Host_getByName(env, cls, jname);