aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2017-05-18 11:26:25 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2017-05-18 11:26:25 +0000
commit6574d78eeac0e1ecddb05c6df33fa1b77e712bf6 (patch)
tree600b21f9ed1f2db68f3d2b824355badd73f5fe57 /gcc/c
parent8b656ca7ea26bb53e6058c10c0016e080c39930c (diff)
downloadgcc-6574d78eeac0e1ecddb05c6df33fa1b77e712bf6.zip
gcc-6574d78eeac0e1ecddb05c6df33fa1b77e712bf6.tar.gz
gcc-6574d78eeac0e1ecddb05c6df33fa1b77e712bf6.tar.bz2
c-common.c (c_common_type_for_size): Use NULL_TREE instead of 0.
* c-common.c (c_common_type_for_size): Use NULL_TREE instead of 0. (c_common_fixed_point_type_for_size): Likewise. (c_common_type_for_mode): Likewise. (shorten_compare): Likewise. (c_promoting_integer_type_p): Use false/true instead of 0/1. * c-pragma.c (maybe_apply_renaming_pragma): Use NULL_TREE instead of 0. * c-decl.c (match_builtin_function_types): Use NULL_TREE instead of 0. (check_earlier_gotos): Likewise. (define_label): Likewise. (pending_xref_error): Likewise. (smallest_type_quals_location): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (identifier_global_value): Likewise. * c-typeck.c (set_nonincremental_init_from_string): Likewise. (find_init_member): Likewise. From-SVN: r248195
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog13
-rw-r--r--gcc/c/c-decl.c26
-rw-r--r--gcc/c/c-typeck.c6
3 files changed, 30 insertions, 15 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 4dbeedf..1f572a7 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,5 +1,18 @@
2017-05-18 Marek Polacek <polacek@redhat.com>
+ * c-decl.c (match_builtin_function_types): Use NULL_TREE instead of 0.
+ (check_earlier_gotos): Likewise.
+ (define_label): Likewise.
+ (pending_xref_error): Likewise.
+ (smallest_type_quals_location): Likewise.
+ (grokdeclarator): Likewise.
+ (grokparms): Likewise.
+ (identifier_global_value): Likewise.
+ * c-typeck.c (set_nonincremental_init_from_string): Likewise.
+ (find_init_member): Likewise.
+
+2017-05-18 Marek Polacek <polacek@redhat.com>
+
* c-decl.c (start_decl): Use false/true instead of 0/1.
(grokdeclarator): Likewise.
(finish_struct): Likewise.
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 52d89f8..da1e2c4 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -1630,7 +1630,7 @@ match_builtin_function_types (tree newtype, tree oldtype)
newrettype = TREE_TYPE (newtype);
if (TYPE_MODE (oldrettype) != TYPE_MODE (newrettype))
- return 0;
+ return NULL_TREE;
oldargs = TYPE_ARG_TYPES (oldtype);
newargs = TYPE_ARG_TYPES (newtype);
@@ -1644,7 +1644,7 @@ match_builtin_function_types (tree newtype, tree oldtype)
|| !TREE_VALUE (newargs)
|| TYPE_MODE (TREE_VALUE (oldargs))
!= TYPE_MODE (TREE_VALUE (newargs)))
- return 0;
+ return NULL_TREE;
oldargs = TREE_CHAIN (oldargs);
newargs = TREE_CHAIN (newargs);
@@ -3755,7 +3755,7 @@ check_earlier_gotos (tree label, struct c_label_vars* label_vars)
/* Define a label, specifying the location in the source file.
Return the LABEL_DECL node for the label, if the definition is valid.
- Otherwise return 0. */
+ Otherwise return NULL_TREE. */
tree
define_label (location_t location, tree name)
@@ -3774,7 +3774,7 @@ define_label (location_t location, tree name)
{
error_at (location, "duplicate label %qD", label);
locate_old_decl (label);
- return 0;
+ return NULL_TREE;
}
else if (label && DECL_CONTEXT (label) == current_function_decl)
{
@@ -3971,7 +3971,7 @@ pending_xref_error (void)
/* Look up NAME in the current scope and its superiors
in the namespace of variables, functions and typedefs.
Return a ..._DECL node of some kind representing its definition,
- or return 0 if it is undefined. */
+ or return NULL_TREE if it is undefined. */
tree
lookup_name (tree name)
@@ -5516,7 +5516,7 @@ smallest_type_quals_location (const location_t *locations,
determine the name and type of the object declared
and construct a ..._DECL node for it.
(In one case we can return a ..._TYPE node instead.
- For invalid input we sometimes return 0.)
+ For invalid input we sometimes return NULL_TREE.)
DECLSPECS is a c_declspecs structure for the declaration specifiers.
@@ -5662,7 +5662,7 @@ grokdeclarator (const struct c_declarator *declarator,
a function declarator. */
if (funcdef_flag && !funcdef_syntax)
- return 0;
+ return NULL_TREE;
/* If this looks like a function definition, make it one,
even if it occurs where parms are expected.
@@ -6833,7 +6833,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (funcdef_flag)
storage_class = declspecs->storage_class = csc_none;
else
- return 0;
+ return NULL_TREE;
}
}
@@ -7073,20 +7073,22 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
"function declaration isn%'t a prototype");
if (arg_types == error_mark_node)
- return 0; /* don't set TYPE_ARG_TYPES in this case */
+ /* Don't set TYPE_ARG_TYPES in this case. */
+ return NULL_TREE;
else if (arg_types && TREE_CODE (TREE_VALUE (arg_types)) == IDENTIFIER_NODE)
{
if (!funcdef_flag)
{
- pedwarn (input_location, 0, "parameter names (without types) in function declaration");
+ pedwarn (input_location, 0, "parameter names (without types) in "
+ "function declaration");
arg_info->parms = NULL_TREE;
}
else
arg_info->parms = arg_info->types;
arg_info->types = NULL_TREE;
- return 0;
+ return NULL_TREE;
}
else
{
@@ -9599,7 +9601,7 @@ identifier_global_value (tree t)
if (B_IN_FILE_SCOPE (b) || B_IN_EXTERNAL_SCOPE (b))
return b->decl;
- return 0;
+ return NULL_TREE;
}
/* In C, the only C-linkage public declaration is at file scope. */
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 96f7a5c..25b7dd6 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -8774,7 +8774,7 @@ set_nonincremental_init_from_string (tree str,
constructor_incremental = 0;
}
-/* Return value of FIELD in pending initializer or zero if the field was
+/* Return value of FIELD in pending initializer or NULL_TREE if the field was
not initialized yet. */
static tree
@@ -8826,7 +8826,7 @@ find_init_member (tree field, struct obstack * braced_init_obstack)
&& (constructor_elements->last ().index == field))
return constructor_elements->last ().value;
}
- return 0;
+ return NULL_TREE;
}
/* "Output" the next constructor element.
@@ -14007,7 +14007,7 @@ c_build_va_arg (location_t loc1, tree expr, location_t loc2, tree type)
}
/* Return truthvalue of whether T1 is the same tree structure as T2.
- Return 1 if they are the same. Return 0 if they are different. */
+ Return 1 if they are the same. Return false if they are different. */
bool
c_tree_equal (tree t1, tree t2)