[PATCH] Factorize ROUND() redefinitions macro
Hi, ROUND() is redefined in a few places in the code, so here is a patch to factorize them in mpcommon.h. Is it the correct place to put it? I don't see any macro in it so… -- Clément B. Not sent from a jesusPhone.
On Sat, Dec 25, 2010 at 05:41:22PM +0100, Clément Bœsch wrote:
Hi,
ROUND() is redefined in a few places in the code, so here is a patch to factorize them in mpcommon.h. Is it the correct place to put it? I don't see any macro in it so…
Since no one seems to have opinion on this, I'll apply it in the next days. -- Clément B. Not sent from a jesusPhone.
On Sat, Dec 25, 2010 at 05:41:22PM +0100, Clément Bœsch wrote:
ROUND() is redefined in a few places in the code, so here is a patch to factorize them in mpcommon.h. Is it the correct place to put it? I don't see any macro in it so…
I don't know a better place offhand, so mpcommon.h should do for now.
--- a/mpcommon.h +++ b/mpcommon.h @@ -25,6 +25,8 @@
+#define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
This would be slightly more readable with spaces around the operators. Apply anytime. Diego
On Mon, Jan 03, 2011 at 08:29:28PM +0100, Diego Biurrun wrote:
On Sat, Dec 25, 2010 at 05:41:22PM +0100, Clément Bœsch wrote:
ROUND() is redefined in a few places in the code, so here is a patch to factorize them in mpcommon.h. Is it the correct place to put it? I don't see any macro in it so…
I don't know a better place offhand, so mpcommon.h should do for now.
Ok.
--- a/mpcommon.h +++ b/mpcommon.h @@ -25,6 +25,8 @@
+#define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
This would be slightly more readable with spaces around the operators.
Sure, fixed.
Apply anytime.
Done. Thank for the review. -- Clément B. Not sent from a jesusPhone.
participants (2)
-
Clément Bœsch -
Diego Biurrun