diff options
author | ajs <ajs> | 2005-11-16 19:33:22 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-11-16 19:33:22 +0000 |
commit | 70cd34749f3c57d6f67ab31a9552c46afe437553 (patch) | |
tree | cbb09a4e97d559ae0806134a94313e7352821741 | |
parent | 889e9311e5c900ce24eecf00fcb5b8b9d51bb020 (diff) |
[ospfd] Make OSPF_ISM_TIMER_OFF macro safer.
2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_ism.h: (OSPF_ISM_TIMER_OFF) Improve macro syntax by enclosing
in 'do {...} while(0)'.
-rw-r--r-- | ospfd/ChangeLog | 5 | ||||
-rw-r--r-- | ospfd/ospf_ism.h | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index 825b92c1..b33ca438 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,8 @@ +2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu> + + * ospf_ism.h: (OSPF_ISM_TIMER_OFF) Improve macro syntax by enclosing + in 'do {...} while(0)'. + 2005-11-14 Paul Jakma <paul.jakma@sun.com> * ospfd.c: (ospf_new) stub-shutdown should just default to diff --git a/ospfd/ospf_ism.h b/ospfd/ospf_ism.h index c714a15c..f0357a48 100644 --- a/ospfd/ospf_ism.h +++ b/ospfd/ospf_ism.h @@ -90,11 +90,13 @@ /* Macro for OSPF ISM timer turn off. */ #define OSPF_ISM_TIMER_OFF(X) \ - if (X) \ - { \ - thread_cancel (X); \ - (X) = NULL; \ - } + do { \ + if (X) \ + { \ + thread_cancel (X); \ + (X) = NULL; \ + } \ + } while (0) /* Macro for OSPF schedule event. */ #define OSPF_ISM_EVENT_SCHEDULE(I,E) \ |