X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7f4f03348bd07609e258eb3b545bdafc2c881847..4b704826ee3394484842e7b48d1241d8c1b33787:/src/bindings/java/jmsg_storage.cpp diff --git a/src/bindings/java/jmsg_storage.cpp b/src/bindings/java/jmsg_storage.cpp index 299b34a8eb..8caed69e10 100644 --- a/src/bindings/java/jmsg_storage.cpp +++ b/src/bindings/java/jmsg_storage.cpp @@ -29,8 +29,7 @@ msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage) { return (msg_storage_t) (uintptr_t) env->GetLongField(jstorage, jstorage_field_Storage_bind); } -JNIEXPORT void JNICALL -Java_org_simgrid_msg_Storage_nativeInit(JNIEnv *env, jclass cls) { +JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_nativeInit(JNIEnv *env, jclass cls) { jclass class_Storage = env->FindClass("org/simgrid/msg/Storage"); jstorage_method_Storage_constructor = env->GetMethodID(class_Storage, "", "()V"); jstorage_field_Storage_bind = jxbt_get_jfield(env,class_Storage, "bind", "J"); @@ -57,16 +56,14 @@ const char *jstorage_get_name(jobject jstorage, JNIEnv * env) { return MSG_storage_get_name(storage); } -JNIEXPORT jobject JNICALL -Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, jclass cls, - jstring jname) { +JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, jclass cls, jstring jname) { msg_storage_t storage; jobject jstorage; /* get the C string from the java string */ if (jname == NULL) { - jxbt_throw_null(env,bprintf("No host can have a null name")); - return NULL; + jxbt_throw_null(env,bprintf("No host can have a null name")); + return NULL; } const char *name = env->GetStringUTFChars(jname, 0); storage = MSG_storage_get_by_name(name); @@ -110,9 +107,7 @@ Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, jclass cls, return (jobject) xbt_lib_get_level(storage, JAVA_STORAGE_LEVEL); } - -JNIEXPORT jlong JNICALL -Java_org_simgrid_msg_Storage_getSize(JNIEnv * env,jobject jstorage) { +JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv * env,jobject jstorage) { msg_storage_t storage = jstorage_get_native(env, jstorage); if (!storage) { @@ -123,8 +118,7 @@ Java_org_simgrid_msg_Storage_getSize(JNIEnv * env,jobject jstorage) { return (jlong) MSG_storage_get_size(storage); } -JNIEXPORT jlong JNICALL -Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv * env,jobject jstorage) { +JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv * env,jobject jstorage) { msg_storage_t storage = jstorage_get_native(env, jstorage); if (!storage) { @@ -135,8 +129,7 @@ Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv * env,jobject jstorage) { return (jlong) MSG_storage_get_free_size(storage); } -JNIEXPORT jlong JNICALL -Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv * env,jobject jstorage) { +JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv * env,jobject jstorage) { msg_storage_t storage = jstorage_get_native(env, jstorage); if (!storage) { @@ -147,8 +140,7 @@ Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv * env,jobject jstorage) { return (jlong) MSG_storage_get_used_size(storage); } -JNIEXPORT jobject JNICALL -Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname) { +JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname) { msg_storage_t storage = jstorage_get_native(env, jstorage); if (!storage) { @@ -170,7 +162,7 @@ Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject jname, jobject jvalue) { - msg_storage_t storage = jstorage_get_native(env, jstorage); + msg_storage_t storage = jstorage_get_native(env, jstorage); if (!storage) { jxbt_throw_notbound(env, "storage", jstorage); @@ -182,13 +174,12 @@ Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject MSG_storage_set_property_value(storage, name, value, xbt_free_f); - env->ReleaseStringUTFChars((jstring) jvalue, value); + env->ReleaseStringUTFChars((jstring) jvalue, value_java); env->ReleaseStringUTFChars((jstring) jname, name); } -JNIEXPORT jobject JNICALL -Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage) { +JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage) { msg_storage_t storage = jstorage_get_native(env, jstorage); if (!storage) { @@ -204,8 +195,7 @@ Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage) { return jhost_name; } -JNIEXPORT jobjectArray JNICALL -Java_org_simgrid_msg_Storage_all(JNIEnv * env, jclass cls_arg) +JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv * env, jclass cls_arg) { int index; jobjectArray jtable;