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.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-05-17 19:27:27 +02:00
parent 6a96134eba
commit 0ca159041d
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 1 additions and 1 deletions

View File

@ -28,5 +28,5 @@ __assert_fail (char *s)
eputs ("\n");
char *fail = s;
fail = 0;
*fail = 0;
fail[0] = 0;
}