* 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
+2017-05-18 Marek Polacek <polacek@redhat.com>
+
+ * 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.
+
2017-05-18 Marek Polacek <polacek@redhat.com>
* c-common.c (self_promoting_args_p): Change the return type to bool.
if (bits <= TYPE_PRECISION (intDI_type_node))
return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
- return 0;
+ return NULL_TREE;
}
/* Return a fixed-point type that has at least IBIT ibits and FBIT fbits
sorry ("GCC cannot support operators with integer types and "
"fixed-point types that have too many integral and "
"fractional bits together");
- return 0;
+ return NULL_TREE;
}
return c_common_type_for_mode (mode, satp);
&& !!unsignedp == !!TYPE_UNSIGNED (TREE_VALUE (t)))
return TREE_VALUE (t);
- return 0;
+ return NULL_TREE;
}
tree
LOC is the location of the comparison.
- If this function returns nonzero, it means that the comparison has
+ If this function returns non-NULL_TREE, it means that the comparison has
a constant value. What this function returns is an expression for
that value. */
else if (real1 && real2
&& (DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop0)))
|| DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop1)))))
- return 0;
+ return NULL_TREE;
else if (real1 && real2
&& (TYPE_PRECISION (TREE_TYPE (primop0))
*restype_ptr = truthvalue_type_node;
- return 0;
+ return NULL_TREE;
}
\f
/* Return a tree for the sum or difference (RESULTCODE says which)
return TYPE_PRECISION (t) < TYPE_PRECISION (integer_type_node);
case BOOLEAN_TYPE:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}
pending_redefine_extname->unordered_remove (ix);
break;
}
- return 0;
+ return NULL_TREE;
}
/* Find out if we have a pending #pragma redefine_extname. */
}
/* Nada. */
- return 0;
+ return NULL_TREE;
}
+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.
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);
|| !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);
/* 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)
{
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)
{
/* 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)
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.
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.
if (funcdef_flag)
storage_class = declspecs->storage_class = csc_none;
else
- return 0;
+ return NULL_TREE;
}
}
"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
{
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. */
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
&& (constructor_elements->last ().index == field))
return constructor_elements->last ().value;
}
- return 0;
+ return NULL_TREE;
}
/* "Output" the next constructor element.
}
/* 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)