From 96d398110b72eac0e60cbe1a72c0d1b37de85da0 Mon Sep 17 00:00:00 2001
From: Folkert Nobels <nobels@strw.leidenuniv.nl>
Date: Tue, 11 Dec 2018 13:23:22 +0100
Subject: [PATCH] Final commits for working star formation NONE

---
 examples/main.c                        | 4 ++--
 src/engine.c                           | 2 +-
 src/starformation/none/starformation.h | 8 ++++----
 src/swift.h                            | 1 +
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/examples/main.c b/examples/main.c
index b997104245..7d4667c02d 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -865,8 +865,8 @@ int main(int argc, char *argv[]) {
 
     /* Initialise the star formation law and its properties */
     if (with_star_formation) 
-    starformation_init(params, &prog_const, &us, &s, &starform);
-    if (myrank ==0) starformation_init(&starform);
+    starformation_init(params, &prog_const, &us, &starform);
+    if (myrank ==0) starformation_print(&starform);
 
     /* Initialise the chemistry */
     bzero(&chemistry, sizeof(struct chemistry_global_data));
diff --git a/src/engine.c b/src/engine.c
index bf93629947..922cbb6a1b 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -90,7 +90,7 @@
 #include "units.h"
 #include "velociraptor_interface.h"
 #include "version.h"
-#include "starformation.h" 
+#include "starformation.h"
 
 /* Particle cache size. */
 #define CACHE_SIZE 512
diff --git a/src/starformation/none/starformation.h b/src/starformation/none/starformation.h
index 023ddf00b6..15928e0739 100644
--- a/src/starformation/none/starformation.h
+++ b/src/starformation/none/starformation.h
@@ -46,7 +46,7 @@ struct star_formation {};
  * @param cosmo the cosmological parameters and properties
  *
  * */
-int starformation_potential_to_become_star(
+INLINE static int starformation_potential_to_become_star(
     const struct star_formation* starform, struct part* restrict p,
     const struct xpart* restrict xp, const struct phys_const* const phys_const,
     const struct cosmology* cosmo){
@@ -63,7 +63,7 @@ int starformation_potential_to_become_star(
  * @param cosmo the cosmological properties
  *
  * */
-void starformation_convert_to_gas( 
+INLINE static void starformation_convert_to_gas( 
     const struct star_formation* starform, const struct part* restrict p,
     const struct xpart* restrict xp, const struct cosmology* cosmo) {}
 
@@ -76,7 +76,7 @@ void starformation_convert_to_gas(
  * @param starform the star formation law properties to initialize
  *
  * */
-void starformation_init_backend(
+INLINE static void starformation_init_backend(
   struct swift_params* parameter_file, const struct phys_const* phys_const,
   const struct unit_system* us, const struct star_formation* starform) {}
 
@@ -84,7 +84,7 @@ void starformation_init_backend(
  *
  * @param starform the star formation law properties.
  * */
-void starformation_print_backend(
+INLINE static void starformation_print_backend(
     const struct star_formation* starform){ 
 
   message("Star formation law is 'No Star Formation'");
diff --git a/src/swift.h b/src/swift.h
index 7279fc58b3..3a362fe9ce 100644
--- a/src/swift.h
+++ b/src/swift.h
@@ -76,5 +76,6 @@
 #include "units.h"
 #include "velociraptor_interface.h"
 #include "version.h"
+#include "starformation.h"
 
 #endif /* SWIFT_SWIFT_H */
-- 
GitLab