Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove extern "C" from cpp files (src/bindings/).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Mar 2018 14:49:59 +0000 (16:49 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Mar 2018 14:49:59 +0000 (16:49 +0200)
18 files changed:
src/bindings/java/JavaContext.cpp
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg_as.cpp
src/bindings/java/jmsg_comm.cpp
src/bindings/java/jmsg_file.cpp
src/bindings/java/jmsg_host.cpp
src/bindings/java/jmsg_process.cpp
src/bindings/java/jmsg_rngstream.cpp
src/bindings/java/jmsg_storage.cpp
src/bindings/java/jmsg_synchro.cpp
src/bindings/java/jmsg_task.cpp
src/bindings/java/jmsg_vm.cpp
src/bindings/java/jtrace.cpp
src/bindings/java/jxbt_utilities.cpp
src/bindings/lua/lua_debug.cpp
src/bindings/lua/lua_host.cpp
src/bindings/lua/lua_platf.cpp
src/bindings/lua/simgrid_lua.cpp

index 695023d..439c30b 100644 (file)
@@ -1,6 +1,6 @@
 /* Context switching within the JVM.                                        */
 
-/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2018. 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. */
@@ -13,7 +13,7 @@
 #include <functional>
 #include <utility>
 
-extern "C" JavaVM* __java_vm;
+extern JavaVM* __java_vm;
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(java, "MSG for Java(TM)");
 
index 0a9bc6d..6ba8f43 100644 (file)
@@ -40,8 +40,6 @@
 #endif
 /* end of eclipse-mandated pimple */
 
-extern "C" {
-
 int JAVA_HOST_LEVEL = -1;
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
@@ -239,7 +237,6 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_fileSystemInit()
 {
   sg_storage_file_system_init();
 }
-} // extern "C"
 
 /** Run a Java org.simgrid.msg.Process
  *
index 9c7935d..d921d3e 100644 (file)
@@ -1,6 +1,6 @@
 /* Java bindings of the NetZones.                                           */
 
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -16,8 +16,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 static jmethodID jas_method_As_constructor;
 static jfieldID jas_field_As_bind;
 
@@ -155,4 +153,3 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
   }
   return jtable;
 }
-}
index da8c34d..513384c 100644 (file)
@@ -1,6 +1,6 @@
 /* Java bindings to the Comm API                                            */
 
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2018. 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. */
@@ -14,8 +14,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 static jfieldID jcomm_field_Comm_bind;
 static jfieldID jcomm_field_Comm_finished;
 static jfieldID jcomm_field_Comm_receiving;
@@ -166,4 +164,3 @@ JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls,
   xbt_dynar_free(&dyn);
   return rank;
 }
-}
index ff8dcba..def75aa 100644 (file)
@@ -1,6 +1,6 @@
 /* Java bindings of the file API.                                           */
 
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2018. 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. */
@@ -8,8 +8,6 @@
 #include "jmsg_file.h"
 #include "jxbt_utilities.hpp"
 
-extern "C" {
-
 void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd) {
   env->SetLongField(jfile, jfile_field_bind, reinterpret_cast<std::intptr_t>(fd));
 }
@@ -53,4 +51,3 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfil
   MSG_file_close(file);
   jfile_bind(env, jfile, nullptr);
 }
-}
index 22c54da..6dc5b56 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java host instances.                            */
 
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -16,8 +16,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 static jmethodID jhost_method_Host_constructor;
 static jfieldID jhost_field_Host_bind;
 static jfieldID jhost_field_Host_name;
@@ -374,4 +372,3 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getPowerPeakAt(JNIEnv* env,
   msg_host_t host = jhost_get_native(env, jhost);
   return MSG_host_get_power_peak_at(host, pstate);
 }
-}
index 25b4733..a25eb46 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java process instances.                         */
 
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -16,8 +16,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 jfieldID jprocess_field_Process_bind;
 jfieldID jprocess_field_Process_host;
 jfieldID jprocess_field_Process_killTime;
@@ -301,4 +299,3 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , j
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
   return (jint) MSG_process_get_number();
 }
-}
index cf069b3..2bbc9bb 100644 (file)
@@ -1,6 +1,6 @@
 /* Java binding of the RngStream library                                    */
 
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -10,8 +10,6 @@
 #include "jmsg_rngstream.h"
 #include "jxbt_utilities.hpp"
 
