From f33db40b6d851315dd2ef9b89c732a0c0d7f8e80 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 20 Oct 2019 19:27:27 +0200 Subject: [PATCH] mescc: Mes C Library: Prepare for M2-Planet: __assert_fail. Rewrite C-constructs not supported by M2-Planet, such as foo ? bar : baz; -> if (foo) bar; else baz; static char foo[1024] -> __func_buf = malloc (1024); ... char *foo = __func_buf; *foo -> foo[0] foo++ -> foo = foo + 1 TODO: pointer arithmetic foo += 1; -> foo = foo + 1 for (int foo = ; -> int foo; for (foo= if (foo) -> if (foo != 0) if (!foo) -> if (foo == 0) ; -> 0; * lib/mes/__assert_fail.c: Rewrite C-constructs not supported by M2-Planet. --- lib/mes/__assert_fail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mes/__assert_fail.c b/lib/mes/__assert_fail.c index 39ea594a..c4dda5c7 100644 --- a/lib/mes/__assert_fail.c +++ b/lib/mes/__assert_fail.c @@ -28,5 +28,5 @@ __assert_fail (char *s) eputs ("\n"); char *fail = s; fail = 0; - *fail = 0; + fail[0] = 0; }