summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarmink <armink.ztl@gmail.com>2018-03-21 10:21:29 +0800
committerDamien George <damien.p.george@gmail.com>2018-04-10 13:54:22 +1000
commit6a693db71d032518dedc50731376c15bebe6cec9 (patch)
tree39566c0bfe8ecb3ca5964656c66a8b347b1b52bf
parentcf31d384f1d2ca09f817f154892eaa6860c10144 (diff)
extmod/re1.5: Fix compilecode.c compile problem on IAR tool chain.
The 2nd and 3rd args of the ternary operator are treated like they are in the same expression and must have similar types. void is not compatible with int so that's why the compiler is complaining.
-rw-r--r--extmod/re1.5/compilecode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/re1.5/compilecode.c b/extmod/re1.5/compilecode.c
index 3267a4190..a685a508a 100644
--- a/extmod/re1.5/compilecode.c
+++ b/extmod/re1.5/compilecode.c
@@ -5,9 +5,9 @@
#include "re1.5.h"
#define INSERT_CODE(at, num, pc) \
- ((code ? memmove(code + at + num, code + at, pc - at) : (void)0), pc += num)
+ ((code ? memmove(code + at + num, code + at, pc - at) : 0), pc += num)
#define REL(at, to) (to - at - 2)
-#define EMIT(at, byte) (code ? (code[at] = byte) : (void)(at))
+#define EMIT(at, byte) (code ? (code[at] = byte) : (at))
#define PC (prog->bytelen)
static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)