-extern "C" {
-
 jfieldID jrngstream_bind;
 
 RngStream jrngstream_to_native(JNIEnv *env, jobject jrngstream) {
@@ -145,4 +143,3 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_RngStream_randInt(JNIEnv *env, jobje
 
   return (jint)RngStream_RandInt(rngstream, (int)i, (int)j);
 }
-}
index 548780c..15fedd9 100644 (file)
@@ -1,6 +1,6 @@
 /* Java bindings of the Storage API.                                        */
 
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2018. 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. */
@@ -16,8 +16,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 static jmethodID jstorage_method_Storage_constructor;
 static jfieldID jstorage_field_Storage_bind;
 static jfieldID jstorage_field_Storage_name;
@@ -229,4 +227,3 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv * env, jc
   xbt_dynar_free(&table);
   return jtable;
 }
-}
index a831b3f..259def3 100644 (file)
@@ -1,6 +1,6 @@
 /* Java bindings of the Synchronization API.                                */
 
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2018. 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. */
@@ -14,8 +14,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 static jfieldID jsynchro_field_Mutex_bind;
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeInit(JNIEnv *env, jclass cls) {
@@ -94,4 +92,3 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * en
   sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
   MSG_sem_destroy(sem);
 }
-}
index 91f2557..953ec60 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java task instances.                            */
 
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -15,8 +15,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 static jmethodID jtask_method_Comm_constructor;
 
 static jfieldID jtask_field_Task_bind;
@@ -528,4 +526,3 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass
 
   return (jint) rv;
 }
-}
index 9055739..f855359 100644 (file)
@@ -14,8 +14,6 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-extern "C" {
-
 extern int JAVA_HOST_LEVEL;
 static jfieldID jvm_field_bind;
 
@@ -194,4 +192,3 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclas
 
   return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
 }
-}
index 02f22f1..fe16a28 100644 (file)
@@ -1,6 +1,6 @@
 /* Java bindings of the Trace API.                                          */
 
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2018. 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. */
@@ -20,8 +20,6 @@
 // Define a new category
 XBT_LOG_NEW_DEFAULT_CATEGORY (jtrace, "TRACE for Java(TM)");
 
-extern "C" {
-
 JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
 {
   const char *s = env->GetStringUTFChars(js, 0);
@@ -198,4 +196,3 @@ JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet
    JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime(JNIEnv *env, jclass cls, jdouble,
                                                                                      jstring, jstring, jstring, jdouble)
 */
-}
index 1853d1b..f26d24c 100644 (file)
@@ -1,6 +1,6 @@
 /* Various JNI helper functions                                             */
 
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -10,8 +10,6 @@
 
 #include <cstdlib> /* abort */
 
-extern "C" {
-
 jclass jxbt_get_class(JNIEnv * env, const char *name)
 {
   jclass cls = env->FindClass(name);
@@ -211,4 +209,3 @@ void jxbt_throw_task_cancelled(JNIEnv* env, std::string details)
 {
   jxbt_throw_by_name(env, "org/simgrid/msg/TaskCancelledException", details);
 }
-}
index ddf1fb4..4cfe342 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2017. The SimGrid Team.
+/* Copyright (c) 2010-2018. The SimGrid Team.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -11,9 +11,7 @@
  *
  */
  /* SimGrid Lua debug functions                                             */
-extern "C" {
 #include <lauxlib.h>
-}
 #include "lua_utils.hpp"
 #include "xbt.h"
 
index f511ec3..7f35793 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2018. 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. */
@@ -7,9 +7,7 @@
 
 #include "lua_private.hpp"
 #include "simgrid/s4u/Host.hpp"
-extern "C" {
 #include <lauxlib.h>
-}
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(lua_host, "Lua Host module");
 
index c91e07b..90a2afa 100644 (file)
@@ -12,9 +12,7 @@
 #include <cctype>
 #include <cstring>
 
-extern "C" {
 #include <lauxlib.h>
-}
 
 #include "src/surf/surf_private.hpp"
 #include <boost/algorithm/string/classification.hpp>
index 1bca949..b6ca7a4 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(lua, "Lua Bindings");
 
-extern "C" {
 #include <lauxlib.h>
 
-int luaopen_simgrid(lua_State *L);
-}
+extern "C" int luaopen_simgrid(lua_State* L);
 
 /* ********************************************************************************* */
 /*                                  simgrid API                                      */