solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit dce2ae66e2431d02c439824cfd9acd4077c8a2fa
parent 740756b2fa55e6241e36ea433da9eb4ee58f6d03
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 29 Nov 2016 10:57:47 +0100

Fix compilation issues of the core sub-project

Diffstat:
Mcmake/core/CMakeLists.txt | 13++++++++-----
Msrc/core/solstice_core.h | 4++--
Msrc/core/solstice_core_device.c | 2--
Msrc/core/solstice_core_device.h | 13++++++-------
Msrc/core/solstice_core_node.c | 5++---
Msrc/core/solstice_core_scene.c | 6+++---
6 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/cmake/core/CMakeLists.txt b/cmake/core/CMakeLists.txt @@ -59,14 +59,17 @@ add_library(solstice-core STATIC ${CORE_FILES_SRC} ${CORE_FILES_INC}) ################################################################################ if(NOT NO_TEST) function(new_test _name) - add_executable(${_name} - ${CORE_SOURCE_DIR}/test_core_utils.h - ${CORE_SOURCE_DIR}/test_core_utils.c - ${CORE_SOURCE_DIR}/${_name}.c) - target_link_libraries(${_name} RSys ${MATH_LIB} StarSP SolAnim SolSolver solstice-core) + add_executable(${_name} ${CORE_SOURCE_DIR}/${_name}.c) + target_link_libraries(${_name} RSys ${MATH_LIB} StarSP SolAnim SolSolver + solstice-core solstice-core-test) add_test(${_name} ${_name}) rcmake_set_test_runtime_dirs(${_name} _runtime_dirs) endfunction() + + add_library(solstice-core-test + ${CORE_SOURCE_DIR}/test_core_utils.h + ${CORE_SOURCE_DIR}/test_core_utils.c) + new_test(test_core_device) new_test(test_core_node) diff --git a/src/core/solstice_core.h b/src/core/solstice_core.h @@ -76,8 +76,8 @@ score_node_instantiate extern LOCAL_SYM res_T score_node_create_object -(struct score_device* dev, - struct score_node** node); + (struct score_device* dev, + struct score_node** node); extern LOCAL_SYM res_T score_node_pivot_create diff --git a/src/core/solstice_core_device.c b/src/core/solstice_core_device.c @@ -79,8 +79,6 @@ score_device_create dev->logger = logger ? logger : LOGGER_DEFAULT; dev->allocator = allocator; dev->verbose = verbose; - dev->nthreads = MMIN(nthreads_hint, (unsigned) omp_get_num_procs()); - omp_set_num_threads((int) dev->nthreads); res = ssol_device_create(logger, allocator, nthreads_hint, verbose, &dev->ssol); if (res != RES_OK) goto error; diff --git a/src/core/solstice_core_device.h b/src/core/solstice_core_device.h @@ -25,7 +25,6 @@ struct ssol_device; struct score_device { struct logger* logger; struct mem_allocator* allocator; - unsigned nthreads; int verbose; struct ssol_device* ssol; @@ -36,9 +35,9 @@ struct score_device { * with respect to the device verbose flag */ extern LOCAL_SYM void log_error -(struct score_device* dev, - const char* msg, - ...) + (struct score_device* dev, + const char* msg, + ...) #ifdef COMPILER_GCC __attribute((format(printf, 2, 3))) #endif @@ -48,9 +47,9 @@ log_error * with respect to the device verbose flag */ extern LOCAL_SYM void log_warning -(struct score_device* dev, - const char* msg, - ...) + (struct score_device* dev, + const char* msg, + ...) #ifdef COMPILER_GCC __attribute((format(printf, 2, 3))) #endif diff --git a/src/core/solstice_core_node.c b/src/core/solstice_core_node.c @@ -144,10 +144,9 @@ node_ref_put_children(struct sanim_node* node) } } -res_T +static res_T instance_internal_node_create -(struct score_device* dev, - struct score_node** node) + (struct score_device* dev, struct score_node** node) { struct sanim_node* anim; res_T res = RES_OK; diff --git a/src/core/solstice_core_scene.c b/src/core/solstice_core_scene.c @@ -25,8 +25,7 @@ /******************************************************************************* * Helper functions ******************************************************************************/ - -FINLINE struct sanim_node** +static INLINE struct sanim_node** contains(struct darray_nodes* array, struct sanim_node* elt) { size_t count, i; @@ -191,7 +190,7 @@ node_to_solver_update(const struct sanim_node* node_, const double transform[12] return res; } -static res_T +static INLINE res_T update_pivots(struct score_scene* scene, const double sun_dir[3]) { size_t i_count, i; @@ -448,3 +447,4 @@ exit: error: goto exit; } +