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 <richardcochran@gmail.com>
master
Richard Cochran 2017-02-14 17:22:02 +01:00
parent 1b3ef0d195
commit dc1b7c66c6
2 changed files with 12 additions and 6 deletions

7
bmc.c
View File

@ -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;

11
bmc.h
View File

@ -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