summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--options/m_option.h2
-rw-r--r--player/javascript.c4
-rw-r--r--video/out/dither.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/options/m_option.h b/options/m_option.h
index 63a0002279..f179c75494 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -600,7 +600,7 @@ extern const char m_option_path_separator;
#define OPTDEF_FLOAT(f) .defval = (void *)&(const float){f}
#define OPTDEF_DOUBLE(d) .defval = (void *)&(const double){d}
-#define M_RANGE(a, b) .min = (a), .max = (b)
+#define M_RANGE(a, b) .min = (double) (a), .max = (double) (b)
#define OPT_BOOL(field) \
OPT_TYPED_FIELD(m_option_type_bool, bool, field)
diff --git a/player/javascript.c b/player/javascript.c
index 95774c4651..a43f38753b 100644
--- a/player/javascript.c
+++ b/player/javascript.c
@@ -1071,7 +1071,7 @@ static int get_obj_properties(void *ta_ctx, char ***keys, js_State *J, int idx)
static bool same_as_int64(double d)
{
// The range checks also validly filter inf and nan, so behavior is defined
- return d >= INT64_MIN && d <= INT64_MAX && d == (int64_t)d;
+ return d >= INT64_MIN && d <= (double) INT64_MAX && d == (int64_t)d;
}
static int jsL_checkint(js_State *J, int idx)
@@ -1085,7 +1085,7 @@ static int jsL_checkint(js_State *J, int idx)
static uint64_t jsL_checkuint64(js_State *J, int idx)
{
double d = js_tonumber(J, idx);
- if (!(d >= 0 && d <= UINT64_MAX))
+ if (!(d >= 0 && d <= (double) UINT64_MAX))
js_error(J, "uint64 out of range at index %d", idx);
return d;
}
diff --git a/video/out/dither.c b/video/out/dither.c
index cf8fbf3fd4..f8fba735d3 100644
--- a/video/out/dither.c
+++ b/video/out/dither.c
@@ -71,7 +71,7 @@ static void makegauss(struct ctx *k, unsigned int sizeb)
for (unsigned int c = 0; c < k->size2; c++)
k->gauss[c] = 0;
- double sigma = -log(1.5 / UINT64_MAX * gauss_size2) / k->gauss_radius;
+ double sigma = -log(1.5 / (double) UINT64_MAX * gauss_size2) / k->gauss_radius;
for (unsigned int gy = 0; gy <= k->gauss_radius; gy++) {
for (unsigned int gx = 0; gx <= gy; gx++) {
@@ -79,7 +79,7 @@ static void makegauss(struct ctx *k, unsigned int sizeb)
int cy = (int)gy - k->gauss_radius;
int sq = cx * cx + cy * cy;
double e = exp(-sqrt(sq) * sigma);
- uint64_t v = e / gauss_size2 * UINT64_MAX;
+ uint64_t v = e / gauss_size2 * (double) UINT64_MAX;
k->gauss[XY(k, gx, gy)] =
k->gauss[XY(k, gy, gx)] =
k->gauss[XY(k, gx, gauss_size - 1 - gy)] =