On Mon, Dec 19, 2011 at 10:19:49AM +0900, Eiichiro Watanabe wrote:
>> You can write the function like this:
>>
>> function TEST()
>> int n;
>> {
>>    if (source = RTS_BGP) then {
>>      n = bgp_med + 100;
>>      if (n>= 0&&  n<  100) then
>>        bgp_med = n;
>>      else
>>        bgp_med = 4294967295;
>> }
>>
> uum..., It's strange.
> That fails on my environment.
> "bgp_med = 4294967295;" statement in line 93 also looks to fail.

I checked that and it fails in 64bit environment. You can use attached
code to fix it.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: [email protected])
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index a43f9eb..408fa93 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -129,10 +129,10 @@ include   ^{WHITE}*include{WHITE}*\".*\"{WHITE}*;
 
 0x{XIGIT}+ {
   char *e;
-  long int l;
+  unsigned long int l;
   errno = 0;
   l = strtoul(yytext+2, &e, 16);
-  if (e && *e || errno == ERANGE || (long int)(int) l != l)
+  if (e && *e || errno == ERANGE || (unsigned long int)(unsigned int) l != l)
     cf_error("Number out of range");
   cf_lval.i = l;
   return NUM;
@@ -140,10 +140,10 @@ include   ^{WHITE}*include{WHITE}*\".*\"{WHITE}*;
 
 {DIGIT}+ {
   char *e;
-  long int l;
+  unsigned long int l;
   errno = 0;
   l = strtoul(yytext, &e, 10);
-  if (e && *e || errno == ERANGE || (long int)(int) l != l)
+  if (e && *e || errno == ERANGE || (unsigned long int)(unsigned int) l != l)
     cf_error("Number out of range");
   cf_lval.i = l;
   return NUM;

Attachment: signature.asc
Description: Digital signature

Reply via email to