diff options
-rw-r--r-- | x2p/a2p.h | 9 | ||||
-rw-r--r-- | x2p/a2py.c | 8 | ||||
-rw-r--r-- | x2p/str.c | 6 | ||||
-rw-r--r-- | x2p/str.h | 2 | ||||
-rw-r--r-- | x2p/util.c | 8 | ||||
-rw-r--r-- | x2p/walk.c | 8 |
6 files changed, 18 insertions, 23 deletions
@@ -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); } @@ -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 * @@ -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; } |