Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use sg_storage_size_t in Java bindings too.
[simgrid.git] / src / bindings / java / jmsg_file.c
index d1e57c2..fb2557a 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions related to the java file API.                            */
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@ Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jstorage, job
   const char *path = (*env)->GetStringUTFChars(env, jpath, 0);
   msg_file_t file;
 
-  file = MSG_file_open(storage, path);
+  file = MSG_file_open(storage, path, NULL);
   jfile_bind(env, jfile, file);
 
   (*env)->ReleaseStringUTFChars(env, jstorage, storage);
@@ -38,17 +38,13 @@ Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jstorage, job
 JNIEXPORT jlong JNICALL
 Java_org_simgrid_msg_File_read(JNIEnv *env, jobject jfile, jlong jsize) {
   msg_file_t file = jfile_get_native(env, jfile);
-  size_t n;
-  n = MSG_file_read(NULL,(size_t)jsize, file);
-  return (jlong)n;
+  return (jlong)MSG_file_read(file, (sg_storage_size_t)jsize);
 }
 
 JNIEXPORT jlong JNICALL
 Java_org_simgrid_msg_File_write(JNIEnv *env, jobject jfile, jlong jsize) {
   msg_file_t file = jfile_get_native(env, jfile);
-  size_t n;
-  n = MSG_file_write(NULL, (size_t)jsize, file);
-  return (jlong)n;
+  return (jlong)MSG_file_write(file, (sg_storage_size_t)jsize);
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfile) {