disable OM2.3.1 by default, enable with make bertw OM231=1
[nedit-bw.git] / parse_y-macro-cleanup.patch
blob5f8313ac688cf579f21d15e29bb943fbcfcd26ad
1 Subject: parse.y: macro cleanup
3 ---
5 source/parse.y | 33 ++++++++++++++++++++++++++++-----
6 1 file changed, 28 insertions(+), 5 deletions(-)
8 diff --quilt old/source/parse.y new/source/parse.y
9 --- old/source/parse.y
10 +++ new/source/parse.y
11 @@ -27,15 +27,38 @@
12 #ifdef HAVE_DEBUG_H
13 #include "../debug.h"
14 #endif
16 /* Macros to add error processing to AddOp and AddSym calls */
17 -#define ADD_OP(op) if (!AddOp(op, &ErrMsg)) return 1
18 -#define ADD_SYM(sym) if (!AddSym(sym, &ErrMsg)) return 1
19 -#define ADD_IMMED(val) if (!AddImmediate(val, &ErrMsg)) return 1
20 -#define ADD_BR_OFF(to) if (!AddBranchOffset(to, &ErrMsg)) return 1
21 -#define SET_BR_OFF(from, to) ((from)->value) = ((Inst *)(to)) - ((Inst *)(from))
22 +#define ADD_OP(op) \
23 + do { \
24 + if (!AddOp(op, &ErrMsg)) { \
25 + return 1; \
26 + } \
27 + } while (0)
28 +#define ADD_SYM(sym) \
29 + do { \
30 + if (!AddSym(sym, &ErrMsg)) { \
31 + return 1; \
32 + } \
33 + } while (0)
34 +#define ADD_IMMED(val) \
35 + do { \
36 + if (!AddImmediate(val, &ErrMsg)) { \
37 + return 1; \
38 + } \
39 + } while (0)
40 +#define ADD_BR_OFF(to) \
41 + do { \
42 + if (!AddBranchOffset(to, &ErrMsg)) { \
43 + return 1; \
44 + } \
45 + } while (0)
46 +#define SET_BR_OFF(from, to) \
47 + do { \
48 + ((from)->value) = ((Inst *)(to)) - ((Inst *)(from)); \
49 + } while (0)
51 /* Max. length for a string constant (... there shouldn't be a maximum) */
52 #define MAX_STRING_CONST_LEN 5000
54 static const char CVSID[] = "$Id: parse.y,v 1.29 2007/01/12 16:17:42 tringali Exp $";