From 5dc86ff6da450ced640b10645791bf9e5273448b Mon Sep 17 00:00:00 2001 From: thiery Date: Thu, 2 Dec 2010 14:14:44 +0000 Subject: [PATCH] Define inline functions before calling them git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8892 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/simix/smx_global.c | 10 +++++----- src/simix/smx_process.c | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index afdf097733..2139013eca 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -37,6 +37,11 @@ static void _XBT_CALL inthandler(int ignored) /********************************* SIMIX **************************************/ +XBT_INLINE double SIMIX_timer_next(void) +{ + return xbt_heap_size(simix_timers) > 0 ? xbt_heap_maxkey(simix_timers) : -1.0; +} + /** * \brief Initialize SIMIX internal data. * @@ -232,11 +237,6 @@ XBT_INLINE void SIMIX_timer_set(double date, void *function, void *arg) xbt_heap_push(simix_timers, timer, date); } -XBT_INLINE double SIMIX_timer_next(void) -{ - return xbt_heap_size(simix_timers) > 0 ? xbt_heap_maxkey(simix_timers) : -1.0; -} - /** * \brief Registers a function to create a process. * diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index 8eed30e499..65788507ca 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -15,6 +15,20 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix, static unsigned long simix_process_count = 0; +/** + * \brief Returns the current agent. + * + * This functions returns the currently running SIMIX process. + * + * \return The SIMIX process + */ +XBT_INLINE smx_process_t SIMIX_process_self(void) +{ + if(simix_global) + return SIMIX_context_self(); + return NULL; +} + /** * \brief Move a process to the list of processes to destroy. */ @@ -478,20 +492,6 @@ void SIMIX_process_sleep_resume(smx_action_t action) surf_workstation_model->resume(action->sleep.surf_sleep); } -/** - * \brief Returns the current agent. - * - * This functions returns the currently running SIMIX process. - * - * \return The SIMIX process - */ -XBT_INLINE smx_process_t SIMIX_process_self(void) -{ - if(simix_global) - return SIMIX_context_self(); - return NULL; -} - /** * Calling this function makes the process to yield. * Only the processes can call this function, giving back the control to maestro -- 2.20.1