};
/* Keep track of different sized allocation requests. */
-static alloc_info_t alloc_counts[(int) alloc_type_last];
+static alloc_info_t alloc_counts[alloc_type_last];
\f
/* Record whether we have seen any debugging information. */
int ecoff_debugging_seen = 0;
#endif
new_links->datum = allocate_page ();
- alloc_counts[(int) alloc_type_varray].total_alloc++;
- alloc_counts[(int) alloc_type_varray].total_pages++;
+ alloc_counts[alloc_type_varray].total_alloc++;
+ alloc_counts[alloc_type_varray].total_pages++;
new_links->start_index = vp->num_allocated;
vp->objects_last_page = 0;
psym->sym_index = -1;
memset (&psym->ecoff_sym, 0, sizeof (EXTR));
psym->ecoff_sym.asym.value = value;
- psym->ecoff_sym.asym.st = (unsigned) type;
- psym->ecoff_sym.asym.sc = (unsigned) storage;
+ psym->ecoff_sym.asym.st = type;
+ psym->ecoff_sym.asym.sc = storage;
psym->ecoff_sym.asym.index = indx;
/* If there is an associated symbol, we wait until the end of the
as_fatal (_("too many st_End's"));
else
{
- st_t begin_type = (st_t) pscope->lsym->ecoff_sym.asym.st;
+ st_t begin_type = pscope->lsym->ecoff_sym.asym.st;
psym->begin_ptr = pscope->lsym;
vp = &cur_file_ptr->aux_syms;
memset (&aux, 0, sizeof (aux));
- aux.ti.bt = (int) t->basic_type;
+ aux.ti.bt = t->basic_type;
aux.ti.continued = 0;
aux.ti.fBitfield = t->bitfield;
- aux.ti.tq0 = (int) t->type_qualifiers[0];
- aux.ti.tq1 = (int) t->type_qualifiers[1];
- aux.ti.tq2 = (int) t->type_qualifiers[2];
- aux.ti.tq3 = (int) t->type_qualifiers[3];
- aux.ti.tq4 = (int) t->type_qualifiers[4];
- aux.ti.tq5 = (int) t->type_qualifiers[5];
+ aux.ti.tq0 = t->type_qualifiers[0];
+ aux.ti.tq1 = t->type_qualifiers[1];
+ aux.ti.tq2 = t->type_qualifiers[2];
+ aux.ti.tq3 = t->type_qualifiers[3];
+ aux.ti.tq4 = t->type_qualifiers[4];
+ aux.ti.tq5 = t->type_qualifiers[5];
/* For anything that adds additional information, we must not hash,
so check here, and reset our state. */
we must offset it by the vma of the section,
just as BFD does, because BFD will not see
this value). */
- if (sym_ptr->ecoff_sym.asym.st == (int) st_Block
- && sym_ptr->ecoff_sym.asym.sc == (int) sc_Text)
+ if (sym_ptr->ecoff_sym.asym.st == st_Block
+ && sym_ptr->ecoff_sym.asym.sc == sc_Text)
{
symbolS *begin_sym;
sc = sc_Data;
}
- sym_ptr->ecoff_sym.asym.st = (int) st;
- sym_ptr->ecoff_sym.asym.sc = (int) sc;
+ sym_ptr->ecoff_sym.asym.st = st;
+ sym_ptr->ecoff_sym.asym.sc = sc;
}
/* This is just an external symbol if it is
|| S_IS_WEAK (as_sym)
|| ! S_IS_DEFINED (as_sym))
&& sym_ptr->proc_ptr == (proc_t *) NULL
- && sym_ptr->ecoff_sym.asym.st != (int) st_Nil
+ && sym_ptr->ecoff_sym.asym.st != st_Nil
&& ! ECOFF_IS_STAB (&sym_ptr->ecoff_sym.asym))
local = 0;
begin_ptr = sym_ptr->begin_ptr;
know (begin_ptr->sym_index != -1);
sym_ptr->ecoff_sym.asym.index = begin_ptr->sym_index;
- if (sym_ptr->ecoff_sym.asym.sc != (int) sc_Info)
+ if (sym_ptr->ecoff_sym.asym.sc != sc_Info)
sym_ptr->ecoff_sym.asym.iss =
begin_ptr->ecoff_sym.asym.iss;
#endif
}
else if (begin_type == st_Block
- && sym_ptr->ecoff_sym.asym.sc != (int) sc_Info)
+ && sym_ptr->ecoff_sym.asym.sc != sc_Info)
{
symbolS *begin_sym;
lsym = symbol_get_obj (sym)->ecoff_symbol;
lsym->ecoff_sym.asym.value = 0;
- lsym->ecoff_sym.asym.st = (int) st_Nil;
- lsym->ecoff_sym.asym.sc = (int) sc_Nil;
+ lsym->ecoff_sym.asym.st = st_Nil;
+ lsym->ecoff_sym.asym.sc = sc_Nil;
lsym->ecoff_sym.asym.index = indexNil;
}
#ifndef MALLOC_CHECK
- ptr = alloc_counts[(int) alloc_type_scope].free_list.f_scope;
+ ptr = alloc_counts[alloc_type_scope].free_list.f_scope;
if (ptr != (scope_t *) NULL)
- alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr->free;
+ alloc_counts[alloc_type_scope].free_list.f_scope = ptr->free;
else
{
- int unallocated = alloc_counts[(int) alloc_type_scope].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_scope].cur_page;
+ int unallocated = alloc_counts[alloc_type_scope].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_scope].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (scope_t);
- alloc_counts[(int) alloc_type_scope].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_scope].total_pages++;
+ alloc_counts[alloc_type_scope].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_scope].total_pages++;
}
ptr = &cur_page->scope[--unallocated];
- alloc_counts[(int) alloc_type_scope].unallocated = unallocated;
+ alloc_counts[alloc_type_scope].unallocated = unallocated;
}
#else
#endif
- alloc_counts[(int) alloc_type_scope].total_alloc++;
+ alloc_counts[alloc_type_scope].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}
static void
free_scope (scope_t *ptr)
{
- alloc_counts[(int) alloc_type_scope].total_free++;
+ alloc_counts[alloc_type_scope].total_free++;
#ifndef MALLOC_CHECK
- ptr->free = alloc_counts[(int) alloc_type_scope].free_list.f_scope;
- alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr;
+ ptr->free = alloc_counts[alloc_type_scope].free_list.f_scope;
+ alloc_counts[alloc_type_scope].free_list.f_scope = ptr;
#else
- free ((void *) ptr);
+ free (ptr);
#endif
}
\f
#ifndef MALLOC_CHECK
- int unallocated = alloc_counts[(int) alloc_type_vlinks].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_vlinks].cur_page;
+ int unallocated = alloc_counts[alloc_type_vlinks].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_vlinks].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (vlinks_t);
- alloc_counts[(int) alloc_type_vlinks].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_vlinks].total_pages++;
+ alloc_counts[alloc_type_vlinks].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_vlinks].total_pages++;
}
ptr = &cur_page->vlinks[--unallocated];
- alloc_counts[(int) alloc_type_vlinks].unallocated = unallocated;
+ alloc_counts[alloc_type_vlinks].unallocated = unallocated;
#else
#endif
- alloc_counts[(int) alloc_type_vlinks].total_alloc++;
+ alloc_counts[alloc_type_vlinks].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}
#ifndef MALLOC_CHECK
- int unallocated = alloc_counts[(int) alloc_type_shash].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_shash].cur_page;
+ int unallocated = alloc_counts[alloc_type_shash].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_shash].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (shash_t);
- alloc_counts[(int) alloc_type_shash].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_shash].total_pages++;
+ alloc_counts[alloc_type_shash].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_shash].total_pages++;
}
ptr = &cur_page->shash[--unallocated];
- alloc_counts[(int) alloc_type_shash].unallocated = unallocated;
+ alloc_counts[alloc_type_shash].unallocated = unallocated;
#else
#endif
- alloc_counts[(int) alloc_type_shash].total_alloc++;
+ alloc_counts[alloc_type_shash].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}
#ifndef MALLOC_CHECK
- int unallocated = alloc_counts[(int) alloc_type_thash].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_thash].cur_page;
+ int unallocated = alloc_counts[alloc_type_thash].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_thash].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (thash_t);
- alloc_counts[(int) alloc_type_thash].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_thash].total_pages++;
+ alloc_counts[alloc_type_thash].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_thash].total_pages++;
}
ptr = &cur_page->thash[--unallocated];
- alloc_counts[(int) alloc_type_thash].unallocated = unallocated;
+ alloc_counts[alloc_type_thash].unallocated = unallocated;
#else
#endif
- alloc_counts[(int) alloc_type_thash].total_alloc++;
+ alloc_counts[alloc_type_thash].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}
#ifndef MALLOC_CHECK
- ptr = alloc_counts[(int) alloc_type_tag].free_list.f_tag;
+ ptr = alloc_counts[alloc_type_tag].free_list.f_tag;
if (ptr != (tag_t *) NULL)
- alloc_counts[(int) alloc_type_tag].free_list.f_tag = ptr->free;
+ alloc_counts[alloc_type_tag].free_list.f_tag = ptr->free;
else
{
- int unallocated = alloc_counts[(int) alloc_type_tag].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_tag].cur_page;
+ int unallocated = alloc_counts[alloc_type_tag].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_tag].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (tag_t);
- alloc_counts[(int) alloc_type_tag].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_tag].total_pages++;
+ alloc_counts[alloc_type_tag].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_tag].total_pages++;
}
ptr = &cur_page->tag[--unallocated];
- alloc_counts[(int) alloc_type_tag].unallocated = unallocated;
+ alloc_counts[alloc_type_tag].unallocated = unallocated;
}
#else
#endif
- alloc_counts[(int) alloc_type_tag].total_alloc++;
+ alloc_counts[alloc_type_tag].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}
static void
free_tag (tag_t *ptr)
{
- alloc_counts[(int) alloc_type_tag].total_free++;
+ alloc_counts[alloc_type_tag].total_free++;
#ifndef MALLOC_CHECK
- ptr->free = alloc_counts[(int) alloc_type_tag].free_list.f_tag;
- alloc_counts[(int) alloc_type_tag].free_list.f_tag = ptr;
+ ptr->free = alloc_counts[alloc_type_tag].free_list.f_tag;
+ alloc_counts[alloc_type_tag].free_list.f_tag = ptr;
#else
free ((PTR_T) ptr);
#endif
#ifndef MALLOC_CHECK
- int unallocated = alloc_counts[(int) alloc_type_forward].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_forward].cur_page;
+ int unallocated = alloc_counts[alloc_type_forward].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_forward].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (forward_t);
- alloc_counts[(int) alloc_type_forward].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_forward].total_pages++;
+ alloc_counts[alloc_type_forward].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_forward].total_pages++;
}
ptr = &cur_page->forward[--unallocated];
- alloc_counts[(int) alloc_type_forward].unallocated = unallocated;
+ alloc_counts[alloc_type_forward].unallocated = unallocated;
#else
#endif
- alloc_counts[(int) alloc_type_forward].total_alloc++;
+ alloc_counts[alloc_type_forward].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}
#ifndef MALLOC_CHECK
- ptr = alloc_counts[(int) alloc_type_thead].free_list.f_thead;
- if (ptr != (thead_t *) NULL)
- alloc_counts[(int) alloc_type_thead].free_list.f_thead = ptr->free;
+ ptr = alloc_counts[alloc_type_thead].free_list.f_thead;
+ if (ptr != NULL)
+ alloc_counts[alloc_type_thead].free_list.f_thead = ptr->free;
else
{
- int unallocated = alloc_counts[(int) alloc_type_thead].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_thead].cur_page;
+ int unallocated = alloc_counts[alloc_type_thead].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_thead].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (thead_t);
- alloc_counts[(int) alloc_type_thead].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_thead].total_pages++;
+ alloc_counts[alloc_type_thead].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_thead].total_pages++;
}
ptr = &cur_page->thead[--unallocated];
- alloc_counts[(int) alloc_type_thead].unallocated = unallocated;
+ alloc_counts[alloc_type_thead].unallocated = unallocated;
}
#else
#endif
- alloc_counts[(int) alloc_type_thead].total_alloc++;
+ alloc_counts[alloc_type_thead].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}
static void
free_thead (thead_t *ptr)
{
- alloc_counts[(int) alloc_type_thead].total_free++;
+ alloc_counts[alloc_type_thead].total_free++;
#ifndef MALLOC_CHECK
- ptr->free = (thead_t *) alloc_counts[(int) alloc_type_thead].free_list.f_thead;
- alloc_counts[(int) alloc_type_thead].free_list.f_thead = ptr;
+ ptr->free = (thead_t *) alloc_counts[alloc_type_thead].free_list.f_thead;
+ alloc_counts[alloc_type_thead].free_list.f_thead = ptr;
#else
free ((PTR_T) ptr);
#endif
#ifndef MALLOC_CHECK
- int unallocated = alloc_counts[(int) alloc_type_lineno].unallocated;
- page_type *cur_page = alloc_counts[(int) alloc_type_lineno].cur_page;
+ int unallocated = alloc_counts[alloc_type_lineno].unallocated;
+ page_type *cur_page = alloc_counts[alloc_type_lineno].cur_page;
if (unallocated == 0)
{
unallocated = PAGE_SIZE / sizeof (lineno_list_t);
- alloc_counts[(int) alloc_type_lineno].cur_page = cur_page = allocate_page ();
- alloc_counts[(int) alloc_type_lineno].total_pages++;
+ alloc_counts[alloc_type_lineno].cur_page = cur_page = allocate_page ();
+ alloc_counts[alloc_type_lineno].total_pages++;
}
ptr = &cur_page->lineno[--unallocated];
- alloc_counts[(int) alloc_type_lineno].unallocated = unallocated;
+ alloc_counts[alloc_type_lineno].unallocated = unallocated;
#else
#endif
- alloc_counts[(int) alloc_type_lineno].total_alloc++;
+ alloc_counts[alloc_type_lineno].total_alloc++;
memset (ptr, 0, sizeof (*ptr));
return ptr;
}