Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use & when forming pointer-to-functions
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 27 May 2016 13:39:01 +0000 (15:39 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 27 May 2016 13:49:16 +0000 (15:49 +0200)
examples/smpi/trace_call_location/smpi_trace_call_location
src/simix/smx_context.cpp
src/simix/smx_global.cpp

index 9ddb4ef..5eb6324 100755 (executable)
Binary files a/examples/smpi/trace_call_location/smpi_trace_call_location and b/examples/smpi/trace_call_location/smpi_trace_call_location differ
index 84da193..3e46ece 100644 (file)
@@ -42,16 +42,16 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix, "Context switching mechani
 
 static std::pair<const char*, simgrid::simix::ContextFactoryInitializer> context_factories[] = {
 #if HAVE_RAW_CONTEXTS
-  { "raw", simgrid::simix::raw_factory },
+  { "raw", &simgrid::simix::raw_factory },
 #endif
 #if HAVE_UCONTEXT_CONTEXTS
-  { "ucontext", simgrid::simix::sysv_factory },
+  { "ucontext", &simgrid::simix::sysv_factory },
 #endif
 #if HAVE_BOOST_CONTEXTS
-  { "boost", simgrid::simix::boost_factory },
+  { "boost", &simgrid::simix::boost_factory },
 #endif
 #if HAVE_THREAD_CONTEXTS
-  { "thread", simgrid::simix::thread_factory },
+  { "thread", &simgrid::simix::thread_factory },
 #endif
 };
 
index bc31f71..3001ca0 100644 (file)
@@ -131,7 +131,7 @@ static void install_segvhandler(void)
   }
 
   struct sigaction action, old_action;
-  action.sa_sigaction = segvhandler;
+  action.sa_sigaction = &segvhandler;
   action.sa_flags = SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
   sigemptyset(&action.sa_mask);
 
@@ -205,9 +205,9 @@ void SIMIX_global_init(int *argc, char **argv)
     simix_global->maestro_process = NULL;
     simix_global->registered_functions = xbt_dict_new_homogeneous(NULL);
 
-    simix_global->create_process_function = SIMIX_process_create;
-    simix_global->kill_process_function = kill_process;
-    simix_global->cleanup_process_function = SIMIX_process_cleanup;
+    simix_global->create_process_function = &SIMIX_process_create;
+    simix_global->kill_process_function = &kill_process;
+    simix_global->cleanup_process_function = &SIMIX_process_cleanup;
     simix_global->mutex = xbt_os_mutex_init();
 
     surf_init(argc, argv);      /* Initialize SURF structures */
@@ -218,8 +218,8 @@ void SIMIX_global_init(int *argc, char **argv)
     simgrid::simix::create_maestro(maestro_code);
 
     /* context exception handlers */
-    __xbt_running_ctx_fetch = SIMIX_process_get_running_context;
-    __xbt_ex_terminate = SIMIX_process_exception_terminate;
+    __xbt_running_ctx_fetch = &SIMIX_process_get_running_context;
+    __xbt_ex_terminate = &SIMIX_process_exception_terminate;
 
     /* Prepare to display some more info when dying on Ctrl-C pressing */
     signal(SIGINT, inthandler);