From: Harlan Stenn Date: Sat, 1 Dec 2012 10:43:56 +0000 (+0000) Subject: Use an enum for the ACTS state table X-Git-Tag: NTP_4_2_7P329~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a485c5a2d768ee442a912d0687f737b569dfa27;p=thirdparty%2Fntp.git Use an enum for the ACTS state table bk: 50b9df6ccmgmqUgkpmenCTkagmIhEQ --- diff --git a/ChangeLog b/ChangeLog index c9c6e7964..eed7d6278 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ * [Bug 2278] ACTS flag3 mismatch between code and driver18.html. +* Use an enum for the ACTS state table. (4.2.7p306) 2012/09/15 Released by Harlan Stenn * [Bug 752] ToS cleanup from Mike Tatarinov. (4.2.7p305) 2012/09/15 Released by Harlan Stenn diff --git a/ntpd/refclock_acts.c b/ntpd/refclock_acts.c index 9c2e178bd..18bc477cb 100644 --- a/ntpd/refclock_acts.c +++ b/ntpd/refclock_acts.c @@ -194,10 +194,12 @@ const char *modem_setup = def_modem_setup; /* * State machine codes */ -#define S_IDLE 0 /* wait for poll */ -#define S_SETUP 1 /* send modem setup */ -#define S_CONNECT 2 /* wait for answer */ -#define S_MSG 3 /* wait for timecode */ +typedef enum { + S_IDLE, /* wait for poll */ + S_SETUP, /* send modem setup */ + S_CONNECT, /* wait for answer */ + S_MSG /* wait for timecode */ +} teModemState; /* * Unit control structure @@ -222,7 +224,7 @@ static void acts_receive (struct recvbuf *); static void acts_message (struct peer *, const char *); static void acts_timecode (struct peer *, const char *); static void acts_poll (int, struct peer *); -static void acts_timeout (struct peer *, int); +static void acts_timeout (struct peer *, teModemState); static void acts_timer (int, struct peer *); static void acts_close (struct peer *); @@ -458,7 +460,7 @@ acts_message( static void acts_timeout( struct peer *peer, - int dstate + teModemState dstate ) { struct actsunit *up;