X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8199067e1f2a6ea4d3d8a38df1a4fb3f25d364da..336c071af62d0d9e3b4a445cfb2a834287fe722f:/src/bindings/java/jmsg_storage.c diff --git a/src/bindings/java/jmsg_storage.c b/src/bindings/java/jmsg_storage.c index 150ae146c8..d3fd8db936 100644 --- a/src/bindings/java/jmsg_storage.c +++ b/src/bindings/java/jmsg_storage.c @@ -1,13 +1,13 @@ /* Functions related to the java storage API. */ -/* Copyright (c) 2012-2014. The SimGrid Team. +/* Copyright (c) 2012-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/str.h" -#include "msg/msg.h" +#include "simgrid/msg.h" #include "jmsg.h" #include "jmsg_storage.h" #include "jxbt_utilities.h" @@ -24,7 +24,7 @@ jobject jstorage_new_instance(JNIEnv * env) { } msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage) { - return (msg_storage_t) (long) (*env)->GetLongField(env, jstorage, jstorage_field_Storage_bind); + return (msg_storage_t) (uintptr_t) (*env)->GetLongField(env, jstorage, jstorage_field_Storage_bind); } JNIEXPORT void JNICALL @@ -39,7 +39,7 @@ Java_org_simgrid_msg_Storage_nativeInit(JNIEnv *env, jclass cls) { } void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env) { - (*env)->SetLongField(env, jstorage, jstorage_field_Storage_bind, (jlong) (long) (storage)); + (*env)->SetLongField(env, jstorage, jstorage_field_Storage_bind, (jlong) (uintptr_t) (storage)); } jobject jstorage_ref(JNIEnv * env, jobject jstorage) { @@ -176,7 +176,7 @@ Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject } const char *name = (*env)->GetStringUTFChars(env, jname, 0); const char *value_java = (*env)->GetStringUTFChars(env, jvalue, 0); - char *value = strdup(value_java); + char *value = xbt_strdup(value_java); MSG_storage_set_property_value(storage, name, value, xbt_free_f); @@ -241,4 +241,3 @@ Java_org_simgrid_msg_Storage_all(JNIEnv * env, jclass cls_arg) xbt_dynar_free(&table); return jtable; } -