summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2007-12-24 06:58:20 -0800
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2007-12-25 05:22:39 +0000
commitd34ed59f585350f3dfb4fdf7eca3266cdce428a1 (patch)
treeecd4817ed4aba8b845b88d8d81a1e15784100476 /x2p
parent1f36f092f89152cd3ffb1cb9d8754c1edcc4ab53 (diff)
downloadperl-d34ed59f585350f3dfb4fdf7eca3266cdce428a1.tar.gz
Remove Nullch etc. from x2p
From: "Jan Dubois" <jand@activestate.com> Message-ID: <0cca01c84680$7afc9170$70f5b450$@com> p4raw-id: //depot/perl@32721
Diffstat (limited to 'x2p')
-rw-r--r--x2p/a2p.h9
-rw-r--r--x2p/a2py.c8
-rw-r--r--x2p/str.c6
-rw-r--r--x2p/str.h2
-rw-r--r--x2p/util.c8
-rw-r--r--x2p/walk.c8
6 files changed, 18 insertions, 23 deletions
diff --git a/x2p/a2p.h b/x2p/a2p.h
index e38e2d2bb3..750e153c60 100644
--- a/x2p/a2p.h
+++ b/x2p/a2p.h
@@ -157,9 +157,6 @@ char *strcpy(), *strcat();
# include "../handy.h"
#endif
-#undef Nullfp
-#define Nullfp Null(FILE*)
-
#define Nullop 0
#define OPROG 1
@@ -407,7 +404,7 @@ EXT FILE *rsfp;
EXT char buf[2048];
EXT char *bufptr INIT(buf);
-EXT STR *linestr INIT(Nullstr);
+EXT STR *linestr INIT(NULL);
EXT char tokenbuf[2048];
EXT int expectterm INIT(TRUE);
@@ -423,7 +420,7 @@ extern int yydebug;
# endif
#endif
-EXT STR *freestrroot INIT(Nullstr);
+EXT STR *freestrroot INIT(NULL);
EXT STR str_no;
EXT STR str_yes;
@@ -447,7 +444,7 @@ EXT bool saw_altinput INIT(FALSE);
EXT bool nomemok INIT(FALSE);
EXT char const_FS INIT(0);
-EXT char *namelist INIT(Nullch);
+EXT char *namelist INIT(NULL);
EXT char fswitch INIT(0);
EXT bool old_awk INIT(0);
diff --git a/x2p/a2py.c b/x2p/a2py.c
index b6497afdb1..84fdc48737 100644
--- a/x2p/a2py.c
+++ b/x2p/a2py.c
@@ -117,7 +117,7 @@ main(register int argc, register const char **argv, register const char **env)
/* open script */
- if (argv[0] == Nullch) {
+ if (argv[0] == NULL) {
#if defined(OS2) || defined(WIN32) || defined(NETWARE)
if ( isatty(fileno(stdin)) )
usage();
@@ -132,7 +132,7 @@ main(register int argc, register const char **argv, register const char **env)
rsfp = stdin;
else
rsfp = fopen(argv[0],"r");
- if (rsfp == Nullfp)
+ if (rsfp == NULL)
fatal("Awk script \"%s\" doesn't seem to exist.\n",filename);
/* init tokener */
@@ -253,10 +253,10 @@ yylex(void)
if (!rsfp)
RETURN(0);
line++;
- if ((s = str_gets(linestr, rsfp)) == Nullch) {
+ if ((s = str_gets(linestr, rsfp)) == NULL) {
if (rsfp != stdin)
fclose(rsfp);
- rsfp = Nullfp;
+ rsfp = NULL;
s = str_get(linestr);
RETURN(0);
}
diff --git a/x2p/str.c b/x2p/str.c
index 3909f5bf2d..58798c011f 100644
--- a/x2p/str.c
+++ b/x2p/str.c
@@ -185,7 +185,7 @@ str_gets(register STR *str, register FILE *fp)
* buffer, so we getc() it back out and stuff it in the buffer.
*/
i = getc(fp);
- if (i == EOF) return Nullch;
+ if (i == EOF) return NULL;
*(--((*fp)->_ptr)) = (unsigned char) i;
(*fp)->_cnt++;
#endif
@@ -239,14 +239,14 @@ thats_all_folks:
static char buf[4192];
- if (fgets(buf, sizeof buf, fp) != Nullch)
+ if (fgets(buf, sizeof buf, fp) != NULL)
str_set(str, buf);
else
str_set(str, No);
#endif /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */
- return str->str_cur ? str->str_ptr : Nullch;
+ return str->str_cur ? str->str_ptr : NULL;
}
STR *
diff --git a/x2p/str.h b/x2p/str.h
index 98e354c3b4..7fc8e1e3b4 100644
--- a/x2p/str.h
+++ b/x2p/str.h
@@ -19,8 +19,6 @@ struct string {
char str_nok; /* state of str_nval */
};
-#define Nullstr Null(STR*)
-
/* the following macro updates any magic values this str is associated with */
#define STABSET(x) (x->str_link.str_magic && stabset(x->str_link.str_magic,x))
diff --git a/x2p/util.c b/x2p/util.c
index aff3f00873..464dd8f5e9 100644
--- a/x2p/util.c
+++ b/x2p/util.c
@@ -32,7 +32,7 @@ safemalloc(MEM_SIZE size)
fprintf(stderr,"0x%lx: (%05d) malloc %ld bytes\n",(unsigned long)ptr,
an++,(long)size);
#endif
- if (ptr != Nullch)
+ if (ptr != NULL)
return ptr;
else {
fputs(nomem,stdout) FLUSH;
@@ -57,7 +57,7 @@ saferealloc(Malloc_t where, MEM_SIZE size)
fprintf(stderr,"0x%lx: (%05d) realloc %ld bytes\n",(unsigned long)ptr,an++,(long)size);
}
#endif
- if (ptr != Nullch)
+ if (ptr != NULL)
return ptr;
else {
fputs(nomem,stdout) FLUSH;
@@ -127,14 +127,14 @@ instr(char *big, const char *little)
for (t = big; *t; t++) {
for (x=t,s=little; *s; x++,s++) {
if (!*x)
- return Nullch;
+ return NULL;
if (*s != *x)
break;
}
if (!*s)
return t;
}
- return Nullch;
+ return NULL;
}
/* copy a string to a safe spot */
diff --git a/x2p/walk.c b/x2p/walk.c
index cc9f8ac74c..ef754c59df 100644
--- a/x2p/walk.c
+++ b/x2p/walk.c
@@ -23,7 +23,7 @@ const char *lparen;
const char *rparen;
const char *limit;
STR *subs;
-STR *curargs = Nullstr;
+STR *curargs = NULL;
static void addsemi ( STR *str );
static void emit_split ( STR *str, int level );
@@ -741,10 +741,10 @@ sub Pick {\n\
str_cat(curargs,",");
tmp2str=walk(1,level,ops[node+5].ival,&numarg,P_MIN);
str_free(curargs);
- curargs = Nullstr;
+ curargs = NULL;
level--;
subretnum |= numarg;
- s = Nullch;
+ s = NULL;
t = tmp2str->str_ptr;
while ((t = instr(t,"return ")))
s = t++;
@@ -1516,7 +1516,7 @@ sub Pick {\n\
}
}
else {
- str = Nullstr;
+ str = NULL;
}
break;
}