[patch]real2int std_vmod function.
Geoff Simmons
geoff at uplex.de
Wed Aug 12 23:23:21 CEST 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 8/12/15 5:16 PM, Arianna Aondio wrote:
> Hi, as discussed this afternoon on IRC with Federico, here is a
> patch for a std_vmod function for converting from real to int.
+VCL_INT __match_proto__(td_std_time2real)
+vmod_real2integer(VRT_CTX, VCL_REAL r)
+{
+ CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
+
+ return((long)floor(r));
+}
Do we have to worry about what happens if r is non-finite (+-Inf or
NaN)? (Is that possible for a VCL_REAL?)
Best,
Geoff
- --
UPLEX Systemoptimierung
Scheffelstraße 32
22301 Hamburg
http://uplex.de/
Mob: +49-176-63690917
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
iQIcBAEBCAAGBQJVy7lIAAoJEOUwvh9pJNURnRgP/1sW9vHr3Eq/sG2aicckF+/6
51YEhwtziG70BJHy1ph2b7bB2KXps7WfiT30EOVCCNjr0tvGrp/bvUpZHd0G9MGq
h9HhSpk13yZtA0TkNjWjyn89hHy52SSY0ksmTS2hP8EbB0SP7+RPAQUf7jApsvwI
DohjnL6We1/cxnnsdojMG1JAAWBJpD6/jHxadgV5wQ1J1yXzW5KxYP3+7Myp+aks
MN0XQjLi5bAoAj10Mc4UAeho3IGuSTqbqaI+YHNG+0izgJaXLo56B04bxCZQeG/b
mpgOGbCl2xuCWPgYGBV5F6IMGs804BXphAt/U6eG+g+ja5AEsE15dKlE85sPyiql
L8JtdRuYOu1d87gIm4ittH1EBrKz+wwD5Im/v8VGev8wC00p2sLZTRxTfpZiRacf
AZ5Dg4GPQ25gzl/zk6p+Ym/AhN/hkTMjgB3TzBAP79VHaA2lrT1zHWPML7skHQvS
nBu6bA7ElrMjOHYSo0nLGZvWHSf2Lq2UFri2qr+RxTa44puclgcD+BMyTfR3X+aw
KEi0iGBk5ejLwpnxQ62cUBWL6vGBXOKjqxf/hhS/5hsbspTQSO9w9kDbieXJhHKV
IxkyZ4Zavr4AuuVKc48HcrgdejfOCetM3uzLr7glnGcsIWzmJT5VkWjGzWOqUqms
3BQR1vMXBwZSs/SsAbDY
=bvX0
-----END PGP SIGNATURE-----
More information about the varnish-dev
mailing list