[PATCH] Factorize ROUND() redefinitions macro.

Clément Bœsch ubitux at gmail.com
Sat Dec 25 17:37:46 CET 2010


---
 command.c    |    2 --
 m_property.c |    3 +--
 mpcommon.h   |    2 ++
 mplayer.c    |    3 ---
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/command.c b/command.c
index b95b750..45472d1 100644
--- a/command.c
+++ b/command.c
@@ -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]
diff --git a/m_property.c b/m_property.c
index 8ab97d8..297e3bf 100644
--- a/m_property.c
+++ b/m_property.c
@@ -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;
diff --git a/mpcommon.h b/mpcommon.h
index 19110d6..f179267 100644
--- a/mpcommon.h
+++ b/mpcommon.h
@@ -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;
diff --git a/mplayer.c b/mplayer.c
index c0e540e..1429ff3 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -148,9 +148,6 @@ float start_volume = -1;
 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;
 
 //**************************************************************************//
-- 
1.7.3.4


--3siQDZowHQqNOShm--


More information about the MPlayer-dev-eng mailing list