Commit 89e2dceb authored by Nils Goroll's avatar Nils Goroll

fix forgotten VCL_INT limits

we missed to change these when we changed the VCL_INT typedef from long
to int64_t

Should we add VCL_INT_MAX / VCL_INT_MIN (and for the other integer
types, respectively)?
parent a720dc82
......@@ -81,7 +81,7 @@ vmod_integer(VRT_CTX, VCL_STRING p, VCL_INT i)
return (i);
r = trunc(r);
if (r > LONG_MAX || r < LONG_MIN)
if (r > INT64_MAX || r < INT64_MIN)
return (i);
return ((VCL_INT)r);
......@@ -158,7 +158,7 @@ vmod_real2integer(VRT_CTX, VCL_REAL r, VCL_INT i)
if (!isfinite(r))
return (i);
r = round(r);
if (r > LONG_MAX || r < LONG_MIN)
if (r > INT64_MAX || r < INT64_MIN)
return(i);
return ((VCL_INT)r);
}
......@@ -182,7 +182,7 @@ vmod_time2integer(VRT_CTX, VCL_TIME t, VCL_INT i)
if (!isfinite(t))
return (i);
t = round(t);
if (t > LONG_MAX || t < LONG_MIN)
if (t > INT64_MAX || t < INT64_MIN)
return(i);
return ((VCL_INT)t);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment