if (*s == '\0')
as_fatal (_("bad defsym; format is --defsym name=value"));
*s++ = '\0';
- i = bfd_scan_vma (s, (const char **) NULL, 0);
+ i = bfd_scan_vma (s, NULL, 0);
n = XNEW (struct defsym_list);
n->next = defsyms;
n->name = optarg;
/* Canonical name, since used a lot. */
CGEN_CPU_DESC cd = gas_cgen_cpu_desc;
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex"));
if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
/* Assume delimiter is part of expression.
BSD4.2 as fails with delightful bug, so we
are not being incompatible here. */
- new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
+ new_logical_line (NULL, get_absolute_expression ());
demand_empty_rest_of_line ();
}
else
name = dollar;
- sname = notes_concat (base_name, name, NULL);
+ sname = notes_concat (base_name, name, (const char *) NULL);
return sname;
}
/* If there is no lineno symbol, treat a .ln directive
as if it were a (no longer existing) .appline one. */
if (current_lineno_sym == NULL)
- new_logical_line ((char *) NULL, l - 1);
+ new_logical_line (NULL, l - 1);
else
add_lineno (frag_now, frag_now_fix (), l);
*punt = 1;
#endif
- if (set_end != (symbolS *) NULL
+ if (set_end != NULL
&& ! *punt
&& ((symbol_get_bfdsym (symp)->flags & BSF_NOT_AT_END) != 0
|| (S_IS_DEFINED (symp)
p = frag_more (12);
/* Zero it out. */
memset (p, 0, 12);
- file = as_where ((unsigned int *) NULL);
+ file = as_where (NULL);
stroff = get_stab_string_offset (file, stabstr);
know (stroff == 1);
md_number_to_chars (p, stroff, 4);
const char *
s_get_name (symbolS *s)
{
- return ((s == NULL) ? "(NULL)" : S_GET_NAME (s));
+ return s == NULL ? "(NULL)" : S_GET_NAME (s);
}
void symbol_dump (void);
if (!strcmp ("str", sec->name + strlen (sec->name) - 3))
return;
- name = concat (sec->name, "str", NULL);
+ name = concat (sec->name, "str", (const char *) NULL);
strsec = bfd_get_section_by_name (abfd, name);
if (strsec)
strsz = bfd_section_size (strsec);
void
obj_mach_o_pre_output_hook (void)
{
- bfd_map_over_sections (stdoutput, obj_mach_o_check_before_writing, (char *) 0);
+ bfd_map_over_sections (stdoutput, obj_mach_o_check_before_writing, NULL);
}
/* Here we count up frags in each subsection (where a sub-section is defined
void
obj_mach_o_pre_relax_hook (void)
{
- bfd_map_over_sections (stdoutput, obj_mach_o_set_subsections, (char *) 0);
+ bfd_map_over_sections (stdoutput, obj_mach_o_set_subsections, NULL);
}
/* Zerofill and GB Zerofill sections must be sorted to follow all other
void
obj_mach_o_frob_file_after_relocs (void)
{
- bfd_map_over_sections (stdoutput, obj_mach_o_set_indirect_symbols, (char *) 0);
+ bfd_map_over_sections (stdoutput, obj_mach_o_set_indirect_symbols, NULL);
}
/* Reverse relocations order to make ld happy. */
the call to get_stab_string_offset. */
p = frag_more (12);
memset (p, 0, 12);
- file = as_where ((unsigned int *) NULL);
+ file = as_where (NULL);
stroff = get_stab_string_offset (file, stabstr);
know (stroff == 1);
md_number_to_chars (p, stroff, 4);
void
som_frob_file (void)
{
- bfd_map_over_sections (stdoutput, adjust_stab_sections, (void *) 0);
+ bfd_map_over_sections (stdoutput, adjust_stab_sections, NULL);
}
static void
{
#ifdef OBJ_ELF
/* Remove any overlapping mapping symbols generated by alignment frags. */
- bfd_map_over_sections (stdoutput, check_mapping_symbols, (char *) 0);
+ bfd_map_over_sections (stdoutput, check_mapping_symbols, NULL);
/* Now do generic ELF adjustments. */
elf_adjust_symtab ();
#endif
for (fixp = seginfo->fix_root; fixp; fixp = next)
{
next = fixp->fx_next;
- fixp->fx_next = (fixS *) 0;
+ fixp->fx_next = NULL;
switch (fixp->fx_r_type)
{
&& ! fixp->tc_fix_data.info->multi_section_p)
{
for (slave = fixp->tc_fix_data.info->slaves;
- slave != (fixS *) 0;
+ slave != NULL;
slave = slave->tc_fix_data.next_reloc)
{
slave->fx_next = fixp->fx_next;
/* Take care of alignment duties. */
if (alpha_auto_align_on && alpha_current_align < 2)
- alpha_align (2, (char *) NULL, alpha_insn_label, 0);
+ alpha_align (2, NULL, alpha_insn_label, 0);
if (alpha_current_align > 2)
alpha_current_align = 2;
alpha_insn_label = NULL;
/* Apply the fixups in order. */
for (i = 0; i < insn->nfixups; ++i)
{
- const struct alpha_operand *operand = (const struct alpha_operand *) 0;
+ const struct alpha_operand *operand = NULL;
struct alpha_fixup *fixup = &insn->fixups[i];
struct alpha_reloc_tag *info = NULL;
int size, pcrel;
for (argidx = opcode->operands; *argidx; ++argidx)
{
const struct alpha_operand *operand = &alpha_operands[*argidx];
- const expressionS *t = (const expressionS *) 0;
+ const expressionS *t = NULL;
if (operand->flags & AXP_OPERAND_FAKE)
{
if (seginfo->frchainP)
for (fixp = seginfo->frchainP->fix_root;
- fixp != (fixS *) NULL;
+ fixp != NULL;
fixp = fixp->fx_next)
{
if (fixp->fx_addsy == sym
- && fixp->fx_offset == (valueT)addend
+ && fixp->fx_offset == (valueT) addend
&& fixp->tc_fix_data.info
&& fixp->tc_fix_data.info->sym
&& symbol_symbolS (fixp->tc_fix_data.info->sym)
#endif
if (alpha_auto_align_on && alpha_current_align < 2)
- alpha_align (2, (char *) NULL, alpha_insn_label, 0);
+ alpha_align (2, NULL, alpha_insn_label, 0);
if (alpha_current_align > 2)
alpha_current_align = 2;
alpha_insn_label = NULL;
}
if (alpha_auto_align_on && alpha_current_align < log_size)
- alpha_align (log_size, (char *) NULL, alpha_insn_label, 0);
+ alpha_align (log_size, NULL, alpha_insn_label, 0);
if (alpha_current_align > log_size)
alpha_current_align = log_size;
alpha_insn_label = NULL;
++log_size;
if (alpha_auto_align_on && alpha_current_align < log_size)
- alpha_align (log_size, (char *) NULL, alpha_insn_label, 0);
+ alpha_align (log_size, NULL, alpha_insn_label, 0);
if (alpha_current_align > log_size)
alpha_current_align = log_size;
alpha_insn_label = NULL;
pr_debug ("pcrel_from_section, fx_offset = %d\n", (int) fixP->fx_offset);
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (!S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
for (argidx = opcode->operands; *argidx; ++argidx)
{
const struct arc_operand *operand = &arc_operands[*argidx];
- const expressionS *t = (const expressionS *) 0;
+ const expressionS *t = NULL;
if (ARC_OPERAND_IS_FAKE (operand))
continue;
if (S_IS_LOCAL (symbolP) || name[0] == '.')
return symbolP;
- real_start = concat (STUB_NAME, name, NULL);
+ real_start = concat (STUB_NAME, name, (const char *) NULL);
new_target = symbol_find (real_start);
free (real_start);
}
/* Remove any overlapping mapping symbols generated by alignment frags. */
- bfd_map_over_sections (stdoutput, check_mapping_symbols, (char *) 0);
+ bfd_map_over_sections (stdoutput, check_mapping_symbols, NULL);
/* Now do generic ELF adjustments. */
elf_adjust_symtab ();
#endif
long
md_pcrel_from_section (fixS *fixp, segT sec)
{
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
return 0;
unsigned long insn;
long value = *valP;
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
else if (fixP->fx_pcrel)
fixP->fx_subsy = NULL;
}
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
/* For the DIFF relocs, write the value into the object file while still
reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
#endif
static flagword bfin_flags = DEFAULT_FLAGS | DEFAULT_FDPIC;
-static const char *bfin_pic_flag = DEFAULT_FDPIC ? "-mfdpic" : (const char *)0;
+static const char *bfin_pic_flag = DEFAULT_FDPIC ? "-mfdpic" : NULL;
/* Blackfin specific function to handle FD-PIC pointer initializations. */
symbolS *
md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
{
- return (symbolS *) 0;
+ return NULL;
}
int
reloc->addend = fixp->fx_offset;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
/* xgettext:c-format. */
long
md_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (!S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
long
md_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| (S_GET_SEGMENT (fixP->fx_addsy) != sec)
|| S_IS_EXTERNAL (fixP->fx_addsy)
reloc->howto = bfd_reloc_type_lookup (stdoutput, r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
_("relocation is not supported"));
break;
}
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
if (fixP->fx_done)
case ENCODE_RELAX (STATE_COND_BRANCH, STATE_DWORD):
gen_cond_branch_32 (fragP->fr_opcode, var_partp, fragP,
- fragP->fr_symbol, (symbolS *) NULL,
+ fragP->fr_symbol, NULL,
fragP->fr_offset);
/* Ten bytes added: a branch, nop and a jump. */
var_part_size = 2 + 2 + 4 + 2;
case ENCODE_RELAX (STATE_COND_BRANCH_PIC, STATE_DWORD):
gen_cond_branch_32 (fragP->fr_opcode, var_partp, fragP,
- fragP->fr_symbol, (symbolS *) NULL,
+ fragP->fr_symbol, NULL,
fragP->fr_offset);
/* Twelve bytes added: a branch, nop and a pic-branch-32. */
var_part_size = 2 + 2 + 4 + 2 + 2;
case ENCODE_RELAX (STATE_COND_BRANCH_V32, STATE_DWORD):
gen_cond_branch_32 (fragP->fr_opcode, var_partp, fragP,
- fragP->fr_symbol, (symbolS *) NULL,
+ fragP->fr_symbol, NULL,
fragP->fr_offset);
/* Twelve bytes added: a branch, nop and another branch and nop. */
var_part_size = 2 + 2 + 2 + 4 + 2;
? 12 : 10);
gen_cond_branch_32 (opcodep, cond_jump, frag_now,
- output_instruction.expr.X_add_symbol,
- (symbolS *) NULL,
+ output_instruction.expr.X_add_symbol, NULL,
output_instruction.expr.X_add_number);
}
}
fixP->fx_done = 1;
/* We can't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
/* This operand-type is scaled. */
gas_assert ((int) fixP->fx_r_type > 0);
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
_("internal error: reloc %d (`%s') not supported by object file format"),
str);
crx_ins->exp.X_op = O_constant;
crx_ins->exp.X_add_number = 0;
- crx_ins->exp.X_add_symbol = (symbolS *) 0;
- crx_ins->exp.X_op_symbol = (symbolS *) 0;
+ crx_ins->exp.X_add_symbol = NULL;
+ crx_ins->exp.X_op_symbol = NULL;
/* Fall through. */
case O_constant:
{
/* If the symbol is undefined or defined in another section
we leave the add number alone for the linker to fix it later. */
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != seg))
return fixP->fx_size;
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
long
md_pcrel_from_section (fixS *fixp, segT sec)
{
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
return 0;
int op_type;
int left = 0;
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
op_type = fixP->fx_r_type;
long
md_pcrel_from_section (fixS *fixp, segT sec)
{
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
return 0;
++log_size;
if (d30v_current_align < log_size)
- d30v_align (log_size, (char *) NULL, NULL);
+ d30v_align (log_size, NULL, NULL);
else if (d30v_current_align > log_size)
d30v_current_align = log_size;
d30v_last_label = NULL;
unsigned long insn, insn2;
long value = *valP;
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
/* Fetch the instruction, insert the fully resolved operand
void
epiphany_apply_fix (fixS *fixP, valueT *valP, segT seg)
{
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
if ((fixP->fx_r_type < BFD_RELOC_UNUSED)
long
md_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (!S_IS_DEFINED (fixP->fx_addsy)
|| (S_GET_SEGMENT (fixP->fx_addsy) != sec)
|| S_IS_EXTERNAL (fixP->fx_addsy)
long
md_pcrel_from_section (fixS * fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
/* The symbol is undefined (or is defined but not in this section).
static int frv_user_set_flags_p = 0;
static int frv_pic_p = 0;
-static const char *frv_pic_flag = DEFAULT_FDPIC ? "-mfdpic" : (const char *)0;
+static const char *frv_pic_flag = DEFAULT_FDPIC ? "-mfdpic" : NULL;
/* Print tomcat-specific debugging info. */
static int tomcat_debug = 0;
md_pcrel_from_section (fixS *fixP, segT sec)
{
if (TC_FORCE_RELOCATION (fixP)
- || (fixP->fx_addsy != (symbolS *) NULL
+ || (fixP->fx_addsy != NULL
&& S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
/* If we can't adjust this relocation, or if it references a
void
frv_frob_file (void)
{
- bfd_map_over_sections (stdoutput, frv_frob_file_section, (void *) 0);
+ bfd_map_over_sections (stdoutput, frv_frob_file_section, NULL);
}
void
}
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
switch (fixP->fx_r_type)
i.op[op].disps = exp;
exp->X_op = O_constant;
exp->X_add_number = 0;
- exp->X_add_symbol = (symbolS *) 0;
- exp->X_op_symbol = (symbolS *) 0;
+ exp->X_add_symbol = NULL;
+ exp->X_op_symbol = NULL;
}
}
else
while ((*p++ = register_chars[(unsigned char) *s]) != '\0')
{
if (p >= reg_name_given + MAX_REG_NAME_SIZE)
- return (const reg_entry *) NULL;
+ return NULL;
s++;
}
if (is_part_of_name (*s))
- return (const reg_entry *) NULL;
+ return NULL;
*end_op = (char *) s;
&& !cpu_arch_flags.bitfield.cpu287
&& !cpu_arch_flags.bitfield.cpu387
&& !allow_pseudo_reg)
- return (const reg_entry *) NULL;
+ return NULL;
if (is_whitespace (*s))
++s;
}
}
/* We have "%st(" then garbage. */
- return (const reg_entry *) NULL;
+ return NULL;
}
}
suffix += sizeof (".gnu.linkonce.t.") - 1;
}
- sec_name = concat (prefix, suffix, NULL);
+ sec_name = concat (prefix, suffix, (const char *) NULL);
/* Handle COMDAT group. */
if ((text_seg->flags & SEC_LINK_ONCE) != 0
}
/* We have to construct a fake section directive. */
- section = concat (sec_name, ",\"aG\",@progbits,", group_name, ",comdat", NULL);
+ section = concat (sec_name, ",\"aG\",@progbits,", group_name,
+ ",comdat", (const char *) NULL);
set_section (section);
free (section);
}
long
md_pcrel_from_section (fixS * fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
{ "hword", cons, 2 },
{ "word", cons, 4 },
{ "dword", cons, 8 },
- {(char *)0 , (void(*)(int))0, 0}
+ { NULL, NULL, 0 }
};
/* Target specific command line options. */
long
md_pcrel_from_section (fixS * fixP, segT sec)
{
- if ((fixP->fx_addsy != (symbolS *) NULL)
+ if ((fixP->fx_addsy != NULL)
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| (S_GET_SEGMENT (fixP->fx_addsy) != sec)))
{
/*fprintf(stderr, "%s extern %d local %d\n", S_GET_NAME (fixP->fx_addsy), S_IS_EXTERN (fixP->fx_addsy), S_IS_LOCAL (fixP->fx_addsy));*/
/* FIXME: Weak problem? */
- if ((fixP->fx_addsy != (symbolS *) NULL)
+ if ((fixP->fx_addsy != NULL)
&& S_IS_EXTERNAL (fixP->fx_addsy))
{
/* If the symbol is external, let the linker handle it. */
long
md_pcrel_from_section (fixS * fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
/* The symbol is undefined (or is defined but not in this section).
symbolS *symbol;
} sym_linkS;
-static sym_linkS *debug_sym_link = (sym_linkS *) 0;
+static sym_linkS *debug_sym_link = NULL;
/* Structure to hold all of the different components describing
an individual instruction. */
return;
(void) frag_align_code (align, 0);
- for (; syms != (sym_linkS *) 0; syms = next_syms)
+ for (; syms != NULL; syms = next_syms)
{
symbolS *symbolP = syms->symbol;
next_syms = syms->next;
if (debug_sym_link)
{
expand_debug_syms (debug_sym_link, 1);
- debug_sym_link = (sym_linkS *) 0;
+ debug_sym_link = NULL;
}
}
if (done && debug_sym_link)
{
expand_debug_syms (debug_sym_link, 1);
- debug_sym_link = (sym_linkS *) 0;
+ debug_sym_link = NULL;
}
return 1;
fill_insn (0);
first.debug_sym_link = debug_sym_link;
- debug_sym_link = (sym_linkS *) 0;
+ debug_sym_link = NULL;
/* Parse the first instruction. */
if (! (first.insn = m32r_cgen_assemble_insn
}
insn.debug_sym_link = debug_sym_link;
- debug_sym_link = (sym_linkS *) 0;
+ debug_sym_link = NULL;
insn.insn = m32r_cgen_assemble_insn
(gas_cgen_cpu_desc, str, &insn.fields, insn.buffer, & errmsg);
long
md_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec
|| S_IS_EXTERNAL (fixP->fx_addsy)
reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_16);
else
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("Relocation %d is not supported by object file format."),
char *where;
long value = * valP;
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
/* Patch the instruction with the resolved operand. Elf relocation
flab = mri_control_label ();
build_mri_control_operand (qual, cc, leftstart, leftstop, rightstart,
- rightstop, (const char *) NULL, flab, extent);
+ rightstop, NULL, flab, extent);
input_line_pointer += 3;
if (*input_line_pointer != '.'
tlab = mri_control_label ();
build_mri_control_operand (qual, cc, leftstart, leftstop, rightstart,
- rightstop, tlab, (const char *) NULL, extent);
+ rightstop, tlab, NULL, extent);
input_line_pointer += 2;
if (*input_line_pointer != '.'
n = push_mri_control (mri_if);
- parse_mri_control_expression (s - 3, qual, (const char *) NULL,
+ parse_mri_control_expression (s - 3, qual, NULL,
n->next, s[1] == '.' ? s[2] : '\0');
if (s[1] == '.')
for (s = input_line_pointer; ! is_end_of_stmt (*s); s++)
;
- parse_mri_control_expression (s, qual, (const char *) NULL,
+ parse_mri_control_expression (s, qual, NULL,
mri_control_stack->top, '\0');
colon (mri_control_stack->bottom);
colon (n->next);
- parse_mri_control_expression (s - 1, qual, (const char *) NULL, n->bottom,
+ parse_mri_control_expression (s - 1, qual, NULL, n->bottom,
s[1] == '.' ? s[2] : '\0');
input_line_pointer = s + 1;
/* If the symbol is undefined or defined in another section
we leave the add number alone for the linker to fix it later.
Only account for the PC pre-bump (which is 2 bytes on the MCore). */
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (! S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
long
md_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_IS_WEAK (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
we leave the add number alone for the linker to fix it later.
Only account for the PC pre-bump (No PC-pre-bump on the Microblaze). */
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
return 0;
static void
report_insn_error (const char *str)
{
- const char *msg = concat (insn_error.msg, " `%s'", NULL);
+ const char *msg = concat (insn_error.msg, " `%s'", (const char *) NULL);
switch (insn_error.format)
{
not be referenced off the $gp, although it appears as though
they can. */
symname = S_GET_NAME (sym);
- if (symname != (const char *) NULL
+ if (symname != NULL
&& (strcmp (symname, "eprol") == 0
|| strcmp (symname, "etext") == 0
|| strcmp (symname, "_gp") == 0
{
long val;
- if (cur_proc_ptr == (procS *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".frame outside of .ent"));
demand_empty_rest_of_line ();
{
long mask, off;
- if (cur_proc_ptr == (procS *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".mask/.fmask outside of .ent"));
demand_empty_rest_of_line ();
long
md_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
md_section_align (asection *seg, valueT addr)
{
int align = bfd_section_alignment (seg);
- return ((addr + (1 << align) - 1) & -(1 << align));
+ return ((addr + ((valueT) 1 << align) - 1) & -((valueT) 1 << align));
}
void
{
if (strcmp (prev_name, op->name))
{
- prev_name = (char *) op->name;
+ prev_name = op->name;
str_hash_insert (mn10200_hash, op->name, op, 0);
}
op++;
test = val;
- if (test < (offsetT) min || test > (offsetT) max)
+ if (test < min || test > max)
return 0;
else
return 1;
test = val;
- if (test < (offsetT) min || test > (offsetT) max)
- as_warn_value_out_of_range (_("operand"), test, (offsetT) min, (offsetT) max, file, line);
+ if (test < min || test > max)
+ as_warn_value_out_of_range (_("operand"), test, (offsetT) min,
+ (offsetT) max, file, line);
}
if ((operand->flags & MN10200_OPERAND_EXTENDED) == 0)
{
- *insnp |= (((long) val & ((1 << operand->bits) - 1))
+ *insnp |= ((val & ((1 << operand->bits) - 1))
<< (operand->shift + shift));
if ((operand->flags & MN10200_OPERAND_REPEATED) != 0)
- *insnp |= (((long) val & ((1 << operand->bits) - 1))
+ *insnp |= ((val & ((1 << operand->bits) - 1))
<< (operand->shift + shift + 2));
}
else
fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset,
reloc_size, &fixups[i].exp, pcrel,
- ((bfd_reloc_code_real_type) reloc));
+ reloc);
/* PC-relative offsets are from the first byte of the
next instruction, not from the start of the current
long
md_pcrel_from (fixS *fixp)
{
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)))
/* The symbol is undefined or weak. Let the linker figure it out. */
return 0;
long
md_pcrel_from_section (fixS * fixp, segT sec)
{
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
return 0;
unsigned long insn;
long value;
- if (fixp->fx_addsy == (symbolS *) NULL)
+ if (fixp->fx_addsy == NULL)
{
value = *valuep;
fixp->fx_done = 1;
{
value = fixp->fx_offset;
- if (fixp->fx_subsy != (symbolS *) NULL)
+ if (fixp->fx_subsy != NULL)
{
if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section)
{
long
md_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (!S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
/* The symbol is undefined (or is defined but not in this section).
return;
}
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
{
/* HOW DIFF RELOCATION WORKS.
code = fixP->fx_r_type;
reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
_("internal error: can't export reloc type %d (`%s')"),
long
md_pcrel_from_section (fixS * fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| (S_GET_SEGMENT (fixP->fx_addsy) != sec)
|| S_IS_EXTERNAL (fixP->fx_addsy)
{
cfi_add_CFA_def_cfa_register (1);
}
-
char *p;
asection *seg = now_seg;
subsegT subseg = now_subseg;
- asection *apuinfo_secp = (asection *) NULL;
+ asection *apuinfo_secp = NULL;
unsigned int i;
/* Create the .PPC.EMB.apuinfo section. */
errmsg = NULL;
insn = (*operand->insert) (insn, val, cpu, &errmsg);
- if (errmsg != (const char *) NULL)
+ if (errmsg != NULL)
as_bad_where (file, line, "%s", errmsg);
}
else
/* Set the class of a label based on where it is defined. This handles
symbols without suffixes. Also, move the symbol so that it follows
the csect symbol. */
- if (ppc_current_csect != (symbolS *) NULL)
+ if (ppc_current_csect != NULL)
{
if (symbol_get_tc (sym)->symbol_class == -1)
symbol_get_tc (sym)->symbol_class = symbol_get_tc (ppc_current_csect)->symbol_class;
if (operand->insert)
{
insn = (*operand->insert) (insn, val, ppc_cpu, &errmsg);
- if (errmsg != (const char *) NULL)
+ if (errmsg != NULL)
as_bad ("%s", errmsg);
}
else if (operand->shift >= 0)
&& (operand->flags & PPC_OPERAND_GPR_0) != 0))
as_warn (_("invalid register expression"));
insn = ppc_insert_operand (insn, operand, ex.X_add_number,
- ppc_cpu, (char *) NULL, 0);
+ ppc_cpu, NULL, 0);
}
else if (ex.X_op == O_constant
|| (ex.X_op == O_big && ex.X_add_number > 0))
else
insn = ppc_insert_operand (insn, operand,
ppc_obj64 ? 13 : 2,
- ppc_cpu, (char *) NULL, 0);
+ ppc_cpu, NULL, 0);
break;
/* We'll only use the 32 (or 64) bit form of these relocations
symbol_get_tc (sym)->within = sym;
for (list = section->csects;
- symbol_get_tc (list)->next != (symbolS *) NULL;
+ symbol_get_tc (list)->next != NULL;
list = symbol_get_tc (list)->next)
;
symbol_get_tc (list)->next = sym;
/* Ignore any [PR] suffix. */
name = ppc_canonicalize_symbol_name (name);
s = strchr (name, '[');
- if (s != (char *) NULL
+ if (s != NULL
&& strcmp (s + 1, "PR]") == 0)
*s = '\0';
saved_bi_sym = 0;
}
-
symbol_get_tc (sym)->output = 1;
ppc_frob_label (sym);
saved_bi_sym = sym;
for (look = last_biei ? last_biei : symbol_rootP;
- (look != (symbolS *) NULL
+ (look != NULL
&& (S_GET_STORAGE_CLASS (look) == C_FILE
|| S_GET_STORAGE_CLASS (look) == C_BINCL
|| S_GET_STORAGE_CLASS (look) == C_EINCL));
look = symbol_next (look))
;
- if (look != (symbolS *) NULL)
+ if (look != NULL)
{
symbol_remove (sym, &symbol_rootP, &symbol_lastP);
symbol_insert (sym, look, &symbol_rootP, &symbol_lastP);
static void
ppc_toc (int ignore ATTRIBUTE_UNUSED)
{
- if (ppc_toc_csect != (symbolS *) NULL)
+ if (ppc_toc_csect != NULL)
subseg_set (data_section, symbol_get_tc (ppc_toc_csect)->subseg);
else
{
ppc_toc_csect = sym;
for (list = ppc_xcoff_data_section.csects;
- symbol_get_tc (list)->next != (symbolS *) NULL;
+ symbol_get_tc (list)->next != NULL;
list = symbol_get_tc (list)->next)
;
symbol_get_tc (list)->next = sym;
char endc;
symbolS *sym;
- if (ppc_toc_csect == (symbolS *) NULL
+ if (ppc_toc_csect == NULL
|| ppc_toc_csect != ppc_current_csect)
{
as_bad (_(".tc not in .toc section"));
return;
s = strchr (S_GET_NAME (sym), '[');
- if (s == (const char *) NULL)
+ if (s == NULL)
{
/* There is no suffix. */
return;
if (sym == abs_section_sym)
return 1;
- if (symbol_get_tc (sym)->real_name != (char *) NULL)
+ if (symbol_get_tc (sym)->real_name != NULL)
S_SET_NAME (sym, symbol_get_tc (sym)->real_name);
else
{
name = S_GET_NAME (sym);
s = strchr (name, '[');
- if (s != (char *) NULL)
+ if (s != NULL)
{
unsigned int len;
char *snew;
}
}
- if (set_end != (symbolS *) NULL)
+ if (set_end != NULL)
{
SA_SET_SYM_ENDNDX (set_end, sym);
set_end = NULL;
if (SF_GET_FUNCTION (sym))
{
ppc_last_function = sym;
- if (symbol_get_tc (sym)->u.size != (symbolS *) NULL)
+ if (symbol_get_tc (sym)->u.size != NULL)
{
resolve_symbol_value (symbol_get_tc (sym)->u.size);
SA_SET_SYM_FSIZE (sym,
else if (S_GET_STORAGE_CLASS (sym) == C_FCN
&& strcmp (S_GET_NAME (sym), ".ef") == 0)
{
- if (ppc_last_function == (symbolS *) NULL)
+ if (ppc_last_function == NULL)
as_bad (_(".ef with no preceding .function"));
else
{
{
/* This is a csect symbol. x_scnlen is the size of the
csect. */
- if (symbol_get_tc (sym)->next == (symbolS *) NULL)
+ if (symbol_get_tc (sym)->next == NULL)
a->u.auxent.x_csect.x_scnlen.u64
= bfd_section_size (S_GET_SEGMENT (sym)) - S_GET_VALUE (sym);
else
next = symbol_next (sym);
while (symbol_get_tc (next)->symbol_class == XMC_TC0)
next = symbol_next (next);
- if (next == (symbolS *) NULL
+ if (next == NULL
|| (!ppc_is_toc_sym (next)))
{
- if (ppc_after_toc_frag == (fragS *) NULL)
+ if (ppc_after_toc_frag == NULL)
a->u.auxent.x_csect.x_scnlen.u64
= bfd_section_size (data_section) - S_GET_VALUE (sym);
else
/* Skip the initial dummy symbol. */
csect = symbol_get_tc (csect)->next;
- if (csect == (symbolS *) NULL)
+ if (csect == NULL)
{
as_warn (_("warning: symbol %s has no csect"), S_GET_NAME (sym));
a->u.auxent.x_csect.x_scnlen.u64 = 0;
}
else
{
- while (symbol_get_tc (csect)->next != (symbolS *) NULL)
+ while (symbol_get_tc (csect)->next != NULL)
{
resolve_symbol_value (symbol_get_tc (csect)->next);
if (S_GET_VALUE (symbol_get_tc (csect)->next)
if (bfd_section_flags (symseg) & SEC_DEBUGGING)
return 1;
- if (ppc_toc_csect != (symbolS *) NULL
+ if (ppc_toc_csect != NULL
&& fix->fx_addsy != ppc_toc_csect
&& symseg == data_section
&& val >= ppc_toc_frag->fr_address
- && (ppc_after_toc_frag == (fragS *) NULL
+ && (ppc_after_toc_frag == NULL
|| val < ppc_after_toc_frag->fr_address))
{
symbolS *sy;
for (sy = symbol_next (ppc_toc_csect);
- sy != (symbolS *) NULL;
+ sy != NULL;
sy = symbol_next (sy))
{
TC_SYMFIELD_TYPE *sy_tc = symbol_get_tc (sy);
use *valP, and must use fx_offset instead. If the relocation
is PC-relative, we then need to re-apply md_pcrel_from_section
to this new relocation value. */
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
else
reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_PPC_NEG);
reloc->addend = fixp->fx_addnumber;
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_subtract (fixp);
relocs[0] = NULL;
/* In general, fix instructions with immediate
constants. But leave LDI32 for the linker,
which is prepared to shorten insns. */
- if (fixP->fx_addsy == (symbolS *) NULL
+ if (fixP->fx_addsy == NULL
&& fixP->fx_r_type != BFD_RELOC_PRU_LDI32)
fixP->fx_done = 1;
fixP->fx_subsy = NULL;
}
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
/* For the DIFF relocs, write the value into the object file while still
void
riscv_adjust_symtab (void)
{
- bfd_map_over_sections (stdoutput, riscv_check_mapping_symbols, (char *) 0);
+ bfd_map_over_sections (stdoutput, riscv_check_mapping_symbols, NULL);
elf_adjust_symtab ();
}
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("Relocation %d is not supported by object file format."),
{
long value = *valP;
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
/*
not be referenced off the $gp, although it appears as though
they can. */
symname = S_GET_NAME (sym);
- if (symname != (const char *)NULL
+ if (symname != NULL
&& (strcmp (symname, "eprol") == 0
|| strcmp (symname, "etext") == 0
|| strcmp (symname, "_gp") == 0
{
long mask, off;
- if (s3_cur_proc_ptr == (s3_procS *) NULL)
+ if (s3_cur_proc_ptr == NULL)
{
as_warn (_(".mask outside of .ent"));
demand_empty_rest_of_line ();
backupstr = input_line_pointer;
#ifdef OBJ_ELF
- if (s3_cur_proc_ptr == (s3_procS *) NULL)
+ if (s3_cur_proc_ptr == NULL)
{
as_warn (_(".frame outside of .ent"));
demand_empty_rest_of_line ();
md_pcrel_from_section (fixS *fixP, segT sec)
{
if (! sh_local_pcrel (fixP)
- && fixP->fx_addsy != (symbolS *) NULL
+ && fixP->fx_addsy != NULL
&& (generic_force_reloc (fixP)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
valueT val = *valP;
char *place = fixP->fx_where + fixP->fx_frag->fr_literal;
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
{
/* We can't actually support subtracting a symbol. */
as_bad_subtract (fixP);
md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
{
debug ("In md_undefined_symbol()\n");
- return (symbolS *) 0;
+ return NULL;
}
valueT
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
reloc->address /= OCTETS_PER_BYTE;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
_("Reloc %d not supported by object file format"),
symbolP = symbol_find_or_make (name);
if (S_GET_SEGMENT (symbolP) == bss_section)
- symbol_get_frag (symbolP)->fr_symbol = (symbolS *) NULL;
+ symbol_get_frag (symbolP)->fr_symbol = NULL;
symbol_set_frag (symbolP, frag_now);
p = frag_var (rs_org, 1, 1, 0, symbolP, words * OCTETS_PER_BYTE, NULL);
/* Construct a symbol for every field contained within this structure
including fields within structure fields. */
- prefix = concat (path, *path ? "." : "", NULL);
+ prefix = concat (path, *path ? "." : "", (const char *) NULL);
while (field != NULL)
{
- char *name = concat (prefix, field->name, NULL);
+ char *name = concat (prefix, field->name, (const char *) NULL);
char *freename = name;
if (rootsym == NULL)
{
subsym_ent_t *ent = xmalloc (sizeof (*ent));
ent->u.s = concat (S_GET_NAME (rootsym), "+", root_stag_name,
- name + strlen (S_GET_NAME (rootsym)), NULL);
+ name + strlen (S_GET_NAME (rootsym)),
+ (const char *) NULL);
ent->freekey = 1;
ent->freeval = 1;
ent->isproc = 0;
|| fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return;
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
{
/* We can't actually support subtracting a symbol. */
as_bad_subtract (fixP);
/* If the symbol is undefined, or in a section other than our own,
or it is weak (in which case it may well be in another section,
then let the linker figure it out. */
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (! S_IS_DEFINED (fixp->fx_addsy)
|| S_IS_WEAK (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != section)))
return;
}
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_addnumber = value,
fixP->fx_done = 1;
else
{
value = fixP->fx_offset;
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
{
if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)
value -= S_GET_VALUE (fixP->fx_subsy);
{
valueT value = * valueP;
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
if (fixP->fx_addsy == NULL)
long
visium_pcrel_from_section (fixS *fixP, segT sec)
{
- if (fixP->fx_addsy != (symbolS *) NULL
+ if (fixP->fx_addsy != NULL
&& (!S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
else
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line, _
("Relocation %d is not supported by object file format."),
/* If the fixup is done mark it done so no further symbol resolution
will take place. */
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
where = fixP->fx_frag->fr_literal + fixP->fx_where;
long
md_pcrel_from_section (fixS * fixP, segT sec)
{
- if ((fixP->fx_addsy != (symbolS *) NULL
+ if ((fixP->fx_addsy != NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
|| xstormy16_force_relocation (fixP))
break;
}
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
return 0;
}
- fullname = concat (dirname, filename, NULL);
+ fullname = concat (dirname, filename, (const char *) NULL);
tryfile = to_vms_file_spec (fullname);
/* Allocate and initialize a FAB and NAM structures. */
struct tm *ts;
long long gmtoff, secs, nsecs;
- fullname = concat (dirname, filename, NULL);
+ fullname = concat (dirname, filename, (const char *) NULL);
if ((stat (fullname, &buff)) != 0)
{
{
if (!strcmp (base_name, ".eh_frame_entry")
&& strcmp (name, ".text") != 0)
- return notes_concat (base_name, ".", name, NULL);
+ return notes_concat (base_name, ".", name, (const char *) NULL);
name = "";
}
else
name = dollar;
- return notes_concat (base_name, name, NULL);
+ return notes_concat (base_name, name, (const char *) NULL);
}
/* Allocate a dwcfi_seg_list structure. */
#endif
#define INIT_VARRAY(type) { /* macro to initialize a varray */ \
- (vlinks_t *)0, /* first */ \
- (vlinks_t *)0, /* last */ \
+ 0, /* first */ \
+ 0, /* last */ \
0, /* num_allocated */ \
sizeof (type), /* object_size */ \
OBJECTS_PER_PAGE (type), /* objects_per_page */ \
0, /* cbLine: size of lines for this file */
},
- (FDR *)0, /* orig_fdr: original file header pointer */
- (char *)0, /* name: pointer to filename */
+ 0, /* orig_fdr: original file header pointer */
+ 0, /* name: pointer to filename */
0, /* fake: whether this is a faked .file */
0, /* void_type: ptr to aux node for void type */
0, /* int_type: ptr to aux node for int type */
- (scope_t *)0, /* cur_scope: current scope being processed */
+ 0, /* cur_scope: current scope being processed */
0, /* file_index: current file # */
0, /* nested_scopes: # nested scopes */
INIT_VARRAY (char), /* strings: local string varray */
- INIT_VARRAY (localsym_t), /* symbols: local symbols varray */
+ INIT_VARRAY (localsym_t), /* symbols: local symbols varray */
INIT_VARRAY (proc_t), /* procs: procedure varray */
INIT_VARRAY (aux_t), /* aux_syms: auxiliary symbols varray */
- (struct efdr *)0, /* next_file: next file structure */
+ 0, /* next_file: next file structure */
- (htab_t)0, /* str_hash: string hash table */
+ 0, /* str_hash: string hash table */
{ 0 }, /* thash_head: type hash table */
};
int ecoff_debugging_seen = 0;
/* Various statics. */
-static efdr_t *cur_file_ptr = (efdr_t *) 0; /* current file desc. header */
-static proc_t *cur_proc_ptr = (proc_t *) 0; /* current procedure header */
-static proc_t *first_proc_ptr = (proc_t *) 0; /* first procedure header */
-static thead_t *top_tag_head = (thead_t *) 0; /* top level tag head */
-static thead_t *cur_tag_head = (thead_t *) 0; /* current tag head */
+static efdr_t *cur_file_ptr = 0; /* current file desc. header */
+static proc_t *cur_proc_ptr = 0; /* current procedure header */
+static proc_t *first_proc_ptr = 0; /* first procedure header */
+static thead_t *top_tag_head = 0; /* top level tag head */
+static thead_t *cur_tag_head = 0; /* current tag head */
#ifdef ECOFF_DEBUG
static int debug = 0; /* trace functions */
#endif
{
tag_hash = str_htab_create ();
top_tag_head = allocate_thead ();
- top_tag_head->first_tag = (tag_t *) NULL;
- top_tag_head->free = (thead_t *) NULL;
+ top_tag_head->first_tag = NULL;
+ top_tag_head->free = NULL;
top_tag_head->prev = cur_tag_head;
cur_tag_head = top_tag_head;
}
symbol created by md_begin which may required special handling at
some point. Creating a dummy file with a dummy name is certainly
wrong. */
- if (cur_file_ptr == (efdr_t *) NULL
+ if (cur_file_ptr == NULL
&& seen_at_least_1_file ())
- add_file ((const char *) NULL, 0, 1);
+ add_file (NULL, 0, 1);
obj = symbol_get_obj (symbolP);
obj->ecoff_file = cur_file_ptr;
obj->ecoff_symbol = NULL;
new_links->start_index = vp->num_allocated;
vp->objects_last_page = 0;
- if (vp->first == (vlinks_t *) NULL) /* first allocation? */
+ if (vp->first == NULL) /* first allocation? */
vp->first = vp->last = new_links;
else
{ /* 2nd or greater allocation */
as_fatal (_("duplicate %s"), str);
}
- if (ret_hash != (shash_t **) NULL)
+ if (ret_hash != NULL)
*ret_hash = hash_ptr;
return hash_ptr->indx;
tag_t *ptag_next;
varray_t *vp;
int scope_delta = 0;
- shash_t *hash_ptr = (shash_t *) NULL;
+ shash_t *hash_ptr = NULL;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
as_fatal (_("no current file pointer"));
vp = &cur_file_ptr->symbols;
psym = &vp->last->datum->sym[vp->objects_last_page++];
- if (str == (const char *) NULL && sym_value != (symbolS *) NULL)
+ if (str == NULL && sym_value != NULL)
psym->name = S_GET_NAME (sym_value);
else
psym->name = str;
psym->as_sym = sym_value;
- if (sym_value != (symbolS *) NULL)
+ if (sym_value != NULL)
symbol_get_obj (sym_value)->ecoff_symbol = psym;
psym->addend = addend;
psym->file_ptr = cur_file_ptr;
psym->proc_ptr = cur_proc_ptr;
- psym->begin_ptr = (localsym_t *) NULL;
- psym->index_ptr = (aux_t *) NULL;
- psym->forward_ref = (forward_t *) NULL;
+ psym->begin_ptr = NULL;
+ psym->index_ptr = NULL;
+ psym->forward_ref = NULL;
psym->sym_index = -1;
memset (&psym->ecoff_sym, 0, sizeof (EXTR));
psym->ecoff_sym.asym.value = value;
assembly before deciding where to put the name (it may be just an
external symbol). Otherwise, this is just a debugging symbol and
the name should go with the current file. */
- if (sym_value == (symbolS *) NULL)
- psym->ecoff_sym.asym.iss = ((str == (const char *) NULL)
+ if (sym_value == NULL)
+ psym->ecoff_sym.asym.iss = (str == NULL
? 0
: add_string (&cur_file_ptr->strings,
cur_file_ptr->str_hash,
/* Save the symbol within the hash table if this is a static
item, and it has a name. */
- if (hash_ptr != (shash_t *) NULL
+ if (hash_ptr != NULL
&& (type == st_Global || type == st_Static || type == st_Label
|| type == st_Proc || type == st_StaticProc))
hash_ptr->sym_ptr = psym;
case st_End:
pscope = cur_file_ptr->cur_scope;
- if (pscope == (scope_t *) NULL)
+ if (pscope == NULL)
as_fatal (_("too many st_End's"));
else
{
cur_tag_head = ptag_head->prev;
for (ptag = ptag_head->first_tag;
- ptag != (tag_t *) NULL;
+ ptag != NULL;
ptag = ptag_next)
{
- if (ptag->forward_ref != (forward_t *) NULL)
+ if (ptag->forward_ref != NULL)
add_unknown_tag (ptag);
ptag_next = ptag->same_block;
varray_t *vp;
aux_t *aux_ptr;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
as_fatal (_("no current file pointer"));
vp = &cur_file_ptr->aux_syms;
varray_t *vp;
aux_t *aux_ptr;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
as_fatal (_("no current file pointer"));
vp = &cur_file_ptr->aux_syms;
int i;
AUXU aux;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
as_fatal (_("no current file pointer"));
vp = &cur_file_ptr->aux_syms;
hi %= THASH_SIZE;
for (hash_ptr = hash_tbl[hi];
- hash_ptr != (thash_t *)0;
+ hash_ptr;
hash_ptr = hash_ptr->next)
{
if (aux.isym == hash_ptr->type.isym)
break;
}
- if (hash_ptr != (thash_t *) NULL && state == hash_yes)
+ if (hash_ptr != NULL && state == hash_yes)
return hash_ptr->indx;
- if (hash_ptr == (thash_t *) NULL)
+ if (hash_ptr == NULL)
{
hash_ptr = allocate_thash ();
hash_ptr->next = hash_tbl[hi];
localsym_t *sym = t->tag_ptr->sym;
forward_t *forward_ref = allocate_forward ();
- if (sym != (localsym_t *) NULL)
+ if (sym != NULL)
{
forward_ref->next = sym->forward_ref;
sym->forward_ref = forward_ref;
shash_t *hash_ptr;
tag_t *tag_ptr;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
as_fatal (_("no current file pointer"));
hash_ptr = str_hash_find (tag_hash, tag);
- if (hash_ptr != (shash_t *) NULL
- && hash_ptr->tag_ptr != (tag_t *) NULL)
+ if (hash_ptr != NULL
+ && hash_ptr->tag_ptr != NULL)
{
tag_ptr = hash_ptr->tag_ptr;
- if (sym != (localsym_t *) NULL)
+ if (sym != NULL)
{
tag_ptr->basic_type = basic_type;
tag_ptr->ifd = cur_file_ptr->file_index;
return tag_ptr;
}
- if (hash_ptr == (shash_t *) NULL)
+ if (hash_ptr == NULL)
{
char *perm;
}
tag_ptr = allocate_tag ();
- tag_ptr->forward_ref = (forward_t *) NULL;
+ tag_ptr->forward_ref = NULL;
tag_ptr->hash_ptr = hash_ptr;
tag_ptr->same_name = hash_ptr->tag_ptr;
tag_ptr->basic_type = basic_type;
tag_ptr->sym = sym;
- tag_ptr->ifd = ((sym == (localsym_t *) NULL)
+ tag_ptr->ifd = (sym == NULL
? (symint_t) -1
: cur_file_ptr->file_index);
tag_ptr->same_block = cur_tag_head->first_tag;
(void) add_ecoff_symbol (name, st_End, sc_Info, NULL, 0, 0, 0);
- for (pf = &sym->forward_ref; *pf != (forward_t *) NULL; pf = &(*pf)->next)
+ for (pf = &sym->forward_ref; *pf != NULL; pf = &(*pf)->next)
;
*pf = ptag->forward_ref;
}
if (aent)
return;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
as_fatal (_("no current file pointer"));
vp = &cur_file_ptr->procs;
cur_proc_ptr = new_proc_ptr = &vp->last->datum->proc[vp->objects_last_page++];
- if (first_proc_ptr == (proc_t *) NULL)
+ if (first_proc_ptr == NULL)
first_proc_ptr = new_proc_ptr;
vp->num_allocated++;
++proc_cnt;
/* Fill in the linenos preceding the .ent, if any. */
- if (noproc_lineno != (lineno_list_t *) NULL)
+ if (noproc_lineno != NULL)
{
lineno_list_t *l;
- for (l = noproc_lineno; l != (lineno_list_t *) NULL; l = l->next)
+ for (l = noproc_lineno; l != NULL; l = l->next)
l->proc = new_proc_ptr;
*last_lineno_ptr = noproc_lineno;
while (*last_lineno_ptr != NULL)
last_lineno = *last_lineno_ptr;
last_lineno_ptr = &last_lineno->next;
}
- noproc_lineno = (lineno_list_t *) NULL;
+ noproc_lineno = NULL;
}
}
/* If the file name is NULL, then no .file symbol appeared, and we
want to use the actual file name. */
- if (file_name == (const char *) NULL)
+ if (file_name == NULL)
{
- if (first_file != (efdr_t *) NULL)
+ if (first_file != NULL)
as_fatal (_("fake .file after real one"));
- file_name = as_where ((unsigned int *) NULL);
+ file_name = as_where (NULL);
/* Automatically generate ECOFF debugging information, since I
think that's what other ECOFF assemblers do. We don't do
/* See if the file has already been created. */
for (fil_ptr = first_file;
- fil_ptr != (efdr_t *) NULL;
+ fil_ptr != NULL;
fil_ptr = fil_ptr->next_file)
{
if (first_ch == fil_ptr->name[0]
}
/* If this is a new file, create it. */
- if (fil_ptr == (efdr_t *) NULL)
+ if (fil_ptr == NULL)
{
if (file_desc.objects_last_page == file_desc.objects_per_page)
add_varray_page (&file_desc);
fil_ptr->str_hash = str_htab_create ();
/* Make sure 0 byte in string table is null */
- add_string (&fil_ptr->strings,
- fil_ptr->str_hash,
- "",
- (shash_t **)0);
+ add_string (&fil_ptr->strings, fil_ptr->str_hash, "", NULL);
if (strlen (file_name) > PAGE_USIZE - 2)
as_fatal (_("filename goes over one page boundary"));
char *name;
char name_end;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
{
as_warn (_(".begin directive without a preceding .file directive"));
demand_empty_rest_of_line ();
return;
}
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".begin directive without a preceding .ent directive"));
demand_empty_rest_of_line ();
char name_end;
symbolS *endsym;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
{
as_warn (_(".bend directive without a preceding .file directive"));
demand_empty_rest_of_line ();
return;
}
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".bend directive without a preceding .ent directive"));
demand_empty_rest_of_line ();
corresponding symbol. We fill in the offset when we write out
the symbol. */
endsym = symbol_find (name);
- if (endsym == (symbolS *) NULL)
+ if (endsym == NULL)
as_warn (_(".bend directive names unknown symbol"));
else
(void) add_ecoff_symbol (NULL, st_End, sc_Text, endsym, 0, 0, 0);
name_end = get_symbol_name (&name);
- if (coff_sym_name != (char *) NULL)
+ if (coff_sym_name != NULL)
as_warn (_(".def pseudo-op used inside of .def/.endef; ignored"));
else if (*name == '\0')
as_warn (_("empty symbol name in .def; ignored"));
coff_storage_class = sc_Nil;
coff_symbol_typ = st_Nil;
coff_is_function = 0;
- coff_tag = (char *) NULL;
+ coff_tag = NULL;
coff_value = 0;
- coff_sym_value = (symbolS *) NULL;
+ coff_sym_value = NULL;
coff_sym_addend = 0;
}
int dimens[N_TQ];
int i;
- if (coff_sym_name == (char *) NULL)
+ if (coff_sym_name == NULL)
{
as_warn (_(".dim pseudo-op used outside of .def/.endef; ignored"));
demand_empty_rest_of_line ();
{
long val;
- if (coff_sym_name == (char *) NULL)
+ if (coff_sym_name == NULL)
{
as_warn (_(".scl pseudo-op used outside of .def/.endef; ignored"));
demand_empty_rest_of_line ();
int sizes[N_TQ];
int i;
- if (coff_sym_name == (char *) NULL)
+ if (coff_sym_name == NULL)
{
as_warn (_(".size pseudo-op used outside of .def/.endef; ignored"));
demand_empty_rest_of_line ();
tq_t *tq_ptr;
tq_t *tq_shft;
- if (coff_sym_name == (char *) NULL)
+ if (coff_sym_name == NULL)
{
as_warn (_(".type pseudo-op used outside of .def/.endef; ignored"));
demand_empty_rest_of_line ();
char *name;
char name_end;
- if (coff_sym_name == (char *) NULL)
+ if (coff_sym_name == NULL)
{
as_warn (_(".tag pseudo-op used outside of .def/.endef; ignored"));
demand_empty_rest_of_line ();
{
expressionS exp;
- if (coff_sym_name == (char *) NULL)
+ if (coff_sym_name == NULL)
{
as_warn (_(".val pseudo-op used outside of .def/.endef; ignored"));
demand_empty_rest_of_line ();
demand_empty_rest_of_line ();
- if (coff_sym_name == (char *) NULL)
+ if (coff_sym_name == NULL)
{
as_warn (_(".endef pseudo-op used before .def; ignored"));
return;
}
name = coff_sym_name;
- coff_sym_name = (char *) NULL;
+ coff_sym_name = NULL;
/* If the symbol is a static or external, we have already gotten the
appropriate type and class, so make sure we don't override those
values. This is needed because there are some type and classes
that are not in COFF, such as short data, etc. */
- if (coff_sym_value != (symbolS *) NULL)
+ if (coff_sym_value != NULL)
{
coff_symbol_typ = st_Nil;
coff_storage_class = sc_Nil;
}
- coff_type.extra_sizes = coff_tag != (char *) NULL;
+ coff_type.extra_sizes = coff_tag != NULL;
if (coff_type.num_dims > 0)
{
int diff = coff_type.num_dims - coff_type.num_sizes;
|| coff_type.basic_type == bt_Union
|| coff_type.basic_type == bt_Enum)
{
- if (coff_tag == (char *) NULL)
+ if (coff_tag == NULL)
{
as_warn (_("no tag specified for %s"), name);
return;
}
- coff_type.tag_ptr = get_tag (coff_tag, (localsym_t *) NULL,
- coff_type.basic_type);
+ coff_type.tag_ptr = get_tag (coff_tag, NULL, coff_type.basic_type);
}
if (coff_is_function)
that any error reporting above gives the correct name. */
case st_End:
free (name);
- name = (char *) NULL;
+ name = NULL;
coff_value = 0;
coff_inside_enumeration = 0;
break;
/* Remember any forward references. */
for (pf = &sym->forward_ref;
- *pf != (forward_t *) NULL;
+ *pf != NULL;
pf = &(*pf)->next)
;
*pf = tag_ptr->forward_ref;
- tag_ptr->forward_ref = (forward_t *) NULL;
+ tag_ptr->forward_ref = NULL;
}
}
\f
char name_end;
symbolS *ent;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
{
as_warn (_(".end directive without a preceding .file directive"));
demand_empty_rest_of_line ();
return;
}
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".end directive without a preceding .ent directive"));
demand_empty_rest_of_line ();
current location, and put in the offset when we write out the
symbol. */
ent = symbol_find (name);
- if (ent == (symbolS *) NULL)
+ if (ent == NULL)
as_warn (_(".end directive names unknown symbol"));
else
(void) add_ecoff_symbol (NULL, st_End, sc_Text,
md_flush_pending_output ();
#endif
- cur_proc_ptr = (proc_t *) NULL;
+ cur_proc_ptr = NULL;
(void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
char *name;
char name_end;
- if (cur_file_ptr == (efdr_t *) NULL)
- add_file ((const char *) NULL, 0, 1);
+ if (cur_file_ptr == NULL)
+ add_file (NULL, 0, 1);
- if (!aent && cur_proc_ptr != (proc_t *) NULL)
+ if (!aent && cur_proc_ptr != NULL)
{
as_warn (_("second .ent directive found before .end directive"));
demand_empty_rest_of_line ();
char *name;
int len;
- if (cur_proc_ptr != (proc_t *) NULL)
+ if (cur_proc_ptr != NULL)
{
as_warn (_("no way to handle .file within .ent/.end section"));
demand_empty_rest_of_line ();
{
long val;
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".fmask outside of .ent"));
demand_empty_rest_of_line ();
{
long val;
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".frame outside of .ent"));
demand_empty_rest_of_line ();
{
long val;
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
as_warn (_(".mask outside of .ent"));
demand_empty_rest_of_line ();
lineno_list_t *list;
symint_t lineno;
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
{
as_warn (_(".loc before .file"));
demand_empty_rest_of_line ();
list = allocate_lineno_list ();
- list->next = (lineno_list_t *) NULL;
+ list->next = NULL;
list->file = cur_file_ptr;
list->proc = cur_proc_ptr;
list->frag = frag_now;
/* A .loc directive will sometimes appear before a .ent directive,
which means that cur_proc_ptr will be NULL here. Arrange to
patch this up. */
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
lineno_list_t **pl;
pl = &noproc_lineno;
- while (*pl != (lineno_list_t *) NULL)
+ while (*pl != NULL)
pl = &(*pl)->next;
*pl = list;
}
as_warn (_(".stab%c: ignoring non-zero other field"), what);
/* Make sure we have a current file. */
- if (cur_file_ptr == (efdr_t *) NULL)
+ if (cur_file_ptr == NULL)
{
- add_file ((const char *) NULL, 0, 1);
+ add_file (NULL, 0, 1);
save_file_ptr = cur_file_ptr;
}
{
st = st_Nil;
sc = sc_Nil;
- sym = (symbolS *) NULL;
+ sym = NULL;
value = get_absolute_expression ();
addend = 0;
}
/* Don't store the stabs symbol we are creating as the type of the
ECOFF symbol. We want to compute the type of the ECOFF symbol
independently. */
- if (sym != (symbolS *) NULL)
+ if (sym != NULL)
hold = symbol_get_obj (sym)->ecoff_symbol;
(void) add_ecoff_symbol (string, st, sc, sym, addend, value, indx);
- if (sym != (symbolS *) NULL)
+ if (sym != NULL)
symbol_get_obj (sym)->ecoff_symbol = hold;
/* Restore normal file type. */
(void) ecoff_add_bytes (buf, bufend, *buf + offset, add);
memset (*buf + offset, 0, add);
offset += add;
- if (bufptrptr != (char **) NULL)
+ if (bufptrptr != NULL)
*bufptrptr = *buf + offset;
}
lineno_list_t first;
lineno_list_t *local_first_lineno = first_lineno;
- if (linecntptr != (long *) NULL)
+ if (linecntptr != NULL)
*linecntptr = 0;
bufptr = *buf + offset;
- file = (efdr_t *) NULL;
- proc = (proc_t *) NULL;
- last = (lineno_list_t *) NULL;
+ file = NULL;
+ proc = NULL;
+ last = NULL;
c = offset;
iline = 0;
totcount = 0;
Don't do this for ECOFF assembly source line numbers. They work
without this extra attention. */
if (debug_type != DEBUG_ECOFF
- && first_proc_ptr != (proc_t *) NULL
- && local_first_lineno != (lineno_list_t *) NULL
+ && first_proc_ptr != NULL
+ && local_first_lineno != NULL
&& ((S_GET_VALUE (first_proc_ptr->sym->as_sym)
+ bfd_section_vma (S_GET_SEGMENT (first_proc_ptr->sym->as_sym)))
!= 0))
local_first_lineno = &first;
}
- for (l = local_first_lineno; l != (lineno_list_t *) NULL; l = l->next)
+ for (l = local_first_lineno; l != NULL; l = l->next)
{
long count;
long delta;
/* Get the offset to the memory address of the next line number
(in words). Do this first, so that we can skip ahead to the
next useful line number entry. */
- if (l->next == (lineno_list_t *) NULL)
+ if (l->next == NULL)
{
/* We want a count of zero, but it will be decremented
before it is used. */
if (l->file != file || l->proc != proc)
{
- if (l->proc != proc && proc != (proc_t *) NULL)
+ if (l->proc != proc && proc != NULL)
proc->pdr.lnHigh = last->lineno;
- if (l->file != file && file != (efdr_t *) NULL)
+ if (l->file != file && file != NULL)
{
file->fdr.cbLine = c - file->fdr.cbLineOffset;
file->fdr.cline = totcount + count;
- if (linecntptr != (long *) NULL)
+ if (linecntptr != NULL)
*linecntptr += totcount + count;
totcount = 0;
}
efdr_t *last_file = file;
file = l->file;
- if (last_file != (efdr_t *) NULL)
+ if (last_file != NULL)
file->fdr.ilineBase
= last_file->fdr.ilineBase + last_file->fdr.cline;
else
if (l->proc != proc)
{
proc = l->proc;
- if (proc != (proc_t *) NULL)
+ if (proc != NULL)
{
proc->pdr.lnLow = l->lineno;
proc->pdr.cbLineOffset = c - file->fdr.cbLineOffset;
}
}
- last = (lineno_list_t *) NULL;
+ last = NULL;
}
totcount += count;
/* Get the offset to this line number. */
- if (last == (lineno_list_t *) NULL)
+ if (last == NULL)
delta = 0;
else
delta = l->lineno - last->lineno;
last = l;
}
- if (proc != (proc_t *) NULL)
+ if (proc != NULL)
proc->pdr.lnHigh = last->lineno;
- if (file != (efdr_t *) NULL)
+ if (file != NULL)
{
file->fdr.cbLine = c - file->fdr.cbLineOffset;
file->fdr.cline = totcount;
}
- if (linecntptr != (long *) NULL)
+ if (linecntptr != NULL)
*linecntptr += totcount;
c = ecoff_padding_adjust (backend, buf, bufend, c, &bufptr);
/* The symbols are stored by file. */
for (file_link = file_desc.first;
- file_link != (vlinks_t *) NULL;
+ file_link != NULL;
file_link = file_link->next)
{
int ifilesym;
efdr_t *fil_ptr;
efdr_t *fil_end;
- if (file_link->next == (vlinks_t *) NULL)
+ if (file_link->next == NULL)
fil_cnt = file_desc.objects_last_page;
else
fil_cnt = file_desc.objects_per_page;
fil_ptr->fdr.isymBase = isym;
ifilesym = isym;
for (sym_link = fil_ptr->symbols.first;
- sym_link != (vlinks_t *) NULL;
+ sym_link != NULL;
sym_link = sym_link->next)
{
int sym_cnt;
localsym_t *sym_ptr;
localsym_t *sym_end;
- if (sym_link->next == (vlinks_t *) NULL)
+ if (sym_link->next == NULL)
sym_cnt = fil_ptr->symbols.objects_last_page;
else
sym_cnt = fil_ptr->symbols.objects_per_page;
information for the external). */
local = 1;
as_sym = sym_ptr->as_sym;
- if (as_sym != (symbolS *) NULL)
+ if (as_sym != NULL)
{
symint_t indx;
{
symbolS *begin_sym;
- know (sym_ptr->proc_ptr != (proc_t *) NULL);
+ know (sym_ptr->proc_ptr != NULL);
begin_sym = sym_ptr->proc_ptr->sym->as_sym;
if (S_GET_SEGMENT (as_sym)
!= S_GET_SEGMENT (begin_sym))
if ((S_IS_EXTERNAL (as_sym)
|| S_IS_WEAK (as_sym)
|| ! S_IS_DEFINED (as_sym))
- && sym_ptr->proc_ptr == (proc_t *) NULL
+ && sym_ptr->proc_ptr == NULL
&& sym_ptr->ecoff_sym.asym.st != st_Nil
&& ! ECOFF_IS_STAB (&sym_ptr->ecoff_sym.asym))
local = 0;
add_string (&fil_ptr->strings,
fil_ptr->str_hash,
sym_ptr->name,
- (shash_t **) NULL);
+ NULL);
}
/* We now know the index of this symbol; fill in
locations that have been waiting for that
information. */
- if (sym_ptr->begin_ptr != (localsym_t *) NULL)
+ if (sym_ptr->begin_ptr != NULL)
{
localsym_t *begin_ptr;
st_t begin_type;
}
else
{
- know (begin_ptr->index_ptr != (aux_t *) NULL);
+ know (begin_ptr->index_ptr != NULL);
begin_ptr->index_ptr->data.isym =
isym - ifilesym + 1;
}
if (begin_type == st_Proc
|| begin_type == st_StaticProc)
{
- know (as_sym != (symbolS *) NULL);
- know (begin_ptr->as_sym != (symbolS *) NULL);
+ know (as_sym != NULL);
+ know (begin_ptr->as_sym != NULL);
if (S_GET_SEGMENT (as_sym)
!= S_GET_SEGMENT (begin_ptr->as_sym))
as_warn (_(".begin/.bend in different segments"));
{
symbolS *begin_sym;
- know (as_sym != (symbolS *) NULL);
- know (sym_ptr->proc_ptr != (proc_t *) NULL);
+ know (as_sym != NULL);
+ know (sym_ptr->proc_ptr != NULL);
begin_sym = sym_ptr->proc_ptr->sym->as_sym;
if (S_GET_SEGMENT (as_sym)
!= S_GET_SEGMENT (begin_sym))
}
for (f = sym_ptr->forward_ref;
- f != (forward_t *) NULL;
+ f != NULL;
f = f->next)
{
know (local);
sym_ptr->sym_index = isym;
- if (sym_ptr->proc_ptr != (proc_t *) NULL
+ if (sym_ptr->proc_ptr != NULL
&& sym_ptr->proc_ptr->sym == sym_ptr)
sym_ptr->proc_ptr->pdr.isym = isym - ifilesym;
/* Record the local symbol index and file number in
case this is an external symbol. Note that this
destroys the asym.index field. */
- if (as_sym != (symbolS *) NULL
+ if (as_sym != NULL
&& symbol_get_obj (as_sym)->ecoff_symbol == sym_ptr)
{
if ((sym_ptr->ecoff_sym.asym.st == st_Proc
/* The procedures are stored by file. */
for (file_link = file_desc.first;
- file_link != (vlinks_t *) NULL;
+ file_link != NULL;
file_link = file_link->next)
{
int fil_cnt;
efdr_t *fil_ptr;
efdr_t *fil_end;
- if (file_link->next == (vlinks_t *) NULL)
+ if (file_link->next == NULL)
fil_cnt = file_desc.objects_last_page;
else
fil_cnt = file_desc.objects_per_page;
fil_ptr->fdr.ipdFirst = iproc;
first = 1;
for (proc_link = fil_ptr->procs.first;
- proc_link != (vlinks_t *) NULL;
+ proc_link != NULL;
proc_link = proc_link->next)
{
int prc_cnt;
proc_t *proc_ptr;
proc_t *proc_end;
- if (proc_link->next == (vlinks_t *) NULL)
+ if (proc_link->next == NULL)
prc_cnt = fil_ptr->procs.objects_last_page;
else
prc_cnt = fil_ptr->procs.objects_per_page;
/* The aux entries are stored by file. */
for (file_link = file_desc.first;
- file_link != (vlinks_t *) NULL;
+ file_link != NULL;
file_link = file_link->next)
{
int fil_cnt;
efdr_t *fil_ptr;
efdr_t *fil_end;
- if (file_link->next == (vlinks_t *) NULL)
+ if (file_link->next == NULL)
fil_cnt = file_desc.objects_last_page;
else
fil_cnt = file_desc.objects_per_page;
fil_ptr->fdr.fBigendian = bigendian;
fil_ptr->fdr.iauxBase = iaux;
for (aux_link = fil_ptr->aux_syms.first;
- aux_link != (vlinks_t *) NULL;
+ aux_link != NULL;
aux_link = aux_link->next)
{
int aux_cnt;
aux_t *aux_ptr;
aux_t *aux_end;
- if (aux_link->next == (vlinks_t *) NULL)
+ if (aux_link->next == NULL)
aux_cnt = fil_ptr->aux_syms.objects_last_page;
else
aux_cnt = fil_ptr->aux_syms.objects_per_page;
return ecoff_padding_adjust (backend, buf, bufend,
offset + iaux * sizeof (union aux_ext),
- (char **) NULL);
+ NULL);
}
/* Copy out the strings from a varray_t. This returns the number of
istr = 0;
for (str_link = vp->first;
- str_link != (vlinks_t *) NULL;
+ str_link != NULL;
str_link = str_link->next)
{
unsigned long str_cnt;
- if (str_link->next == (vlinks_t *) NULL)
+ if (str_link->next == NULL)
str_cnt = vp->objects_last_page;
else
str_cnt = vp->objects_per_page;
iss = 0;
for (file_link = file_desc.first;
- file_link != (vlinks_t *) NULL;
+ file_link != NULL;
file_link = file_link->next)
{
int fil_cnt;
efdr_t *fil_ptr;
efdr_t *fil_end;
- if (file_link->next == (vlinks_t *) NULL)
+ if (file_link->next == NULL)
fil_cnt = file_desc.objects_last_page;
else
fil_cnt = file_desc.objects_per_page;
}
}
- return ecoff_padding_adjust (backend, buf, bufend, offset + iss,
- (char **) NULL);
+ return ecoff_padding_adjust (backend, buf, bufend, offset + iss, NULL);
}
/* Swap out the file descriptors. */
fdr_out = *buf + offset;
for (file_link = file_desc.first;
- file_link != (vlinks_t *) NULL;
+ file_link != NULL;
file_link = file_link->next)
{
int fil_cnt;
efdr_t *fil_ptr;
efdr_t *fil_end;
- if (file_link->next == (vlinks_t *) NULL)
+ if (file_link->next == NULL)
fil_cnt = file_desc.objects_last_page;
else
fil_cnt = file_desc.objects_per_page;
{
symbolS *sym;
- for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (sym))
+ for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym))
{
if (symbol_get_obj (sym)->ecoff_symbol == NULL)
continue;
unsigned long offset;
/* Make sure we have a file. */
- if (first_file == (efdr_t *) NULL)
- add_file ((const char *) NULL, 0, 1);
+ if (first_file == NULL)
+ add_file (NULL, 0, 1);
/* Handle any top level tags. */
for (ptag = top_tag_head->first_tag;
- ptag != (tag_t *) NULL;
+ ptag != NULL;
ptag = ptag_next)
{
- if (ptag->forward_ref != (forward_t *) NULL)
+ if (ptag->forward_ref != NULL)
add_unknown_tag (ptag);
ptag_next = ptag->same_block;
symbol that has not already received it. */
hold_file_ptr = cur_file_ptr;
hold_proc_ptr = cur_proc_ptr;
- cur_proc_ptr = (proc_t *) NULL;
- for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (sym))
+ cur_proc_ptr = NULL;
+ for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym))
{
if (symbol_get_obj (sym)->ecoff_symbol != NULL
- || symbol_get_obj (sym)->ecoff_file == (efdr_t *) NULL
+ || symbol_get_obj (sym)->ecoff_file == NULL
|| (symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) != 0)
continue;
files. */
end_warning = 0;
for (fil_ptr = first_file;
- fil_ptr != (efdr_t *) NULL;
+ fil_ptr != NULL;
fil_ptr = fil_ptr->next_file)
{
cur_file_ptr = fil_ptr;
- while (cur_file_ptr->cur_scope != (scope_t *) NULL
- && cur_file_ptr->cur_scope->prev != (scope_t *) NULL)
+ while (cur_file_ptr->cur_scope != NULL
+ && cur_file_ptr->cur_scope->prev != NULL)
{
cur_file_ptr->cur_scope = cur_file_ptr->cur_scope->prev;
if (! end_warning && ! cur_file_ptr->fake)
end_warning = 1;
}
}
- if (cur_file_ptr->cur_scope != (scope_t *) NULL)
+ if (cur_file_ptr->cur_scope != NULL)
(void) add_ecoff_symbol (NULL, st_End, sc_Text, NULL, 0, 0, 0);
}
#ifndef MALLOC_CHECK
ptr = alloc_counts[alloc_type_scope].free_list.f_scope;
- if (ptr != (scope_t *) NULL)
+ if (ptr != NULL)
alloc_counts[alloc_type_scope].free_list.f_scope = ptr->free;
else
{
#ifndef MALLOC_CHECK
ptr = alloc_counts[alloc_type_tag].free_list.f_tag;
- if (ptr != (tag_t *) NULL)
+ if (ptr != NULL)
alloc_counts[alloc_type_tag].free_list.f_tag = ptr->free;
else
{
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);
+ free (ptr);
#endif
}
\f
alloc_counts[alloc_type_thead].total_free++;
#ifndef MALLOC_CHECK
- ptr->free = (thead_t *) alloc_counts[alloc_type_thead].free_list.f_thead;
+ ptr->free = alloc_counts[alloc_type_thead].free_list.f_thead;
alloc_counts[alloc_type_thead].free_list.f_thead = ptr;
#else
- free ((PTR_T) ptr);
+ free (ptr);
#endif
}
\f
int
ecoff_no_current_file (void)
{
- return cur_file_ptr == (efdr_t *) NULL;
+ return cur_file_ptr == NULL;
}
void
filename = as_where (&lineno);
- if (current_stabs_filename == (char *) NULL
+ if (current_stabs_filename == NULL
|| filename_cmp (current_stabs_filename, filename))
add_file (filename, 0, 1);
list = allocate_lineno_list ();
- list->next = (lineno_list_t *) NULL;
+ list->next = NULL;
list->file = cur_file_ptr;
list->proc = cur_proc_ptr;
list->frag = frag_now;
/* A .loc directive will sometimes appear before a .ent directive,
which means that cur_proc_ptr will be NULL here. Arrange to
patch this up. */
- if (cur_proc_ptr == (proc_t *) NULL)
+ if (cur_proc_ptr == NULL)
{
lineno_list_t **pl;
pl = &noproc_lineno;
- while (*pl != (lineno_list_t *) NULL)
+ while (*pl != NULL)
pl = &(*pl)->next;
*pl = list;
}
static symbolS *
symbol_lookup_or_make (const char *name, bool start)
{
- char *buf = concat (start ? ".startof." : ".sizeof.", name, NULL);
+ char *buf = concat (start ? ".startof." : ".sizeof.", name, (char *) NULL);
symbolS *symbolP;
unsigned int i;
void
input_file_begin (void)
{
- f_in = (FILE *) 0;
+ f_in = NULL;
}
void
char *return_value; /* -> Last char of what we read, + 1. */
size_t size;
- if (f_in == (FILE *) 0)
+ if (f_in == NULL)
return 0;
/* fflush (stdin); could be done here if you want to synchronise
stdin and stdout, for the case where our input file is stdin.
if (fclose (f_in))
as_warn (_("can't close %s: %s"), file_name, xstrerror (errno));
- f_in = (FILE *) 0;
+ f_in = NULL;
return_value = 0;
}
static void
listing_message (const char *name, const char *message)
{
- if (listing_tail != (list_info_type *) NULL)
+ if (listing_tail != NULL)
{
char *n = concat (name, message, (char *) NULL);
struct list_message *lm = XNEW (struct list_message);
/* Find an entry with this file name. */
file_info_type *p = file_info_head;
- while (p != (file_info_type *) NULL)
+ while (p != NULL)
{
if (filename_cmp (p->filename, file_name) == 0)
return p;
new_i->frag = frag_now;
new_i->line = line;
new_i->file = file_info (file);
- new_i->next = (list_info_type *) NULL;
+ new_i->next = NULL;
new_i->messages = NULL;
new_i->last_message = NULL;
new_i->edict = EDICT_NONE;
- new_i->hll_file = (file_info_type *) NULL;
+ new_i->hll_file = NULL;
new_i->hll_line = 0;
new_frag ();
list_info_type *l;
fragS *f;
- if (head == (list_info_type *) NULL
+ if (head == NULL
|| head == listing_tail)
return;
for (l = head; l->next != listing_tail; l = l->next)
;
- for (f = frchain_now->frch_root; f != (fragS *) NULL; f = f->fr_next)
+ for (f = frchain_now->frch_root; f != NULL; f = f->fr_next)
if (f->line == listing_tail)
f->line = l;
data_buffer_size = 0;
/* Dump all the frags which belong to this line. */
- while (frag_ptr != (fragS *) NULL && frag_ptr->line == first)
+ while (frag_ptr != NULL && frag_ptr->line == first)
{
/* Print as many bytes from the fixed part as is sensible. */
octet_in_frag = 0;
got_some = 0;
- for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
+ for (ptr = symbol_rootP; ptr != NULL; ptr = symbol_next (ptr))
{
if (S_GET_NAME (ptr) && strlen (S_GET_NAME (ptr)) != 0)
{
va_start (args, format);
vsnprintf (buffer, sizeof (buffer), format, args);
va_end (args);
- as_warn_internal ((char *) NULL, 0, buffer);
+ as_warn_internal (NULL, 0, buffer);
}
}
vsnprintf (buffer, sizeof (buffer), format, args);
va_end (args);
- as_bad_internal ((char *) NULL, 0, buffer);
+ as_bad_internal (NULL, 0, buffer);
}
/* Like as_bad but the file name and line number are passed in.
|| pop->poc_handler == s_globl
|| pop->poc_handler == s_ignore)))
{
- do_align (1, (char *) NULL, 0, 0);
+ do_align (1, NULL, 0, 0);
mri_pending_align = 0;
if (line_label != NULL)
if (mri_pending_align)
{
- do_align (1, (char *) NULL, 0, 0);
+ do_align (1, NULL, 0, 0);
mri_pending_align = 0;
if (line_label != NULL)
{
{
if (arg < 0)
as_warn (_("expected fill pattern missing"));
- do_align (align, (char *) NULL, 0, max);
+ do_align (align, NULL, 0, max);
}
else
{
}
else
{
- do_align (1, (char *) NULL, 0, 0);
+ do_align (1, NULL, 0, 0);
if (line_label != NULL)
{
symbol_set_frag (line_label, frag_now);
if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
{
const char *name = filename + map->old_len;
- return concat (map->new_prefix, name, NULL);
+ return concat (map->new_prefix, name, (const char *) NULL);
}
return xstrdup (filename);
RELOC_ENUM r_type /* Relocation type. */)
{
return fix_new_internal (frag, where, size, add_symbol,
- (symbolS *) NULL, offset, pcrel, r_type, false);
+ NULL, offset, pcrel, r_type, false);
}
/* Create a fixup for an expression. Currently we only support fixups
offsetT offset, int pcrel, RELOC_ENUM r_type)
{
return fix_new_internal (frag, 0, size, add_symbol,
- (symbolS *) NULL, offset, pcrel, r_type, true);
+ NULL, offset, pcrel, r_type, true);
}
/* Generic function to determine whether a fixup requires a relocation. */
prev_frag->fr_next = frchp->frch_root;
prev_frag = frchp->frch_last;
gas_assert (prev_frag->fr_type != 0);
- if (frchp->fix_root != (fixS *) NULL)
+ if (frchp->fix_root != NULL)
{
- if (seg_info (section)->fix_root == (fixS *) NULL)
+ if (seg_info (section)->fix_root == NULL)
seg_info (section)->fix_root = frchp->fix_root;
prev_fix->fx_next = frchp->fix_root;
seg_info (section)->fix_tail = frchp->fix_tail;
/* BFD may have introduced its own sections without using
subseg_new, so it is possible that seg_info is NULL. */
info = seg_info (section);
- if (info != (segment_info_type *) NULL)
+ if (info != NULL)
info->frchainP->frch_last
= chain_frchains_together_1 (section, info->frchainP);
n = 0;
r = my_reloc_list;
last_frag = NULL;
- for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
+ for (fixp = seginfo->fix_root; fixp != NULL; fixp = fixp->fx_next)
{
int fx_size, slack;
valueT loc;
bfd_map_over_sections (stdoutput, renumber_sections, &i);
}
- bfd_map_over_sections (stdoutput, chain_frchains_together, (char *) 0);
+ bfd_map_over_sections (stdoutput, chain_frchains_together, NULL);
/* We have two segments. If user gave -R flag, then we must put the
data frags into the text segment. Do this before relaxing so
struct broken_word *brokp;
for (brokp = broken_words;
- brokp != (struct broken_word *) NULL;
+ brokp != NULL;
brokp = brokp->next_broken_word)
{
brokp->added = 0;
- if (brokp->dispfrag != (fragS *) NULL
+ if (brokp->dispfrag != NULL
&& brokp->dispfrag->fr_type == rs_broken_word)
brokp->dispfrag->fr_subtype = 0;
}
TC_FINALIZE_SYMS_BEFORE_SIZE_SEG to 0. */
finalize_syms = TC_FINALIZE_SYMS_BEFORE_SIZE_SEG;
- bfd_map_over_sections (stdoutput, size_seg, (char *) 0);
+ bfd_map_over_sections (stdoutput, size_seg, NULL);
/* Relaxation has completed. Freeze all syms. */
finalize_syms = 1;
obj_frob_file_before_adjust ();
#endif
- bfd_map_over_sections (stdoutput, adjust_reloc_syms, (char *) 0);
+ bfd_map_over_sections (stdoutput, adjust_reloc_syms, NULL);
#ifdef tc_frob_file_before_fix
tc_frob_file_before_fix ();
obj_frob_file_before_fix ();
#endif
- bfd_map_over_sections (stdoutput, fix_segment, (char *) 0);
+ bfd_map_over_sections (stdoutput, fix_segment, NULL);
/* Set up symbol table, and write it out. */
if (symbol_rootP)
obj_coff_generate_pdata ();
#endif
- bfd_map_over_sections (stdoutput, write_relocs, (char *) 0);
+ bfd_map_over_sections (stdoutput, write_relocs, NULL);
reloc_list = NULL;
#ifdef tc_frob_file_after_relocs
flags = BFD_COMPRESS | BFD_COMPRESS_GABI | BFD_COMPRESS_ZSTD;
stdoutput->flags |= flags & bfd_applicable_file_flags (stdoutput);
if ((stdoutput->flags & BFD_COMPRESS) != 0)
- bfd_map_over_sections (stdoutput, compress_debug, (char *) 0);
+ bfd_map_over_sections (stdoutput, compress_debug, NULL);
}
- bfd_map_over_sections (stdoutput, write_contents, (char *) 0);
+ bfd_map_over_sections (stdoutput, write_contents, NULL);
}
#ifdef TC_GENERIC_RELAX_TABLE