Commit 7d71283c by Kaveh R. Ghazi Committed by Kaveh Ghazi

ada-tree.h (SET_TYPE_LANG_SPECIFIC, [...]): Fix -Wc++-compat warnings.

	* ada-tree.h (SET_TYPE_LANG_SPECIFIC, SET_DECL_LANG_SPECIFIC): Fix
	-Wc++-compat warnings.
	* adaint.c (__gnat_locate_regular_file, __gnat_locate_exec,
	__gnat_locate_exec_on_path): Likewise.
	* decl.c (annotate_value): Likewise.
	* misc.c (gnat_handle_option): Likewise.
	* trans.c (gnat_to_gnu, extract_encoding, decode_name,
	post_error_ne_tree): Likewise.

From-SVN: r137192
parent 5ead67f6
2008-06-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ada-tree.h (SET_TYPE_LANG_SPECIFIC, SET_DECL_LANG_SPECIFIC): Fix
-Wc++-compat warnings.
* adaint.c (__gnat_locate_regular_file, __gnat_locate_exec,
__gnat_locate_exec_on_path): Likewise.
* decl.c (annotate_value): Likewise.
* misc.c (gnat_handle_option): Likewise.
* trans.c (gnat_to_gnu, extract_encoding, decode_name,
post_error_ne_tree): Likewise.
2008-06-27 Eric Botcazou <ebotcazou@adacore.com>
* utils.c (convert) <CONSTRUCTOR>: When converting it to a packable
......@@ -39,7 +39,7 @@ struct lang_type GTY(()) {tree t; };
#define SET_TYPE_LANG_SPECIFIC(NODE, X) \
(TYPE_LANG_SPECIFIC (NODE) \
= (TYPE_LANG_SPECIFIC (NODE) \
? TYPE_LANG_SPECIFIC (NODE) : ggc_alloc (sizeof (struct lang_type)))) \
? TYPE_LANG_SPECIFIC (NODE) : GGC_NEW (struct lang_type))) \
->t = X;
#define GET_DECL_LANG_SPECIFIC(NODE) \
......@@ -47,7 +47,7 @@ struct lang_type GTY(()) {tree t; };
#define SET_DECL_LANG_SPECIFIC(NODE, VALUE) \
(DECL_LANG_SPECIFIC (NODE) \
= (DECL_LANG_SPECIFIC (NODE) \
? DECL_LANG_SPECIFIC (NODE) : ggc_alloc (sizeof (struct lang_decl)))) \
? DECL_LANG_SPECIFIC (NODE) : GGC_NEW (struct lang_decl))) \
->t = VALUE;
/* Flags added to GCC type nodes. */
......
......@@ -2147,7 +2147,7 @@ char *
__gnat_locate_regular_file (char *file_name, char *path_val)
{
char *ptr;
char *file_path = alloca (strlen (file_name) + 1);
char *file_path = (char *) alloca (strlen (file_name) + 1);
int absolute;
/* Return immediately if file_name is empty */
......@@ -2196,7 +2196,7 @@ __gnat_locate_regular_file (char *file_name, char *path_val)
{
/* The result has to be smaller than path_val + file_name. */
char *file_path = alloca (strlen (path_val) + strlen (file_name) + 2);
char *file_path = (char *) alloca (strlen (path_val) + strlen (file_name) + 2);
for (;;)
{
......@@ -2245,7 +2245,7 @@ __gnat_locate_exec (char *exec_name, char *path_val)
if (!strstr (exec_name, HOST_EXECUTABLE_SUFFIX))
{
char *full_exec_name
= alloca (strlen (exec_name) + strlen (HOST_EXECUTABLE_SUFFIX) + 1);
= (char *) alloca (strlen (exec_name) + strlen (HOST_EXECUTABLE_SUFFIX) + 1);
strcpy (full_exec_name, exec_name);
strcat (full_exec_name, HOST_EXECUTABLE_SUFFIX);
......@@ -2298,7 +2298,7 @@ __gnat_locate_exec_on_path (char *exec_name)
char *path_val = getenv ("PATH");
#endif
if (path_val == NULL) return NULL;
apath_val = alloca (strlen (path_val) + 1);
apath_val = (char *) alloca (strlen (path_val) + 1);
strcpy (apath_val, path_val);
return __gnat_locate_exec (exec_name, apath_val);
#endif
......
......@@ -6774,7 +6774,7 @@ annotate_value (tree gnu_size)
/* Save the result in the cache. */
if (h)
{
*h = ggc_alloc (sizeof (struct tree_int_map));
*h = GGC_NEW (struct tree_int_map);
(*h)->base.from = gnu_size;
(*h)->to = ret;
}
......
......@@ -232,7 +232,7 @@ gnat_handle_option (size_t scode, const char *arg, int value)
switch (code)
{
case OPT_I:
q = xmalloc (sizeof("-I") + strlen (arg));
q = XNEWVEC (char, sizeof("-I") + strlen (arg));
strcpy (q, "-I");
strcat (q, arg);
gnat_argv[gnat_argc] = q;
......@@ -289,7 +289,7 @@ gnat_handle_option (size_t scode, const char *arg, int value)
case OPT_gnat:
/* Recopy the switches without the 'gnat' prefix. */
gnat_argv[gnat_argc] = xmalloc (strlen (arg) + 2);
gnat_argv[gnat_argc] = XNEWVEC (char, strlen (arg) + 2);
gnat_argv[gnat_argc][0] = '-';
strcpy (gnat_argv[gnat_argc] + 1, arg);
gnat_argc++;
......
......@@ -3273,7 +3273,7 @@ gnat_to_gnu (Node_Id gnat_node)
int i;
char *string;
if (length >= ALLOCA_THRESHOLD)
string = xmalloc (length + 1); /* in case of large strings */
string = XNEWVEC (char, length + 1); /* in case of large strings */
else
string = (char *) alloca (length + 1);
......@@ -6922,7 +6922,7 @@ set_expr_location_from_node (tree node, Node_Id gnat_node)
static const char *
extract_encoding (const char *name)
{
char *encoding = ggc_alloc (strlen (name));
char *encoding = GGC_NEWVEC (char, strlen (name));
get_encoding (name, encoding);
......@@ -6934,7 +6934,7 @@ extract_encoding (const char *name)
static const char *
decode_name (const char *name)
{
char *decoded = ggc_alloc (strlen (name) * 2 + 60);
char *decoded = GGC_NEWVEC (char, strlen (name) * 2 + 60);
__gnat_decode (name, decoded, 0);
......@@ -6998,7 +6998,7 @@ post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, int n)
void
post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t)
{
char *newmsg = alloca (strlen (msg) + 1);
char *newmsg = XALLOCAVEC (char, strlen (msg) + 1);
String_Template temp = {1, 0};
Fat_Pointer fp;
char start_yes, end_yes, start_no, end_no;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment