summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-10-02 14:47:24 -0600
committerKarl Williamson <khw@cpan.org>2019-11-06 21:22:24 -0700
commit482bf6150109082d5b3f93aca376c4ca258a597c (patch)
tree356e3d108bbfc6e4050157f2470fd53719c48556 /doop.c
parentf534d5462959256391e14ee587e98cbc036c9e4a (diff)
downloadperl-482bf6150109082d5b3f93aca376c4ca258a597c.tar.gz
op.c, doop.c Use mnemonics instead of numeric values
For legibility and maintainability
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c14
1 files changed, 7 insertions, 7 deletions
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;
}