From 482bf6150109082d5b3f93aca376c4ca258a597c Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 2 Oct 2019 14:47:24 -0600 Subject: op.c, doop.c Use mnemonics instead of numeric values For legibility and maintainability --- doop.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'doop.c') diff --git a/doop.c b/doop.c index 483d261845..4e9a8a3d17 100644 --- a/doop.c +++ b/doop.c @@ -175,9 +175,9 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl) if (p != d - 1 || *p != *d) p = d++; } - else if (ch == -1) /* -1 is unmapped character */ + else if (ch == (short) TR_UNMAPPED) *d++ = *s; - else if (ch == -2) /* -2 is delete character */ + else if (ch == (short) TR_DELETE) matches++; s++; } @@ -189,9 +189,9 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl) matches++; *d++ = (U8)ch; } - else if (ch == -1) /* -1 is unmapped character */ + else if (ch == (short) TR_UNMAPPED) *d++ = *s; - else if (ch == -2) /* -2 is delete character */ + else if (ch == (short) TR_DELETE) matches++; s++; } @@ -233,14 +233,14 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl) s += len; continue; } - else if (sch == -1) { /* -1 is unmapped character */ + else if (sch == (short) TR_UNMAPPED) { Move(s, d, len, U8); d += len; } - else if (sch == -2) /* -2 is delete character */ + else if (sch == (short) TR_DELETE) matches++; else { - assert(sch == -3); /* -3 is empty replacement */ + assert(sch == (short) TR_R_EMPTY); /* empty replacement */ ch = comp; goto replace; } -- cgit v1.2.1