]> granicus.if.org Git - libvpx/commitdiff
Make the round() replacement match C99 and POSIX.
authorAlex Converse <aconverse@google.com>
Sat, 8 Aug 2015 01:24:21 +0000 (18:24 -0700)
committerAlex Converse <aconverse@google.com>
Sat, 8 Aug 2015 01:24:21 +0000 (18:24 -0700)
http://pubs.opengroup.org/onlinepubs/009695399/functions/round.html

Change-Id: Idf387d944d36bf593f8797db9053e11e5c9b9b39

vp9/common/vp9_systemdependent.h

index fc77762def57fac7cc6467cd914fe67a81821c25..3c5062f85b1ba5227d685bad8847bc930b0664ae 100644 (file)
@@ -35,11 +35,11 @@ void vpx_reset_mmx_state(void);
 
 #if defined(_MSC_VER) && _MSC_VER < 1800
 // round is not defined in MSVC before VS2013.
-static INLINE int round(double x) {
+static INLINE double round(double x) {
   if (x < 0)
-    return (int)ceil(x - 0.5);
+    return ceil(x - 0.5);
   else
-    return (int)floor(x + 0.5);
+    return floor(x + 0.5);
 }
 #endif