Skip to content

Commit

Permalink
Nullch and others were still alive and well in some of the operating
Browse files Browse the repository at this point in the history
system specific directories.  I think I've chainsawed all of them now,
but I can't guarantee that it compiles anywhere from win32.

p4raw-id: //depot/perl@32713
  • Loading branch information
smpeters committed Dec 23, 2007
1 parent dfe169e commit 4e205ed
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 103 deletions.
6 changes: 3 additions & 3 deletions NetWare/nw5.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ nw_crypt(const char *txt, const char *salt)
return des_fcrypt(txt, salt, w32_crypt_buffer);
#else
Perl_croak(aTHX_ "The crypt() function is not implemented on NetWare\n");
return Nullch;
return NULL;
#endif
}

Expand Down Expand Up @@ -1001,7 +1001,7 @@ do_spawn2(char *cmd, int exectype)
if (*s)
*s++ = '\0';
}
*a = Nullch;
*a = NULL;
if (argv[0]) {
switch (exectype) {
case EXECF_SPAWN:
Expand Down Expand Up @@ -1031,7 +1031,7 @@ do_spawn2(char *cmd, int exectype)
while (++i < nw_perlshell_items)
argv[i] = nw_perlshell_vec[i];
argv[i++] = cmd;
argv[i] = Nullch;
argv[i] = NULL;
switch (exectype) {
case EXECF_SPAWN:
status = nw_spawnvp(P_WAIT, argv[0], (char **)argv);
Expand Down
4 changes: 2 additions & 2 deletions NetWare/nwperlhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ PerlStdIOGetBase(struct IPerlStdIO* piPerl, PerlIO* pf)
FILE *f = (FILE*)pf;
return FILE_base(f);
#else
return Nullch;
return NULL;
#endif
}

Expand Down Expand Up @@ -481,7 +481,7 @@ PerlStdIOGetPtr(struct IPerlStdIO* piPerl, PerlIO* pf)
FILE *f = (FILE*)pf;
return FILE_ptr(f);
#else
return Nullch;
return NULL;
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions NetWare/nwperlsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ PerlStdIOGetBase(struct IPerlStdIO* piPerl, FILE* pf)
FILE *f = pf;
return FILE_base(f);
#else
return Nullch;
return NULL;
#endif
}

Expand Down Expand Up @@ -375,7 +375,7 @@ PerlStdIOGetPtr(struct IPerlStdIO* piPerl, FILE* pf)
FILE *f = pf;
return FILE_ptr(f);
#else
return Nullch;
return NULL;
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion NetWare/nwstdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#ifdef HAS_SETLINEBUF
#define PerlIO_setlinebuf(f) (*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
#else
#define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0)
#define PerlIO_setlinebuf(f) setvbuf(f, NULL, _IOLBF, 0)
#endif

#define PerlIO_isutf8(f) 0
Expand Down
4 changes: 2 additions & 2 deletions djgpp/djgpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ do_aspawn (pTHX_ SV *really,SV **mark,SV **sp)
*a++ = SvPVx(*mark, n_a);
else
*a++ = "";
*a = Nullch;
*a = NULL;

if (argv[0][0] != '/' && argv[0][0] != '\\'
&& !(argv[0][0] && argv[0][1] == ':'
Expand Down Expand Up @@ -204,7 +204,7 @@ do_spawn2 (pTHX_ char *cmd,int execf)
if (*s)
*s++='\0';
}
*a=Nullch;
*a=NULL;
if (!PL_Argv[0])
return -1;

Expand Down
4 changes: 2 additions & 2 deletions os2/OS2/REXX/REXX.xs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ PERLSTART(PCSZ name, ULONG argc, PRXSTRING argv, PCSZ queue, PRXSTRING ret)
static ULONG
PERLCALL(PCSZ name, ULONG argc, PRXSTRING argv, PCSZ queue, PRXSTRING ret)
{
return PERLCALLcv(name, Nullsv, argc, argv, queue, ret);
return PERLCALLcv(name, NULL, argc, argv, queue, ret);
}

RexxFunctionHandler* PF = &PERLSTART;
Expand Down Expand Up @@ -556,7 +556,7 @@ _REXX_eval_with(cmd,...)
Newx(names, n, char*);
Newx(cvs, n, SV*);
/* XXX Unfinished... */
RETVAL = Nullsv;
RETVAL = NULL;
Safefree(names);
Safefree(cvs);
}
Expand Down
26 changes: 13 additions & 13 deletions os2/os2.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ do_spawn_ve(pTHX_ SV *really, U32 flag, U32 execf, char *inicmd, U32 addflag)
if (flag == P_WAIT)
flag = P_NOWAIT;
if (really && !*(real_name = SvPV(really, n_a)))
really = Nullsv;
really = NULL;

retry:
if (strEQ(PL_Argv[0],"/bin/sh"))
Expand Down Expand Up @@ -1265,15 +1265,15 @@ do_spawn_ve(pTHX_ SV *really, U32 flag, U32 execf, char *inicmd, U32 addflag)
/* XXXX This is good only until we refuse
quoted arguments... */
PL_Argv[0] = inicmd;
PL_Argv[1] = Nullch;
PL_Argv[1] = NULL;
}
} else if (!buf[0] && inicmd) { /* No file */
/* Start with the original cmdline. */
/* XXXX This is good only until we refuse
quoted arguments... */

PL_Argv[0] = inicmd;
PL_Argv[1] = Nullch;
PL_Argv[1] = NULL;
nargs = 2; /* shell -c */
}

