From: Martin Quinson Date: Fri, 27 Apr 2012 21:02:30 +0000 (+0200) Subject: adapt to lastest cleanups in the core library X-Git-Tag: v3_9_90~569^2~19^2~121 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/32a3008f360d90a28b60c66672da6ccee12f019e?hp=9d45f09800ba18cc02555b9d40ad6f5090eaa8a4 adapt to lastest cleanups in the core library --- diff --git a/src/jmsg.c b/src/jmsg.c index 323d3aa4e4..e956efcb02 100644 --- a/src/jmsg.c +++ b/src/jmsg.c @@ -7,7 +7,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include -#include +#include #include #include "smx_context_java.h" @@ -354,7 +354,7 @@ Java_org_simgrid_msg_MsgNative_hostGetByName(JNIEnv * env, jclass cls, XBT_DEBUG("Looking for host '%s'",name); /* get the host by name (the hosts are created during the grid resolution) */ host = MSG_get_host_by_name(name); - XBT_DEBUG("MSG gave %p as native host (simdata=%p)", host,host? host->simdata:NULL); + XBT_DEBUG("MSG gave %p as native host (smx_host=%p)", host,host? host->smx_host:NULL); if (!host) { /* invalid name */ jxbt_throw_host_not_found(env, name); @@ -849,7 +849,7 @@ JNIEXPORT void JNICALL /* Cleanup java hosts */ hosts = MSG_hosts_as_dynar(); for (index = 0; index < xbt_dynar_length(hosts) - 1; index++) { - jhost = (jobject) xbt_dynar_get_as(hosts,index,m_host_t)->data; + jhost = (jobject) MSG_host_get_data(xbt_dynar_get_as(hosts,index,m_host_t)); if (jhost) jhost_unref(env, jhost); diff --git a/src/jmsg_host.c b/src/jmsg_host.c index 04402bcf26..7185b2041a 100644 --- a/src/jmsg_host.c +++ b/src/jmsg_host.c @@ -56,21 +56,7 @@ m_host_t jhost_get_native(JNIEnv * env, jobject jhost) const char *jhost_get_name(jobject jhost, JNIEnv * env) { m_host_t host = jhost_get_native(env, jhost); - return (const char *) host->name; -} - -void jhost_set_name(jobject jhost, jstring jname, JNIEnv * env) -{ - const char *name; - m_host_t host = jhost_get_native(env, jhost); - - name = (*env)->GetStringUTFChars(env, jname, 0); - - if (host->name) - free(host->name); - - host->name = xbt_strdup(name); - (*env)->ReleaseStringUTFChars(env, jname, name); + return MSG_host_get_name(host); } jboolean jhost_is_valid(jobject jhost, JNIEnv * env) diff --git a/src/jmsg_host.h b/src/jmsg_host.h index 1f40c13f38..4434b16f6b 100644 --- a/src/jmsg_host.h +++ b/src/jmsg_host.h @@ -85,16 +85,6 @@ m_host_t jhost_get_native(JNIEnv * env, jobject jhost); */ const char *jhost_get_name(jobject jhost, JNIEnv * env); - -/** - * This function sets the name of a MSG host. - * - * @param host The host concerned by the operation. - * @param jname The new name of the host. - * @param env The environment of the current thread - */ -void jhost_set_name(jobject jhost, jstring jname, JNIEnv * env); - /** * This function tests if a java host instance is valid. * A java host object is valid if it is bind to a native host. diff --git a/src/jmsg_process.h b/src/jmsg_process.h index 8d3862a90d..101c24851b 100644 --- a/src/jmsg_process.h +++ b/src/jmsg_process.h @@ -10,8 +10,8 @@ #define MSG_JPROCESS_H #include -#include "msg/msg.h" -#include "simix/simix.h" +#include +#include /** * This function returns a global reference to the java process instance diff --git a/src/smx_context_java.c b/src/smx_context_java.c index c91e1d96f7..647b34eccf 100644 --- a/src/smx_context_java.c +++ b/src/smx_context_java.c @@ -8,7 +8,7 @@ #include -#include +#include #include "smx_context_java.h" #include "xbt/dynar.h" diff --git a/src/smx_context_java.h b/src/smx_context_java.h index b970fe0783..c95f15bd3b 100644 --- a/src/smx_context_java.h +++ b/src/smx_context_java.h @@ -8,7 +8,7 @@ #define _XBT_CONTEXT_JAVA_H #include -#include +#include #include "jmsg.h" #include "jmsg_process.h"