Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into actor-yield
[simgrid.git] / src / bindings / java / jmsg_as.cpp
index cd344be..d06d1d4 100644 (file)
@@ -9,14 +9,14 @@
 #include "simgrid/s4u/NetZone.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 
-#include "jmsg_as.h"
+#include "jmsg.hpp"
+#include "jmsg_as.hpp"
 #include "jmsg_host.h"
-#include "jxbt_utilities.h"
-#include "jmsg.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jas_method_As_constructor;
 static jfieldID jas_field_As_bind;
@@ -78,7 +78,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, job
     return nullptr;
   }
 
-  for (auto tmp_as : *self_as->getChildren()) {
+  for (auto const& tmp_as : *self_as->getChildren()) {
     jobject tmp_jas = jnetzone_new_instance(env);
     if (not tmp_jas) {
       jxbt_throw_jni(env, "java As instantiation failed");
@@ -140,7 +140,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
   }
 
   int index = 0;
-  for (auto host : table) {
+  for (auto const& host : table) {
     jhost = static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
     if (not jhost) {
       jname = env->NewStringUTF(host->getCname());
@@ -155,5 +155,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
   }
   return jtable;
 }
-
-SG_END_DECL()
+}