From a817a0c057447a2068073fd99c30fc8732266e57 Mon Sep 17 00:00:00 2001 From: fredrikbryntesson Date: Mon, 15 Jun 2015 12:50:20 +0200 Subject: [PATCH] Added parenthesis around size to make it possible to use addition and subtraction in expression when allocating array. --- sdk/lang/Array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lang/Array.h b/sdk/lang/Array.h index c133068f..c98ced3c 100644 --- a/sdk/lang/Array.h +++ b/sdk/lang/Array.h @@ -13,7 +13,7 @@ #include -#define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc(size * sizeof(type)) }); +#define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc((size) * sizeof(type)) }); #define _lang_array__Array_get(array, index, type) ( \ (index < 0 || index >= array.length) ? \