gengtype.h (obstack_chunk_alloc, [...]): Remove cast.

gcc/
	* gengtype.h (obstack_chunk_alloc, obstack_chunk_free): Remove cast.
	* coretypes.h (obstack_chunk_alloc, obstack_chunk_free): Likewise.
	(gcc_obstack_init): Use obstack_specify_allocation in place of
	_obstack_begin.
	* genautomata.c (next_sep_el): Cast result of obstack_base to (char *).
	(regexp_representation): Likewise.
	* godump.c (go_output_type): Likewise.
gcc/java/
	* mangle.c (finish_mangling): Cast result of obstack_base to (char *).
	* typeck.c (build_java_argument_signature): Likewise.
	(build_java_signature): Likewise.
gcc/objc/
	* objc-encoding.c (encode_array): Cast result of obstack_base.
	(encode_type): Likewise.
libcpp/
	* symtab.c (ht_create): Use obstack_specify_allocation in place of
	_obstack_begin.
	* files.c (_cpp_init_files): Likewise.
	* init.c (cpp_create_reader): Likewise.
	* identifiers.c (_cpp_init_hashtable): Likewise.

From-SVN: r216539
This commit is contained in:
Alan Modra 2014-10-22 12:11:31 +10:30
parent 1fb38e450e
commit 19a9ba64e7
15 changed files with 105 additions and 83 deletions

View File

@ -1,3 +1,13 @@
2014-10-22 Alan Modra <amodra@gmail.com>
* gengtype.h (obstack_chunk_alloc, obstack_chunk_free): Remove cast.
* coretypes.h (obstack_chunk_alloc, obstack_chunk_free): Likewise.
(gcc_obstack_init): Use obstack_specify_allocation in place of
_obstack_begin.
* genautomata.c (next_sep_el): Cast result of obstack_base to (char *).
(regexp_representation): Likewise.
* godump.c (go_output_type): Likewise.
2014-10-21 John David Anglin <danglin@gcc.gnu.org>
* config.gcc: Remove MASK_JUMP_IN_DELAY from target_cpu_default2.

View File

@ -176,11 +176,11 @@ struct basic_block_def;
typedef struct basic_block_def *basic_block;
typedef const struct basic_block_def *const_basic_block;
#define obstack_chunk_alloc ((void *(*) (long)) xmalloc)
#define obstack_chunk_free ((void (*) (void *)) free)
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
#define OBSTACK_CHUNK_SIZE 0
#define gcc_obstack_init(OBSTACK) \
_obstack_begin ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \
obstack_specify_allocation ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \
obstack_chunk_alloc, \
obstack_chunk_free)

View File

