}
JNIEXPORT void JNICALL
-Java_simgrid_msg_MsgNative_processChangeHost(JNIEnv* env, jclass cls, jobject jprocess, jobject jhost){
+Java_simgrid_msg_MsgNative_processChangeHost(JNIEnv* env, jclass cls, jobject jhost){
m_host_t host = jhost_get_native(env,jhost);
- m_process_t process = jprocess_to_native_process(jprocess,env);
-
- if(!process) {
- jxbt_throw_notbound(env,"process",jprocess);
- return;
- }
if(!host) {
jxbt_throw_notbound(env,"host",jhost);
}
/* try to change the host of the process */
- if(MSG_OK != MSG_process_change_host(process,host))
+ if(MSG_OK != MSG_process_change_host(host))
jxbt_throw_native(env, xbt_strdup("MSG_process_change_host() failed"));
}
argc++;
- argv = xbt_new0(char*,1);
+ argv = xbt_new0(char*, argc);
argv[0] = strdup("java");
JNIEXPORT void JNICALL
Java_simgrid_msg_MsgNative_selectContextFactory(JNIEnv * env, jclass class,jstring jname)
{
- char *errmsg=NULL;
+ char *errmsg = NULL;
xbt_ex_t e;
/* get the C string from the java string*/
xbt_ex_free(e);
}
- (*env)->ReleaseStringUTFChars(env, jname, name);
+ (*env)->ReleaseStringUTFChars(env, jname, name);
if(errmsg) {
char *thrown = bprintf("xbt_select_context_factory() failed: %s",errmsg);