diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-30 18:47:02 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-30 18:47:02 +0000 |
commit | 3b6c1aba8481917ec21730e293e339a1c561e02c (patch) | |
tree | 644bf6495a2288a41254929c3f9f68c9d0210a85 /perlio.c | |
parent | c2fcde81f9cb1a632422e27a9e967bc087d75ae7 (diff) | |
download | perl-3b6c1aba8481917ec21730e293e339a1c561e02c.tar.gz |
Fewer naked char constants.
p4raw-id: //depot/perl@20957
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -288,7 +288,7 @@ PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd, return PerlIO_tmpfile(); else { char *name = SvPV_nolen(*args); - if (*mode == '#') { + if (*mode == IoTYPE_NUMERIC) { fd = PerlLIO_open3(name, imode, perm); if (fd >= 0) return PerlIO_fdopen(fd, (char *) mode + 1); @@ -1960,7 +1960,7 @@ PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab) if (tab->Set_ptrcnt != NULL) l->flags |= PERLIO_F_FASTGETS; if (mode) { - if (*mode == '#' || *mode == 'I') + if (*mode == IoTYPE_NUMERIC || *mode == IoTYPE_IMPLICIT) mode++; switch (*mode++) { case 'r': @@ -2276,7 +2276,7 @@ int PerlIOUnix_oflags(const char *mode) { int oflags = -1; - if (*mode == 'I' || *mode == '#') + if (*mode == IoTYPE_IMPLICIT || *mode == IoTYPE_NUMERIC) mode++; switch (*mode) { case 'r': @@ -2408,7 +2408,7 @@ PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, } if (narg > 0) { char *path = SvPV_nolen(*args); - if (*mode == '#') + if (*mode == IoTYPE_NUMERIC) mode++; else { imode = PerlIOUnix_oflags(mode); @@ -2419,7 +2419,7 @@ PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, } } if (fd >= 0) { - if (*mode == 'I') + if (*mode == IoTYPE_IMPLICIT) mode++; if (!f) { f = PerlIO_allocate(aTHX); @@ -2707,7 +2707,7 @@ PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, else { if (narg > 0) { char *path = SvPV_nolen(*args); - if (*mode == '#') { + if (*mode == IoTYPE_NUMERIC) { mode++; fd = PerlLIO_open3(path, imode, perm); } @@ -2743,7 +2743,7 @@ PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, if (fd >= 0) { FILE *stdio = NULL; int init = 0; - if (*mode == 'I') { + if (*mode == IoTYPE_IMPLICIT) { init = 1; mode++; } @@ -3433,7 +3433,7 @@ PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, else { PerlIO_funcs *tab = PerlIO_layer_fetch(aTHX_ layers, n - 1, PerlIO_default_btm()); int init = 0; - if (*mode == 'I') { + if (*mode == IoTYPE_IMPLICIT) { init = 1; /* * mode++; |