This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Return NULL_TREE instead of 0 where appropriate in the C++ frontend


The following patch replaces "return 0;" by "return NULL_TREE;"
in functions that have "tree" as return type.
(These are the only places in the C++ frontend where we didn't
return NULL_TREE AFAICS).

Btw, there are some places (maybe 10 or so) where we have "return 0"
in a function that returns a pointer to some struct. Should I change
these to "return NULL" for readability, too?

Bootstrapped and regtested on x86_64-unknown-linux-gnu.
Ok for mainline?

Regards,
Volker

:ADDPATCH C++:


2006-02-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	* decl.c (grokdeclarator): Return NULL_TREE instead of 0.
	* typeck.c (unary_complex_lvalue): Likewise.

===================================================================
--- gcc/gcc/cp/decl.c	(revision 110738)
+++ gcc/gcc/cp/decl.c	(working copy)
@@ -6815,7 +6815,7 @@
      a function declarator.  */
 
   if (funcdef_flag && innermost_code != cdk_function)
-    return 0;
+    return NULL_TREE;
 
   if (((dname && IDENTIFIER_OPNAME_P (dname)) || flags == TYPENAME_FLAG)
       && innermost_code != cdk_function
===================================================================
--- gcc/gcc/cp/typeck.c	(revision 110738)
+++ gcc/gcc/cp/typeck.c	(working copy)
@@ -4343,7 +4343,7 @@
     }
 
   if (code != ADDR_EXPR)
-    return 0;
+    return NULL_TREE;
 
   /* Handle (a = b) used as an "lvalue" for `&'.  */
   if (TREE_CODE (arg) == MODIFY_EXPR
@@ -4384,7 +4384,7 @@
   }
 
   /* Don't let anything else be handled specially.  */
-  return 0;
+  return NULL_TREE;
 }
 
 /* Mark EXP saying that we need to be able to take the
===================================================================



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]