]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Use an enum for the ACTS state table
authorHarlan Stenn <stenn@ntp.org>
Sat, 1 Dec 2012 10:43:56 +0000 (10:43 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sat, 1 Dec 2012 10:43:56 +0000 (10:43 +0000)
bk: 50b9df6ccmgmqUgkpmenCTkagmIhEQ

ChangeLog
ntpd/refclock_acts.c

index c9c6e7964b102f367534d9c6f9b2b98d2b876bd2..eed7d62789fe6ba0a242de24cf4258b158845abf 100644 (file)
--- 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 <stenn@ntp.org>
 * [Bug 752] ToS cleanup from Mike Tatarinov.
 (4.2.7p305) 2012/09/15 Released by Harlan Stenn <stenn@ntp.org>
index 9c2e178bd8c28bb2edaa50b511eae1be896a3223..18bc477cbbe632e5b10fec9ecb5a1c9f5d1dc104 100644 (file)
@@ -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;