diff options
author | wm4 <wm4@nowhere> | 2014-05-10 10:34:11 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-10 10:44:16 +0200 |
commit | 3c322b10221a18d83b55fbfdfe5d4e59e27772f7 (patch) | |
tree | 1c4c9a07b42139cec0285b9414109260ab0a0933 | |
parent | fc385baf021921d478e23f5a12c5e0d9f27e5368 (diff) | |
download | mpv-3c322b10221a18d83b55fbfdfe5d4e59e27772f7.tar.bz2 mpv-3c322b10221a18d83b55fbfdfe5d4e59e27772f7.tar.xz |
common: change MP_NOPTS_VALUE definition
Use the exact floating point value, instead of a broken integer
constant. The expression calculating the constant probably relied on
undefined behavior, because it left-shifts a negative value.
This also changes the type of the constant to double, which is perfectly
fine, and maybe better than an integer constant.
-rw-r--r-- | common/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/common.h b/common/common.h index 564d1f3ea0..6c759e9258 100644 --- a/common/common.h +++ b/common/common.h @@ -27,8 +27,8 @@ #include "compat/compiler.h" #include "talloc.h" -// both int64_t and double should be able to represent this exactly -#define MP_NOPTS_VALUE (-1LL<<63) +// double should be able to represent this exactly +#define MP_NOPTS_VALUE (-0x1p+63) #define MP_CONCAT_(a, b) a ## b #define MP_CONCAT(a, b) MP_CONCAT_(a, b) |