diff options
author | Alan Modra <amodra@gmail.com> | 2014-07-26 21:00:50 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-07-26 21:00:50 +0930 |
commit | e57e6ddc2e768323732a7eed6a5d25d3ee350638 (patch) | |
tree | 0f7a4d490a72412262207a614d426f548ce8e75e /gas/frags.c | |
parent | cd9ac21580fa2e2068388d86349b8deb85eafce8 (diff) | |
download | gdb-e57e6ddc2e768323732a7eed6a5d25d3ee350638.zip gdb-e57e6ddc2e768323732a7eed6a5d25d3ee350638.tar.gz gdb-e57e6ddc2e768323732a7eed6a5d25d3ee350638.tar.bz2 |
Prepare gas for 64-bit obstacks
Use size_t in a few places involved with obstacks, and don't include
obstack.h in files that don't use obstacks.
gas/
* config/bfin-parse.y: Don't include obstack.h.
* config/obj-aout.c: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-som.c: Likewise.
* config/tc-bfin.c: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-rl78.c: Likewise.
* config/tc-rx.c: Likewise.
* config/tc-tic4x.c: Likewise.
* expr.c: Likewise.
* listing.c: Likewise.
* config/obj-elf.c (elf_file_symbol): Make name_length a size_t.
* config/tc-aarch64.c (symbol_locate): Likewise.
* config/tc-arm.c (symbol_locate): Likewise.
* config/tc-mmix.c (mmix_handle_mmixal): Make len_0 a size_t.
* config/tc-score.c (s3_build_score_ops_hsh): Make len a size_t.
(s3_build_dependency_insn_hsh): Likewise.
* config/tc-score7.c (s7_build_score_ops_hsh): Likewise.
(s7_build_dependency_insn_hsh): Likewise.
* frags.c (frag_grow): Make parameter a size_t, and use size_t locals.
(frag_new): Make parameter a size_t.
(frag_var_init): Make max_chars and var parameters size_t.
(frag_var, frag_variant): Likewise.
(frag_room): Return a size_t.
(frag_align_pattern): Make n_fill parameter a size_t.
* frags.h: Update function prototypes.
* symbols.c (save_symbol_name): Make name_length a size_t.
Diffstat (limited to 'gas/frags.c')
-rw-r--r-- | gas/frags.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/gas/frags.c b/gas/frags.c index e14099d..defa853 100644 --- a/gas/frags.c +++ b/gas/frags.c @@ -94,12 +94,12 @@ frag_alloc (struct obstack *ob) do not return. Do not set up any fields of *now_frag. */ void -frag_grow (unsigned int nchars) +frag_grow (size_t nchars) { if (obstack_room (&frchain_now->frch_obstack) < nchars) { - long oldc; - long newc; + size_t oldc; + size_t newc; /* Try to allocate a bit more than needed right now. But don't do this if we would waste too much memory. Especially necessary @@ -111,8 +111,8 @@ frag_grow (unsigned int nchars) newc += SIZEOF_STRUCT_FRAG; /* Check for possible overflow. */ - if (newc < 0) - as_fatal (_("can't extend frag %u chars"), nchars); + if (newc < nchars) + as_fatal (_("can't extend frag %lu chars"), (unsigned long) nchars); /* Force to allocate at least NEWC bytes, but not less than the default. */ @@ -152,7 +152,7 @@ frag_grow (unsigned int nchars) of frchain_now. */ void -frag_new (int old_frags_var_max_size +frag_new (size_t old_frags_var_max_size /* Number of chars (already allocated on obstack frags) in variable_length part of frag. */) { @@ -204,7 +204,7 @@ frag_new (int old_frags_var_max_size frag_now_growth past the new chars. */ char * -frag_more (int nchars) +frag_more (size_t nchars) { register char *retval; @@ -219,8 +219,8 @@ frag_more (int nchars) new frag. */ static void -frag_var_init (relax_stateT type, int max_chars, int var, - relax_substateT subtype, symbolS *symbol, offsetT offset, +frag_var_init (relax_stateT type, size_t max_chars, size_t var, + relax_substateT subtype, symbolS *symbol, offsetT offset, char *opcode) { frag_now->fr_var = var; @@ -250,8 +250,9 @@ frag_var_init (relax_stateT type, int max_chars, int var, to write into. */ char * -frag_var (relax_stateT type, int max_chars, int var, relax_substateT subtype, - symbolS *symbol, offsetT offset, char *opcode) +frag_var (relax_stateT type, size_t max_chars, size_t var, + relax_substateT subtype, symbolS *symbol, offsetT offset, + char *opcode) { register char *retval; @@ -267,7 +268,7 @@ frag_var (relax_stateT type, int max_chars, int var, relax_substateT subtype, No call to frag_grow is done. */ char * -frag_variant (relax_stateT type, int max_chars, int var, +frag_variant (relax_stateT type, size_t max_chars, size_t var, relax_substateT subtype, symbolS *symbol, offsetT offset, char *opcode) { @@ -291,7 +292,7 @@ frag_wane (register fragS *fragP) /* Return the number of bytes by which the current frag can be grown. */ -int +size_t frag_room (void) { return obstack_room (&frchain_now->frch_obstack); @@ -336,7 +337,7 @@ frag_align (int alignment, int fill_character, int max) void frag_align_pattern (int alignment, const char *fill_pattern, - int n_fill, int max) + size_t n_fill, int max) { char *p; |