From: Andrew Certain Date: Tue, 4 Dec 2012 21:36:41 +0000 (-0800) Subject: ospfd: Changed TE instance check to remove -Wtype-limits warning X-Git-Tag: frr-2.0-rc1~1724^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=703819a9314692f3a3b7f888887b0cebc15c18ae;p=mirror%2Ffrr.git ospfd: Changed TE instance check to remove -Wtype-limits warning 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 --- diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c index 24e81052f7..587564a195 100644 --- a/ospfd/ospf_te.c +++ b/ospfd/ospf_te.c @@ -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. */ diff --git a/ospfd/ospf_te.h b/ospfd/ospf_te.h index e8511cdfbf..863d8ba8f2 100644 --- a/ospfd/ospf_te.h +++ b/ospfd/ospf_te.h @@ -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