@ -1178,7 +1178,7 @@ next_sep_el (const char **pstr, int sep, int par_flag)
}
}
obstack_1grow (&irp, '\0');
out_str = obstack_base (&irp);
out_str = (char *) obstack_base (&irp);
obstack_finish (&irp);
*pstr = p;
@ -6873,7 +6873,7 @@ regexp_representation (regexp_t regexp)
{
form_regexp (regexp);
obstack_1grow (&irp, '\0');
return obstack_base (&irp);
return (char *) obstack_base (&irp);
}
/* The function frees memory allocated for last formed string
@ -9312,7 +9312,7 @@ initiate_automaton_gen (char **argv)
obstack_grow (&irp, STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX,
strlen (STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX) + 1);
obstack_1grow (&irp, '\0');
output_description_file_name = obstack_base (&irp);
output_description_file_name = (char *) obstack_base (&irp);
obstack_finish (&irp);
}

View File

@ -20,8 +20,8 @@
#ifndef GCC_GENGTYPE_H
#define GCC_GENGTYPE_H
#define obstack_chunk_alloc ((void *(*) (long)) xmalloc)
#define obstack_chunk_free ((void (*) (void *)) free)
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
#define OBSTACK_CHUNK_SIZE 0
/* Sets of accepted source languages like C, C++, Ada... are

View File

@ -920,7 +920,7 @@ go_output_type (struct godump_container *container)
ob = &container->type_obstack;
obstack_1grow (ob, '\0');
fputs (obstack_base (ob), go_dump_file);
fputs ((char *) obstack_base (ob), go_dump_file);
obstack_free (ob, obstack_base (ob));
}

View File

@ -1,3 +1,9 @@
2014-10-22 Alan Modra <amodra@gmail.com>
* mangle.c (finish_mangling): Cast result of obstack_base to (char *).
* typeck.c (build_java_argument_signature): Likewise.
(build_java_signature): Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* class.c: Adjust include files.

View File

@ -711,7 +711,7 @@ finish_mangling (void)
compression_table = NULL_TREE;
compression_next = 0;
obstack_1grow (mangle_obstack, '\0');
result = get_identifier (obstack_base (mangle_obstack));
result = get_identifier ((char *) obstack_base (mangle_obstack));
obstack_free (mangle_obstack, obstack_base (mangle_obstack));
return result;

View File

@ -477,7 +477,7 @@ build_java_argument_signature (tree type)
}
obstack_1grow (&temporary_obstack, '\0');
sig = get_identifier (obstack_base (&temporary_obstack));
sig = get_identifier ((char *) obstack_base (&temporary_obstack));
TYPE_ARGUMENT_SIGNATURE (type) = sig;
obstack_free (&temporary_obstack, obstack_base (&temporary_obstack));
}
@ -554,7 +554,7 @@ build_java_signature (tree type)
obstack_grow0 (&temporary_obstack,
IDENTIFIER_POINTER (t), IDENTIFIER_LENGTH (t));
sig = get_identifier (obstack_base (&temporary_obstack));
sig = get_identifier ((char *) obstack_base (&temporary_obstack));
obstack_free (&temporary_obstack,
obstack_base (&temporary_obstack));
}

View File

@ -1,3 +1,8 @@
2014-10-22 Alan Modra <amodra@gmail.com>
* objc-encoding.c (encode_array): Cast result of obstack_base.
(encode_type): Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* objc-act.c: Adjust include files.
@ -1728,8 +1733,8 @@
flag to objc_add_method.
(objc_add_method): Add optional methods to new chain in
the protocol class.
* objc/objc-act.h (CLASS_OPTIONAL_CLS_METHODS,
CLASS_OPTIONAL_NST_METHODS): New macros accessing a protocol
* objc/objc-act.h (CLASS_OPTIONAL_CLS_METHODS)
(CLASS_OPTIONAL_NST_METHODS): New macros accessing a protocol
class's optional method chains.
2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>

View File

@ -380,7 +380,7 @@ encode_array (tree type, int curtype, int format)
identifier.
*/
{
char *enc = obstack_base (&util_obstack) + curtype;
char *enc = (char *) obstack_base (&util_obstack) + curtype;
if (memchr (enc, '=',
obstack_object_size (&util_obstack) - curtype) == NULL)
{
@ -729,7 +729,7 @@ encode_type (tree type, int curtype, int format)
to be rearranged for compatibility with gcc-3.3. */
if (code == POINTER_TYPE && obstack_object_size (&util_obstack) >= 3)
{
char *enc = obstack_base (&util_obstack) + curtype;
char *enc = (char *) obstack_base (&util_obstack) + curtype;
/* Rewrite "in const" from "nr" to "rn". */
if (curtype >= 1 && !strncmp (enc - 1, "nr", 2))

View File

@ -1,3 +1,11 @@
2014-10-22 Alan Modra <amodra@gmail.com>
* symtab.c (ht_create): Use obstack_specify_allocation in place of
_obstack_begin.
* files.c (_cpp_init_files): Likewise.
* init.c (cpp_create_reader): Likewise.
* identifiers.c (_cpp_init_hashtable): Likewise.
2014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
* include/line-map.h (linemap_location_from_macro_expansion_p):

View File

@ -1282,9 +1282,8 @@ _cpp_init_files (cpp_reader *pfile)
pfile->nonexistent_file_hash = htab_create_alloc (127, htab_hash_string,
nonexistent_file_hash_eq,
NULL, xcalloc, free);
_obstack_begin (&pfile->nonexistent_file_ob, 0, 0,
(void *(*) (long)) xmalloc,
(void (*) (void *)) free);
obstack_specify_allocation (&pfile->nonexistent_file_ob, 0, 0,
xmalloc, free);
}
/* Finalize everything in this source file. */

View File

@ -54,9 +54,7 @@ _cpp_init_hashtable (cpp_reader *pfile, cpp_hash_table *table)
table = ht_create (13); /* 8K (=2^13) entries. */
table->alloc_node = alloc_node;
_obstack_begin (&pfile->hash_ob, 0, 0,
(void *(*) (long)) xmalloc,
(void (*) (void *)) free);
obstack_specify_allocation (&pfile->hash_ob, 0, 0, xmalloc, free);
}
table->pfile = pfile;

View File

@ -262,9 +262,7 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table,
_cpp_expand_op_stack (pfile);
/* Initialize the buffer obstack. */
_obstack_begin (&pfile->buffer_ob, 0, 0,
(void *(*) (long)) xmalloc,
(void (*) (void *)) free);
obstack_specify_allocation (&pfile->buffer_ob, 0, 0, xmalloc, free);
_cpp_init_files (pfile);

View File

@ -61,9 +61,7 @@ ht_create (unsigned int order)
table = XCNEW (cpp_hash_table);
/* Strings need no alignment. */
_obstack_begin (&table->stack, 0, 0,
(void *(*) (long)) xmalloc,
(void (*) (void *)) free);
obstack_specify_allocation (&table->stack, 0, 0, xmalloc, free);
obstack_alignment_mask (&table->stack) = 0;