]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Changed TE instance check to remove -Wtype-limits warning
authorAndrew Certain <certain@amazon.com>
Tue, 4 Dec 2012 21:36:41 +0000 (13:36 -0800)
committerScott Feldman <sfeldma@cumulusnetworks.com>
Mon, 7 Jan 2013 17:59:53 +0000 (09:59 -0800)
Since LEGAL_TE_INSTANCE_RANGE() was being passed an unsigned int, a warning
was being thrown due to the compare against >= 0.  Since this macro was used
only in one place, I removed the macro for an explict compare against a
constant for the MAX.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospfd/ospf_te.c
ospfd/ospf_te.h

index 24e81052f75a96bba01947ae20fd5757d9a8779c..587564a19582020444b59a8259150a97029888de 100644 (file)
@@ -205,7 +205,7 @@ get_mpls_te_instance_value (void)
 {
   static u_int32_t seqno = 0;
 
-  if (LEGAL_TE_INSTANCE_RANGE (seqno + 1))
+  if (seqno < MAX_LEGAL_TE_INSTANCE_NUM )
     seqno += 1;
   else
     seqno  = 1; /* Avoid zero. */
index e8511cdfbf83bd2b329e7ce4ce08f39e923323e5..863d8ba8f29f04a2d5133b0ddbf3709c8ea76830 100644 (file)
@@ -41,7 +41,7 @@
  *
  */
 
-#define        LEGAL_TE_INSTANCE_RANGE(i)      (0 <= (i) && (i) <= 0xffff)
+#define        MAX_LEGAL_TE_INSTANCE_NUM (0xffff)
 
 /*
  *        24       16        8        0