Expand Down Expand Up @@ -1458,7 +1458,7 @@ do_spawn3(pTHX_ char *cmd, int execf, int flag)
if (*s)
*s++ = '\0';
}
*a = Nullch;
*a = NULL;
if (PL_Argv[0])
rc = do_spawn_ve(aTHX_ NULL, flag, execf, cmd, mergestderr);
else
Expand Down Expand Up @@ -1500,7 +1500,7 @@ os2_aspawn_4(pTHX_ SV *really, register SV **args, I32 cnt, int execing)
else
*a++ = "";
}
*a = Nullch;
*a = NULL;

if ( flag_set && (a == PL_Argv + 1)
&& !really && execing == ASPAWN_WAIT ) { /* One arg? */
Expand Down Expand Up @@ -1573,7 +1573,7 @@ my_syspopen4(pTHX_ char *cmd, char *mode, I32 cnt, SV** args)
taint_proper("Insecure %s%s", "EXEC");
}
if (pipe(p) < 0)
return Nullfp;
return NULL;
/* Now we need to spawn the child. */
if (p[this] == (*mode == 'r')) { /* if fh 0/1 was initially closed. */
int new = dup(p[this]);
Expand All @@ -1592,7 +1592,7 @@ my_syspopen4(pTHX_ char *cmd, char *mode, I32 cnt, SV** args)
closepipes:
close(p[0]);
close(p[1]);
return Nullfp;
return NULL;
}
} else
fh_fl = fcntl(*mode == 'r', F_GETFD);
Expand All @@ -1605,7 +1605,7 @@ my_syspopen4(pTHX_ char *cmd, char *mode, I32 cnt, SV** args)
if (newfd != -1)
fcntl(newfd, F_SETFD, FD_CLOEXEC);
if (cnt) { /* Args: "Real cmd", before first arg, the last, execing */
pid = os2_aspawn_4(aTHX_ Nullsv, args, cnt, ASPAWN_NOWAIT);
pid = os2_aspawn_4(aTHX_ NULL, args, cnt, ASPAWN_NOWAIT);
} else
pid = do_spawn_nowait(aTHX_ cmd);
if (newfd == -1)
Expand All @@ -1620,7 +1620,7 @@ my_syspopen4(pTHX_ char *cmd, char *mode, I32 cnt, SV** args)
close(p[that]);
if (pid == -1) {
close(p[this]);
return Nullfp;
return NULL;
}
if (p[that] < p[this]) { /* Make fh as small as possible */
dup2(p[this], p[that]);
Expand Down Expand Up @@ -1879,8 +1879,8 @@ XS(XS_OS2_replaceModule)
Perl_croak(aTHX_ "Usage: OS2::replaceModule(target [, source [, backup]])");
{
char * target = (char *)SvPV_nolen(ST(0));
char * source = (items < 2) ? Nullch : (char *)SvPV_nolen(ST(1));
char * backup = (items < 3) ? Nullch : (char *)SvPV_nolen(ST(2));
char * source = (items < 2) ? NULL : (char *)SvPV_nolen(ST(1));
char * backup = (items < 3) ? NULL : (char *)SvPV_nolen(ST(2));

if (!replaceModule(target, source, backup))
croak_with_os2error("replaceModule() error");
Expand Down Expand Up @@ -2159,7 +2159,7 @@ dllname2buffer(pTHX_ char *buf, STRLEN l)
{
char *o;
STRLEN ll;
SV *dll = Nullsv;
SV *dll = NULL;

dll = module_name(mod_name_full);
o = SvPV(dll, ll);
Expand Down Expand Up @@ -4099,7 +4099,7 @@ XS(XS_OS2_pipe)
int connect = 0, count, message_r = 0, message = 0, b = 0;
ULONG ulInbufLength, ulOutbufLength, ulPipeMode, ulTimeout, rc;
STRLEN len;
char *s, buf[10], *s1, *perltype = Nullch;
char *s, buf[10], *s1, *perltype = NULL;
PerlIO *perlio;
double timeout;

Expand Down
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ Perl_my_popen_list(pTHX_ char *mode, int n, SV **args)
return PerlIO_fdopen(p[This], mode);
#else
# ifdef OS2 /* Same, without fork()ing and all extra overhead... */
return my_syspopen4(aTHX_ Nullch, mode, n, args);
return my_syspopen4(aTHX_ NULL, mode, n, args);
# else
Perl_croak(aTHX_ "List form of piped open not implemented");
return (PerlIO *) NULL;
Expand Down
8 changes: 4 additions & 4 deletions vmesa/vmesa.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ do_aspawn(SV* really, SV **mark, SV **sp)
fdMap[STDOUT_FILENO] = Perl_stdout_fd;
fdMap[STDERR_FILENO] = STDERR_FILENO;
nFd = 3;
*a = Nullch;
*a = NULL;
/*-----------------------------------------------------*/
/* Will execvp() use PATH? */
/*-----------------------------------------------------*/
Expand Down Expand Up @@ -272,7 +272,7 @@ do_spawn(char *cmd, int execf)
if (*s)
*s++ = '\0';
}
*a = Nullch;
*a = NULL;
fdMap[STDIN_FILENO] = Perl_stdin_fd;
fdMap[STDOUT_FILENO] = Perl_stdout_fd;
fdMap[STDERR_FILENO] = STDERR_FILENO;
Expand Down Expand Up @@ -421,7 +421,7 @@ my_popen(char *cmd, char *mode)
close(pFd[that]);
}
else
fd = Nullfp;
fd = NULL;
}
else
{
Expand All @@ -434,7 +434,7 @@ my_popen(char *cmd, char *mode)
}
}
else
fd = Nullfp;
fd = NULL;
return (fd);
}

