On 10/12/2015 08:17 AM, Oleh Krehel wrote: > Quoting the Emacs sources: > > # define MIN(a,b) ((a) < (b) ? (a) : (b)) > #define streq(X, Y) (*(X) == *(Y) && strcmp ((X) + 1, (Y) + 1) == 0) > #define SET_FLAG(F, FLAG) ((F) |= (FLAG)) > #define HAS_FLAG(F, FLAG) (((F) & (FLAG)) != 0) > #define xnew(n, Type) ((Type *) xmalloc ((n) * sizeof (Type))) > #define xrnew(op, n, Type) ((op) = (Type *) xrealloc (op, (n) * sizeof (Type))) > #define switch_line_buffers() (curndx = 1 - curndx) > #define curlinepos (lbs[curndx].linepos) > #define BVAR(buf, field) ((buf)->field ## _) > > Some of these can be replaced with plain type checked C++ Only BVAR belongs to the Emacs core. The other macros belong to auxiliary executables that presumably would be unaffected by any rewrite of the core. Anyway, for fun I just now replaced streq, SET_FLAG, and HAS_FLAG with functions, in the attached patch. More work needs to be done in this area but one step at a time....