From 8aed3491390c7b3f7c55b8d8c5c29a53f3b1faf0 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Fri, 4 Jan 2019 17:17:07 +0100 Subject: [PATCH] Removing nested function through macro use. --- src/heuristic.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/heuristic.c b/src/heuristic.c index 94e5568..f00b5c7 100644 --- a/src/heuristic.c +++ b/src/heuristic.c @@ -37,6 +37,14 @@ #include "error.h" #include "knowledge.h" +#define erode(deltaw) { \ + if (smode & 1) \ + { \ + w = w + (deltaw); \ + } \ + smode = smode / 2; \ + } + //! Trivial goal detection /** * Detect goals that we do not need to solve because they can be trivially solved. @@ -352,15 +360,6 @@ computeGoalWeight (const System sys, const Binding b) int smode; Term t; - void erode (const float deltaw) - { - if (smode & 1) - { - w = w + deltaw; - } - smode = smode / 2; - } - // Total weight w = 0; // We will shift this mode variable