X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5724727de91d9bdecc5c89ce31ab12acde2e1232..0704134e6e2ad0b078f9fc1fa8f1f8937d76896a:/src/jmsg.c diff --git a/src/jmsg.c b/src/jmsg.c index 2013fd25c2..61d916b6db 100644 --- a/src/jmsg.c +++ b/src/jmsg.c @@ -20,6 +20,15 @@ #include "jmsg.h" +/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */ +#ifndef JNIEXPORT +#define JNIEXPORT +#endif +#ifndef JNICALL +#define JNICALL +#endif +/* end of eclipse-mandated pimple */ + XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(jmsg); static JavaVM *__java_vm = NULL; @@ -340,7 +349,7 @@ Java_org_simgrid_msg_MsgNative_hostGetByName(JNIEnv * env, jclass cls, if (!MSG_host_get_data(host)) { /* native host not associated yet with java host */ - /* instanciate a new java host */ + /* Instantiate a new java host */ jhost = jhost_new_instance(env); if (!jhost) { @@ -781,7 +790,7 @@ Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs) argc = (int) (*env)->GetArrayLength(env, jargs); argc++; - argv = xbt_new0(char *, argc); + argv = xbt_new(char *, argc + 1); argv[0] = strdup("java"); for (index = 0; index < argc - 1; index++) { @@ -790,6 +799,7 @@ Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs) argv[index + 1] = strdup(tmp); (*env)->ReleaseStringUTFChars(env, jval, tmp); } + argv[argc] = NULL; MSG_global_init(&argc, argv);