From 30869603dc5d36ad2d82cff82900c7e05a4b35c1 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 1 Feb 2010 22:00:55 +0100 Subject: janitor: match: stick to kernel-style formatting --- match/match.c | 283 ++++++++++++++++++++++++++++++++++------------------------ match/match.h | 6 -- match/test.c | 14 +-- 3 files changed, 174 insertions(+), 129 deletions(-) diff --git a/match/match.c b/match/match.c index ebeadcd..dbb14ba 100644 --- a/match/match.c +++ b/match/match.c @@ -38,13 +38,13 @@ typedef unsigned short col_t[1]; typedef unsigned short mat_t[DIM_FINGER]; -#define GET1(m, x) ((m[0]>>(x))&1U) -#define SET1(m, x) (m[0]|=(1U<<(x))) -#define CLEAR1(m, x) (m[0]&=~(1U<<(x))) +#define GET1(m, x) ((m[0] >> (x)) & 1U) +#define SET1(m, x) (m[0] |= (1U << (x))) +#define CLEAR1(m, x) (m[0] &= ~(1U << (x))) -#define GET2(m, row, col) ((m[col]>>(row))&1U) -#define SET2(m, row, col) (m[col]|=(1U<<(row))) -#define CLEAR2(m, row, col) (m[col]&=~(1U<<(row))) +#define GET2(m, row, col) ((m[col] >> (row)) & 1U) +#define SET2(m, row, col) (m[col] |= (1U << (row))) +#define CLEAR2(m, row, col) (m[col] &= ~(1U << (row))) /********************************************************/ @@ -64,11 +64,21 @@ static void buildixvector(int *ix, mat_t mstar, int nrows, int ncols) /********************************************************/ -static void step2a(int *ix, float *mdist, mat_t mstar, mat_t nmstar, mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, int dmin); -static void step2b(int *ix, float *mdist, mat_t mstar, mat_t nmstar, mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, int dmin); -static void step3(int *ix, float *mdist, mat_t mstar, mat_t nmstar, mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, int dmin); -static void step4(int *ix, float *mdist, mat_t mstar, mat_t nmstar, mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, int dmin, int row, int col); -static void step5(int *ix, float *mdist, mat_t mstar, mat_t nmstar, mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, int dmin); +static void step2a(int *ix, float *mdist, mat_t mstar, mat_t nmstar, + mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, + int dmin); +static void step2b(int *ix, float *mdist, mat_t mstar, mat_t nmstar, + mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, + int dmin); +static void step3(int *ix, float *mdist, mat_t mstar, mat_t nmstar, + mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, + int dmin); +static void step4(int *ix, float *mdist, mat_t mstar, mat_t nmstar, + mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, + int dmin, int row, int col); +static void step5(int *ix, float *mdist, mat_t mstar, mat_t nmstar, + mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols, + int dmin); static void ixoptimal(int *ix, float *mdist, int nrows, int ncols) { @@ -84,162 +94,194 @@ static void ixoptimal(int *ix, float *mdist, int nrows, int ncols) memset(nmstar, 0, sizeof(mat_t)); /* initialization */ - for(row=0; row