From dc1b7c66c6a75b2e93086801f272ef00509e8d53 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Tue, 14 Feb 2017 17:22:02 +0100 Subject: [PATCH] bmc: Make the second part of the data set comparison algorithm public. This code will be shared by future alternative algorithms. Signed-off-by: Richard Cochran --- bmc.c | 7 +------ bmc.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bmc.c b/bmc.c index 4b435b2..3c3db82 100644 --- a/bmc.c +++ b/bmc.c @@ -21,12 +21,7 @@ #include "bmc.h" #include "ds.h" -#define A_BETTER_TOPO 2 -#define A_BETTER 1 -#define B_BETTER -1 -#define B_BETTER_TOPO -2 - -static int dscmp2(struct dataset *a, struct dataset *b) +int dscmp2(struct dataset *a, struct dataset *b) { int diff; unsigned int A = a->stepsRemoved, B = b->stepsRemoved; diff --git a/bmc.h b/bmc.h index 23e7686..30fd443 100644 --- a/bmc.h +++ b/bmc.h @@ -24,6 +24,11 @@ #include "port.h" #include "fsm.h" +#define A_BETTER_TOPO 2 +#define A_BETTER 1 +#define B_BETTER -1 +#define B_BETTER_TOPO -2 + /** * BMC state decision algorithm. * @param c The local clock. @@ -44,4 +49,10 @@ enum port_state bmc_state_decision(struct clock *c, struct port *r, */ int dscmp(struct dataset *a, struct dataset *b); +/** + * Second part of the data set comparison algorithm, not for general + * public use. + */ +int dscmp2(struct dataset *a, struct dataset *b); + #endif