From e24d8a55fb7eb6c75bb7e16a962c3bc57436ca52 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Wed, 21 Sep 2016 14:03:52 +0200 Subject: [PATCH] [liba] Update the size_t type definition size_t must be an unsigned it. Moreover, by definition, size_t is the return type of the "sizeof" operator, which is defined by the compiler. Both GCC and clang define a __SIZE_TYPE__ macro to let the libc header know about the type used by the sizeof operator. Change-Id: Ie44f1ba69fe2b1d5ce5cd9a0e7fd8a7f10c1199d --- liba/include/stddef.h | 2 +- poincare/src/commutative_operation.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/liba/include/stddef.h b/liba/include/stddef.h index 1cc1637b5..170ece5b8 100644 --- a/liba/include/stddef.h +++ b/liba/include/stddef.h @@ -2,6 +2,6 @@ #define LIBA_STDDEF_H #define NULL 0 -typedef int size_t; +typedef __SIZE_TYPE__ size_t; #endif diff --git a/poincare/src/commutative_operation.cpp b/poincare/src/commutative_operation.cpp index adab9ec08..ff99d4d88 100644 --- a/poincare/src/commutative_operation.cpp +++ b/poincare/src/commutative_operation.cpp @@ -46,7 +46,7 @@ Expression * CommutativeOperation::clone() const { float CommutativeOperation::approximate(Context& context) const { float result = m_operands[0]->approximate(context); - for (size_t i=1; iapproximate(context); result = this->operateApproximatevelyOn(result, next); }