Expand Down
20 changes: 10 additions & 10 deletions vms/ext/Stdio/Stdio.xs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ newFH(PerlIO *fp, char type) {
* equivalent to gv_fetchpv("VMS::Stdio::__FH__",TRUE,SVt_PVIO),
* with a little less overhead, and good exercise for me. :-) */
stashp = (GV **)hv_fetch(PL_defstash,"VMS::",5,TRUE);
if (!stashp || *stashp == (GV *)&PL_sv_undef) return Nullsv;
if (!stashp || *stashp == (GV *)&PL_sv_undef) return NULL;
if (!(stash = GvHV(*stashp))) stash = GvHV(*stashp) = newHV();
stashp = (GV **)hv_fetch(GvHV(*stashp),"Stdio::",7,TRUE);
if (!stashp || *stashp == (GV *)&PL_sv_undef) return Nullsv;
if (!stashp || *stashp == (GV *)&PL_sv_undef) return NULL;
if (!(stash = GvHV(*stashp))) stash = GvHV(*stashp) = newHV();

/* Set up GV to point to IO, and then take reference */
Expand Down Expand Up @@ -131,14 +131,14 @@ binmode(fh)
SV *name;
IO *io;
char iotype;
char filespec[NAM$C_MAXRSS], *acmode, *s, *colon, *dirend = Nullch;
char filespec[NAM$C_MAXRSS], *acmode, *s, *colon, *dirend = NULL;
int ret = 0, saverrno = errno, savevmserrno = vaxc$errno;
SV pos;
PerlIO *fp;
io = sv_2io(fh);
fp = io ? IoOFP(io) : NULL;
iotype = io ? IoTYPE(io) : '\0';
if (fp == NULL || strchr(">was+-|",iotype) == Nullch) {
if (fp == NULL || strchr(">was+-|",iotype) == NULL) {
set_errno(EBADF); set_vaxc_errno(SS$_IVCHAN); XSRETURN_UNDEF;
}
if (!PerlIO_getname(fp,filespec)) XSRETURN_UNDEF;
Expand All @@ -152,7 +152,7 @@ binmode(fh)
}
/* If we've got a non-file-structured device, clip off the trailing
* junk, and don't lose sleep if we can't get a stream position. */
if (dirend == Nullch) *(colon+1) = '\0';
if (dirend == NULL) *(colon+1) = '\0';
if (iotype != '-' && (ret = PerlIO_getpos(fp, &pos)) == -1 && dirend)
XSRETURN_UNDEF;
switch (iotype) {
Expand All @@ -174,7 +174,7 @@ binmode(fh)
}
/* appearances to the contrary, this is an freopen substitute */
name = sv_2mortal(newSVpvn(filespec,strlen(filespec)));
if (PerlIO_openn(aTHX_ Nullch,acmode,-1,0,0,fp,1,&name) == Nullfp) XSRETURN_UNDEF;
if (PerlIO_openn(aTHX_ NULL,acmode,-1,0,0,fp,1,&name) == NULL) XSRETURN_UNDEF;
if (iotype != '-' && ret != -1 && PerlIO_setpos(fp,&pos) == -1) XSRETURN_UNDEF;
if (ret == -1) { set_errno(saverrno); set_vaxc_errno(savevmserrno); }
XSRETURN_YES;
Expand Down Expand Up @@ -349,7 +349,7 @@ vmsopen(spec,...)
fp = fopen(spec,mode,args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
break;
}
if (fp != Null(FILE*)) {
if (!fp) {
pio_fp = PerlIO_fdopen(fileno(fp),mode);
fh = newFH(pio_fp,(mode[1] ? '+' : (mode[0] == 'r' ? '<' : (mode[0] == 'a' ? 'a' : '>'))));
ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef);
Expand Down Expand Up @@ -408,7 +408,7 @@ vmssysopen(spec,mode,perm,...)
}
i = mode & 3;
if (fd >= 0 &&
((pio_fp = PerlIO_fdopen(fd, &("r\000w\000r+"[2*i]))) != Null(PerlIO*))) {
((pio_fp = PerlIO_fdopen(fd, &("r\000w\000r+"[2*i]))) != NULL)) {
fh = newFH(pio_fp,"<>++"[i]);
ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef);
}
Expand All @@ -433,10 +433,10 @@ writeof(mysv)
struct dsc$descriptor devdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, devnam};
IO *io = sv_2io(mysv);
PerlIO *fp = io ? IoOFP(io) : NULL;
if (fp == NULL || strchr(">was+-|",IoTYPE(io)) == Nullch) {
if (fp == NULL || strchr(">was+-|",IoTYPE(io)) == NULL) {
set_errno(EBADF); set_vaxc_errno(SS$_IVCHAN); XSRETURN_UNDEF;
}
if (PerlIO_getname(fp,devnam) == Nullch) { ST(0) = &PL_sv_undef; XSRETURN(1); }
if (PerlIO_getname(fp,devnam) == NULL) { ST(0) = &PL_sv_undef; XSRETURN(1); }
if ((cp = strrchr(devnam,':')) != NULL) *(cp+1) = '\0';
devdsc.dsc$w_length = strlen(devnam);
retsts = sys$assign(&devdsc,&chan,0,0);
Expand Down
Loading

0 comments on commit 4e205ed

Please sign in to comment.