From c1a65654d772e7528fa8a9adf89ac201ba4a09b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 25 Sep 2017 15:04:44 +0200 Subject: [PATCH] [poincare] Clean Macro in integer Change-Id: I0e9ebe49921269b3812e9e7a1f496465e52738aa --- poincare/src/integer.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/poincare/src/integer.cpp b/poincare/src/integer.cpp index e98192dfd..195d47571 100644 --- a/poincare/src/integer.cpp +++ b/poincare/src/integer.cpp @@ -9,12 +9,9 @@ extern "C" { #include "layout/string_layout.h" #include -#define MAX(a,b) ((a)>(b)?a:b) - namespace Poincare { - -// Helper functions +static inline int max(int x, int y) { return (x>y ? x : y); } uint8_t log2(Integer::native_uint_t v) { constexpr int nativeUnsignedIntegerBitCount = 8*sizeof(Integer::native_uint_t); @@ -251,7 +248,7 @@ int8_t Integer::ucmp(const Integer & a, const Integer & b) { } Integer Integer::usum(const Integer & a, const Integer & b, bool subtract, bool outputNegative) { - uint16_t size = MAX(a.m_numberOfDigits, b.m_numberOfDigits); + uint16_t size = max(a.m_numberOfDigits, b.m_numberOfDigits); if (!subtract) { // Addition can overflow size += 1;