Change 32721 by [EMAIL PROTECTED] on 2007/12/25 05:22:39

        Subject: [PATCH] Remove Nullch etc. from x2p
        From: "Jan Dubois" <[EMAIL PROTECTED]>
        Date: Mon, 24 Dec 2007 14:58:20 -0800
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/x2p/a2p.h#26 edit
... //depot/perl/x2p/a2py.c#24 edit
... //depot/perl/x2p/str.c#22 edit
... //depot/perl/x2p/str.h#15 edit
... //depot/perl/x2p/util.c#21 edit
... //depot/perl/x2p/walk.c#26 edit

Differences ...

==== //depot/perl/x2p/a2p.h#26 (text) ====
Index: perl/x2p/a2p.h
--- perl/x2p/a2p.h#25~32690~    2007-12-21 06:48:22.000000000 -0800
+++ perl/x2p/a2p.h      2007-12-24 21:22:39.000000000 -0800
@@ -157,9 +157,6 @@
 #  include "../handy.h"
 #endif
 
-#undef Nullfp
-#define Nullfp Null(FILE*)
-
 #define Nullop 0
 
 #define OPROG          1
@@ -407,7 +404,7 @@
 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 @@
 # 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 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);
 

==== //depot/perl/x2p/a2py.c#24 (text) ====
Index: perl/x2p/a2py.c
--- perl/x2p/a2py.c#23~32690~   2007-12-21 06:48:22.000000000 -0800
+++ perl/x2p/a2py.c     2007-12-24 21:22:39.000000000 -0800
@@ -117,7 +117,7 @@
 
     /* 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 @@
        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 @@
        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);
        }

==== //depot/perl/x2p/str.c#22 (text) ====
Index: perl/x2p/str.c
--- perl/x2p/str.c#21~32690~    2007-12-21 06:48:22.000000000 -0800
+++ perl/x2p/str.c      2007-12-24 21:22:39.000000000 -0800
@@ -185,7 +185,7 @@
      * 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 @@
 
     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 *

==== //depot/perl/x2p/str.h#15 (text) ====
Index: perl/x2p/str.h
--- perl/x2p/str.h#14~32690~    2007-12-21 06:48:22.000000000 -0800
+++ perl/x2p/str.h      2007-12-24 21:22:39.000000000 -0800
@@ -19,8 +19,6 @@
     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))

==== //depot/perl/x2p/util.c#21 (text) ====
Index: perl/x2p/util.c
--- perl/x2p/util.c#20~32690~   2007-12-21 06:48:22.000000000 -0800
+++ perl/x2p/util.c     2007-12-24 21:22:39.000000000 -0800
@@ -32,7 +32,7 @@
        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 @@
        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 @@
     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 */

==== //depot/perl/x2p/walk.c#26 (text) ====
Index: perl/x2p/walk.c
--- perl/x2p/walk.c#25~32690~   2007-12-21 06:48:22.000000000 -0800
+++ perl/x2p/walk.c     2007-12-24 21:22:39.000000000 -0800
@@ -23,7 +23,7 @@
 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 @@
        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 @@
            }
        }
        else {
-           str = Nullstr;
+           str = NULL;
        }
        break;
     }
End of Patch.

Reply via email to