changeset 32664:6d08af681d54

Factorize ROUND() redefinitions macro.
author cboesch
date Mon, 03 Jan 2011 19:39:31 +0000
parents 83c490a2e9f3
children f0ce228d7323
files command.c m_property.c mpcommon.h mplayer.c
diffstat 4 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Mon Jan 03 18:37:45 2011 +0000
+++ b/command.c	Mon Jan 03 19:39:31 2011 +0000
@@ -70,8 +70,6 @@
 #include "libavutil/avstring.h"
 #include "edl.h"
 
-#define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
-
 static void rescale_input_coordinates(int ix, int iy, double *dx, double *dy)
 {
     //remove the borders, if any, and rescale to the range [0,1],[0,1]
--- a/m_property.c	Mon Jan 03 18:37:45 2011 +0000
+++ b/m_property.c	Mon Jan 03 19:39:31 2011 +0000
@@ -30,10 +30,9 @@
 #include "m_option.h"
 #include "m_property.h"
 #include "mp_msg.h"
+#include "mpcommon.h"
 #include "help_mp.h"
 
-#define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
-
 static int do_action(const m_option_t* prop_list, const char* name,
                      int action, void* arg, void *ctx) {
     const char* sep;
--- a/mpcommon.h	Mon Jan 03 18:37:45 2011 +0000
+++ b/mpcommon.h	Mon Jan 03 19:39:31 2011 +0000
@@ -25,6 +25,8 @@
 #include "libmpdemux/demuxer.h"
 #include "sub/ass_mp.h"
 
+#define ROUND(x) ((int)((x) < 0 ? (x) - 0.5 : (x) + 0.5))
+
 struct sh_video;
 
 extern double sub_last_pts;
--- a/mplayer.c	Mon Jan 03 18:37:45 2011 +0000
+++ b/mplayer.c	Mon Jan 03 19:39:31 2011 +0000
@@ -148,9 +148,6 @@
 double start_pts = MP_NOPTS_VALUE;
 char *heartbeat_cmd;
 
-#define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
-
-
 m_config_t* mconfig;
 
 //**************************************************************************//