aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2017-06-17 14:28:42 +0200
committerGravatar wm4 <wm4@nowhere>2017-06-17 14:28:42 +0200
commitaa690e3997a086da82bbf4de76284002ecf8c950 (patch)
tree8cf762f08c7b05dbb293340997b0c84d806d7e1f
parent1e074a85f9f772f355cf4f906749393692cf4698 (diff)
javascript: replace custom MIN macro with MPMIN
-rw-r--r--player/javascript.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/player/javascript.c b/player/javascript.c
index 8522328c41..b00e4eda64 100644
--- a/player/javascript.c
+++ b/player/javascript.c
@@ -47,8 +47,6 @@
#include "client.h"
#include "libmpv/client.h"
-#define MIN(a,b) ((a)<(b)?(a):(b))
-
// List of builtin modules and their contents as strings.
// All these are generated from player/javascript/*.js
static const char *const builtin_files[][3] = {
@@ -320,7 +318,7 @@ static void af_push_file(js_State *J, const char *fname, int limit, void *af)
const char *builtin = get_builtin_file(filename);
if (builtin) {
- js_pushlstring(J, builtin, MIN(limit, strlen(builtin)));
+ js_pushlstring(J, builtin, MPMIN(limit, strlen(builtin)));
return;
}
@@ -329,7 +327,7 @@ static void af_push_file(js_State *J, const char *fname, int limit, void *af)
js_error(J, "cannot open file: '%s'", filename);
add_af_file(af, f);
- int len = MIN(limit, 32 * 1024); // initial allocation, size*2 strategy
+ int len = MPMIN(limit, 32 * 1024); // initial allocation, size*2 strategy
int got = 0;
char *s = NULL;
while ((s = talloc_realloc(af, s, char, len))) {
@@ -344,7 +342,7 @@ static void af_push_file(js_State *J, const char *fname, int limit, void *af)
js_error(J, "cannot read data from file: '%s'", filename);
got = got + r;
- len = MIN(limit, len * 2);
+ len = MPMIN(limit, len * 2);
}
js_error(J, "cannot allocate %d bytes for file: '%s'", len, filename);