summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-07-03 13:31:56 -0500
committerSteve Hay <SteveHay@planit.com>2005-07-04 12:30:50 +0000
commitb64e5050699224c037d91354e38766884caa0910 (patch)
tree38f329ba2a365c8eec6078887704f6e2c59562c6 /util.c
parentc941fb51a763b50ea8ceb343cf253ac80c4ca160 (diff)
downloadperl-b64e5050699224c037d91354e38766884caa0910.tar.gz
Post-YAPC consting, now with an attachment!
Message-ID: <20050703233156.GA20967@petdance.com> p4raw-id: //depot/perl@25067
Diffstat (limited to 'util.c')
-rw-r--r--util.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/util.c b/util.c
index 6ef7a0175f..4c2d6640ef 100644
--- a/util.c
+++ b/util.c
@@ -3265,23 +3265,19 @@ Perl_my_fflush_all(pTHX)
void
Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
{
- const char *func =
+ const char * const func =
op == OP_READLINE ? "readline" : /* "<HANDLE>" not nice */
op == OP_LEAVEWRITE ? "write" : /* "write exit" not nice */
PL_op_desc[op];
- const char *pars = OP_IS_FILETEST(op) ? "" : "()";
- const char *type = OP_IS_SOCKET(op)
+ const char * const pars = OP_IS_FILETEST(op) ? "" : "()";
+ const char * const type = OP_IS_SOCKET(op)
|| (gv && io && IoTYPE(io) == IoTYPE_SOCKET)
? "socket" : "filehandle";
- const char *name = NULL;
-
- if (gv && isGV(gv)) {
- name = GvENAME(gv);
- }
+ const char * const name = gv && isGV(gv) ? GvENAME(gv) : NULL;
if (op == OP_phoney_OUTPUT_ONLY || op == OP_phoney_INPUT_ONLY) {
if (ckWARN(WARN_IO)) {
- const char *direction = (op == OP_phoney_INPUT_ONLY) ? "in" : "out";
+ const char * const direction = (op == OP_phoney_INPUT_ONLY) ? "in" : "out";
if (name && *name)
Perl_warner(aTHX_ packWARN(WARN_IO),
"Filehandle %s opened only for %sput",