]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas NULL casts
authorAlan Modra <amodra@gmail.com>
Tue, 8 Jul 2025 23:29:10 +0000 (08:59 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 9 Jul 2025 00:05:06 +0000 (09:35 +0930)
This removes many unnecessary NULL casts.  I'm also adding a few arg
casts in concat calls, to make the code consistent.  Advice from quite
a few years ago was that it's better to use the exact type for args
corresponding to function ellipses, in case NULL is defined as plain
0.  (I think that happened with some early 64-bit systems.  Plain NULL
ought to be OK nowadays.)

69 files changed:
gas/as.c
gas/cgen.c
gas/config/obj-aout.c
gas/config/obj-coff-seh.c
gas/config/obj-coff.c
gas/config/obj-elf.c
gas/config/obj-macho.c
gas/config/obj-som.c
gas/config/tc-aarch64.c
gas/config/tc-alpha.c
gas/config/tc-arc.c
gas/config/tc-arm.c
gas/config/tc-avr.c
gas/config/tc-bfin.c
gas/config/tc-bpf.c
gas/config/tc-cris.c
gas/config/tc-crx.c
gas/config/tc-csky.c
gas/config/tc-d10v.c
gas/config/tc-d30v.c
gas/config/tc-epiphany.c
gas/config/tc-fr30.c
gas/config/tc-frv.c
gas/config/tc-ft32.c
gas/config/tc-i386.c
gas/config/tc-ia64.c
gas/config/tc-iq2000.c
gas/config/tc-lm32.c
gas/config/tc-m32c.c
gas/config/tc-m32r.c
gas/config/tc-m68hc11.c
gas/config/tc-m68k.c
gas/config/tc-mcore.c
gas/config/tc-mep.c
gas/config/tc-microblaze.c
gas/config/tc-mips.c
gas/config/tc-mmix.c
gas/config/tc-mn10200.c
gas/config/tc-mn10300.c
gas/config/tc-msp430.c
gas/config/tc-mt.c
gas/config/tc-nds32.c
gas/config/tc-or1k.c
gas/config/tc-ppc.c
gas/config/tc-pru.c
gas/config/tc-riscv.c
gas/config/tc-s12z.c
gas/config/tc-score.c
gas/config/tc-sh.c
gas/config/tc-spu.c
gas/config/tc-tic30.c
gas/config/tc-tic4x.c
gas/config/tc-tic54x.c
gas/config/tc-tilegx.c
gas/config/tc-v850.c
gas/config/tc-vax.c
gas/config/tc-visium.c
gas/config/tc-xgate.c
gas/config/tc-xstormy16.c
gas/config/te-vms.c
gas/dw2gencfi.c
gas/ecoff.c
gas/expr.c
gas/input-file.c
gas/listing.c
gas/messages.c
gas/read.c
gas/remap.c
gas/write.c

index c7de3a9f4e837b7e6cd39cc7ea82a81f66ccee16..78970ff2714fb2e85750361109eaa5b7285564a8 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -791,7 +791,7 @@ This program has absolutely no warranty.\n"));
            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;
index 8fbb531035c03e0de27b56ac274cd74b48ab1960..f5b9030a0195d76066c51313d9766c66bf95dbab 100644 (file)
@@ -848,11 +848,11 @@ gas_cgen_md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   /* 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)
index f481ad448d7c6df92f7926139fcaa84ef3ad296c..20167e9404033b01749878c82f0a05e5985e8811 100644 (file)
@@ -155,7 +155,7 @@ obj_aout_line (int ignore ATTRIBUTE_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 ();
 }
 
index becf7a969f2c9c256fd2b2b030571af8dcec3df9..1607a430cf6e4f0d84779cd1a85d067afc2c3ba9 100644 (file)
@@ -64,7 +64,7 @@ get_pxdata_name (segT seg, const char *base_name)
   else
     name = dollar;
 
-  sname = notes_concat (base_name, name, NULL);
+  sname = notes_concat (base_name, name, (const char *) NULL);
 
   return sname;
 }
index 1f9eaa33c93a2d2e0469e167b0bc52aebca1d057..93f1a8bbe0ecad21428c88e630ef2474fd462e49 100644 (file)
@@ -462,7 +462,7 @@ obj_coff_ln (int ignore ATTRIBUTE_UNUSED)
   /* 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);
 
@@ -1392,7 +1392,7 @@ coff_frob_symbol (symbolS *symp, int *punt)
     *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)
@@ -1827,7 +1827,7 @@ obj_coff_init_stab_section (segT stab ATTRIBUTE_UNUSED, segT stabstr)
   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);
@@ -1839,7 +1839,7 @@ const char * s_get_name (symbolS *);
 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);
index 368594d3a047ef306daee2ca0ff529c501f20181..e2425fe357882f31834e99f7fe59a843d8842249 100644 (file)
@@ -2691,7 +2691,7 @@ set_additional_section_info (bfd *abfd,
   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);
index ae26d670b18386382b2aff2c2752f1c158825f51..adcdb99c740de423fcae51a817b33def838f2518 100644 (file)
@@ -1613,7 +1613,7 @@ obj_mach_o_check_before_writing (bfd *abfd ATTRIBUTE_UNUSED,
 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
@@ -1662,7 +1662,7 @@ obj_mach_o_set_subsections (bfd *abfd ATTRIBUTE_UNUSED,
 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
@@ -1875,7 +1875,7 @@ obj_mach_o_set_indirect_symbols (bfd *abfd, asection *sec,
 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.  */
index 0d8108f4e04776ec0f94d939711eece1efcf9605..1a77176413ad4df8fef5bf656c208d7b72b90b6f 100644 (file)
@@ -246,7 +246,7 @@ obj_som_init_stab_section (segT stab, segT stabstr)
      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);
@@ -294,7 +294,7 @@ adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
 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
index 29a81d17112b15a09301a9cb518265e08a316c27..dd66e006a7bcfe30511cf06c4f35150ad3269868 100644 (file)
@@ -10269,7 +10269,7 @@ aarch64_adjust_symtab (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
index bfdf338615d8bb15b6c4333d3c0fa2707ec494c1..613211ceb53e72b854a70bcf57fbccf00f03ac46 100644 (file)
@@ -638,7 +638,7 @@ alpha_adjust_relocs (bfd *abfd ATTRIBUTE_UNUSED,
   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)
        {
@@ -736,7 +736,7 @@ alpha_adjust_relocs (bfd *abfd ATTRIBUTE_UNUSED,
              && ! 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;
@@ -1738,7 +1738,7 @@ emit_insn (struct alpha_insn *insn)
 
   /* 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;
@@ -1754,7 +1754,7 @@ emit_insn (struct alpha_insn *insn)
   /* 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;
@@ -2028,7 +2028,7 @@ assemble_insn (const struct alpha_opcode *opcode,
   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)
        {
@@ -3387,11 +3387,11 @@ add_to_link_pool (symbolS *sym, offsetT addend)
 
   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)
@@ -4864,7 +4864,7 @@ s_alpha_gprel32 (int ignore ATTRIBUTE_UNUSED)
 #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;
@@ -4907,7 +4907,7 @@ s_alpha_float_cons (int type)
     }
 
   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;
@@ -5092,7 +5092,7 @@ alpha_cons_align (int size)
     ++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;
index 391ff6f6f9ec5647f22d220fc8ba73fd20615ab5..83f03c3f4cfd705bdb4771850bf83ed45de70056 100644 (file)
@@ -2767,7 +2767,7 @@ md_pcrel_from_section (fixS *fixP,
 
   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))
     {
@@ -3917,7 +3917,7 @@ assemble_insn (const struct arc_opcode *opcode,
   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;
index c6045a1ff805304e269f0f2b94a242a72ed70266..f6f4eb99c93b009b3a153c909188b51d45e7556e 100644 (file)
@@ -3098,7 +3098,7 @@ find_real_start (symbolS * symbolP)
   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);
 
@@ -29996,7 +29996,7 @@ arm_adjust_symtab (void)
     }
 
   /* 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
index 650b736bfd4512f684a52521b478ce08cc15f940..fbadf3739442d697ec54190dc2b39ee4f66ecea6 100644 (file)
@@ -1452,7 +1452,7 @@ md_section_align (asection *seg, valueT addr)
 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;
@@ -1519,7 +1519,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
   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)
@@ -1567,7 +1567,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
       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
@@ -1856,7 +1856,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED,
 
   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"),
index 5b1db29b5059e44cb533a565c6e0367d42e8331a..d4caa9e6ceed47e1c07533f042d6d17d2bb8240e 100644 (file)
@@ -52,7 +52,7 @@ FILE *errorf;
 #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.  */
 
@@ -614,7 +614,7 @@ md_operand (expressionS * expressionP)
 symbolS *
 md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 {
-  return (symbolS *) 0;
+  return NULL;
 }
 
 int
@@ -806,7 +806,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
   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.  */
@@ -824,7 +824,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
 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))
     {
index 84eab3f88afb84839a8770b25ef7cb11735b10fc..5ba2bbd16c3f5c3a9f34e8ef2a65a728676ed850 100644 (file)
@@ -315,7 +315,7 @@ immediate_overflow (int64_t value, unsigned bits)
 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)
@@ -362,7 +362,7 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED, fixS *fixP)
 
   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"));
@@ -848,7 +848,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
       break;
     }
 
-  if (fixP->fx_addsy == (symbolS *) NULL)
+  if (fixP->fx_addsy == NULL)
     fixP->fx_done = 1;
 
   if (fixP->fx_done)
index 5780386e585ef119f59a819dd2094b9ce92665d1..a7ac4efba3b5a0478e7b3afad1ea48e763ad8575 100644 (file)
@@ -877,7 +877,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED,
 
     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;
@@ -885,7 +885,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED,
 
     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;
@@ -893,7 +893,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED,
 
     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;
@@ -1392,8 +1392,7 @@ md_assemble (char *str)
                         ? 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);
        }
     }
@@ -4047,7 +4046,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
     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.  */
index fffd3f12b4567c36a92b1cec5e06fec468243943..da153fed986e931c6cd35ca5b5d7a8384b11acb1 100644 (file)
@@ -325,7 +325,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS * fixP)
   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"),
@@ -569,8 +569,8 @@ process_label_constant (char *str, ins * crx_ins)
              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:
index beb46facd2274a7e3e8663c98a3fb82f5076ae5f..7eaf7a90bca59c5b6e1bbcf565430aa62988cdc6 100644 (file)
@@ -5269,7 +5269,7 @@ md_pcrel_from_section (fixS * fixP, segT seg)
 {
   /* 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;
index b10cdffbdda9f7b42e1676a757a00c3e992b4b53..ff1bedbf2afdad85062ad9cdfe7e4ee6f73cdb9a 100644 (file)
@@ -1454,7 +1454,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
   *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"),
@@ -1481,7 +1481,7 @@ md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_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)))
     return 0;
@@ -1497,11 +1497,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   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;
index 76827d501b6466bf9a3345ad637df9cb26d59baa..4a25da2f58bef5b987f82f8cbac72a1602e201bb 100644 (file)
@@ -1785,7 +1785,7 @@ md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_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)))
     return 0;
@@ -1888,7 +1888,7 @@ d30v_cons_align (int size)
     ++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;
@@ -1901,11 +1901,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   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
index 64d70f4cb5d4e6c9aa36b7a52ca5e728720b8140..6b514d3cbf089c673c2b08475a210b46cbe8d865 100644 (file)
@@ -248,7 +248,7 @@ epiphany_PIC_related_p (symbolS *sym)
 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)
@@ -956,7 +956,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_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)
index 2b135f45f000db467af3cc1a806d34a25e2116dc..8246113582c48433fb7fb0264fe2511bbc3cd2ca 100644 (file)
@@ -272,7 +272,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_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))
     /* The symbol is undefined (or is defined but not in this section).
index 2c84812b5c7714bb0966929899daf5a78f2c4e8d..86d8277041eada6f5f59f8b5066a0b42015061b0 100644 (file)
@@ -175,7 +175,7 @@ static flagword frv_flags = DEFAULT_FLAGS | DEFAULT_FDPIC;
 
 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;
@@ -1311,7 +1311,7 @@ long
 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
@@ -1790,7 +1790,7 @@ frv_frob_file_section (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
 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
index 83d3e1f573121b7e6ff650024751a997099dde80..e5d9a8a9bc6c220906d544f6d1efd03975db4a58 100644 (file)
@@ -581,7 +581,7 @@ md_apply_fix (fixS *fixP ATTRIBUTE_UNUSED,
   }
 
   /* 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)
index b0a22bb7e92a1fedb154c5f8aa168f23808c1177..5e0c0c1a9f08401d7b4db591732bfda4e688f29a 100644 (file)
@@ -11408,8 +11408,8 @@ build_modrm_byte (void)
              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
@@ -16825,12 +16825,12 @@ parse_real_register (const char *reg_string, char **end_op)
   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;
 
@@ -16843,7 +16843,7 @@ parse_real_register (const char *reg_string, char **end_op)
          && !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;
@@ -16866,7 +16866,7 @@ parse_real_register (const char *reg_string, char **end_op)
                }
            }
          /* We have "%st(" then garbage.  */
-         return (const reg_entry *) NULL;
+         return NULL;
        }
     }
 
index 827f6b1544c48cb1803484f627258dc1ea0fad6d..bb3eb67c72b9c02876bc122c12421fa439beb3ba 100644 (file)
@@ -3572,7 +3572,7 @@ start_unwind_section (const segT text_seg, int sec_index)
       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
@@ -3591,7 +3591,8 @@ start_unwind_section (const segT text_seg, int sec_index)
        }
 
       /* 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);
     }
index e7e123574d1e7e60e60309f3a67dc70ce4f98c47..f0259f8bc3b7c9180a68f61527700a0f3111edee 100644 (file)
@@ -482,7 +482,7 @@ md_convert_frag (bfd   * abfd  ATTRIBUTE_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))
     {
index c101d71d4500a38f73eb76f5ad32b36bcc5dbea9..d2e2226347f8fa1762b8ebab342dadce8f6fb86b 100644 (file)
@@ -80,7 +80,7 @@ const pseudo_typeS md_pseudo_table[] =
   { "hword",   cons,                2 },
   { "word",    cons,                4 },
   { "dword",   cons,                8 },
-  {(char *)0 , (void(*)(int))0,     0}
+  { NULL,      NULL,                0 }
 };
 
 /* Target specific command line options.  */
@@ -357,7 +357,7 @@ md_pcrel_from (fixS *fixP)
 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)))
     {
@@ -368,7 +368,7 @@ md_pcrel_from_section (fixS * fixP, segT 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.  */
index de2f86c87e25f4efdfd71b2c7a0b29495debea87..a65daae1e5bb12b85447078d8b8b13264462c919 100644 (file)
@@ -845,7 +845,7 @@ md_convert_frag (bfd *   abfd ATTRIBUTE_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))
     /* The symbol is undefined (or is defined but not in this section).
index 6946b2e50c8d9d2cff57a2b18d61acc5bb23dd7b..2bd32afab1d3827cf1c85ea0ebc10a14fb9fa4fa 100644 (file)
@@ -35,7 +35,7 @@ typedef struct sym_link
   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.  */
@@ -609,7 +609,7 @@ expand_debug_syms (sym_linkS *syms, int align)
     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;
@@ -627,7 +627,7 @@ m32r_flush_pending_output (void)
   if (debug_sym_link)
     {
       expand_debug_syms (debug_sym_link, 1);
-      debug_sym_link = (sym_linkS *) 0;
+      debug_sym_link = NULL;
     }
 }
 
@@ -653,7 +653,7 @@ m32r_fill_insn (int done)
   if (done && debug_sym_link)
     {
       expand_debug_syms (debug_sym_link, 1);
-      debug_sym_link = (sym_linkS *) 0;
+      debug_sym_link = NULL;
     }
 
   return 1;
@@ -911,7 +911,7 @@ assemble_two_insns (char *str1, char *str2, int parallel_p)
   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
@@ -1215,7 +1215,7 @@ md_assemble (char *str)
     }
 
   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);
@@ -1837,7 +1837,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_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)
index 40dd4561c3f68cc24e4ea98dba5a9d5aae05d463..e80c6dfd05208455aa3102add41247930c6f7770 100644 (file)
@@ -3835,7 +3835,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
     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."),
@@ -4326,11 +4326,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   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
index 446d9d8a2ef30089770e9db4a2c28844b9992525..ad8ab96697af156e1ad0f8b6217e85b4bdbedf0e 100644 (file)
@@ -6417,7 +6417,7 @@ parse_mri_control_expression (char *stop, int qual, const char *truelab,
        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 != '.'
@@ -6452,7 +6452,7 @@ parse_mri_control_expression (char *stop, int qual, const char *truelab,
        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 != '.'
@@ -6554,7 +6554,7 @@ s_mri_if (int qual)
 
   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] == '.')
@@ -7043,7 +7043,7 @@ s_mri_until (int qual)
   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);
@@ -7100,7 +7100,7 @@ s_mri_while (int qual)
 
   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;
index 8688bfaf42424a61a950dddc8e41cda8beb9f243..f20f0d363728c6739b56371320b83168eb7ee60e 100644 (file)
@@ -2139,7 +2139,7 @@ md_pcrel_from_section (fixS * fixp, segT sec ATTRIBUTE_UNUSED)
   /* 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)))
 
index d35a8639c495f9a1f2f87e72892034891e55871d..e13276762729b27e7c7353a39e7a0678c63a53cc 100644 (file)
@@ -1807,7 +1807,7 @@ mep_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_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_IS_WEAK (fixP->fx_addsy)
          || S_GET_SEGMENT (fixP->fx_addsy) != sec))
index 097a0ead4d4446548216e63f67926583c1952ac2..0e4cf7245c3c83644c2098526f09257992fb450d 100644 (file)
@@ -2444,7 +2444,7 @@ md_pcrel_from_section (fixS * fixp, segT sec ATTRIBUTE_UNUSED)
      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;
index 9f4e01dd64a83e455cfb628c5c9af911b728787b..9c0f2687bab2e648f72f071daebd92c5cab088ab 100644 (file)
@@ -2617,7 +2617,7 @@ set_insn_error_ss (int argnum, const char *msg, const char *s1, const char *s2)
 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)
     {
@@ -17656,7 +17656,7 @@ nopic_need_relax (symbolS *sym, int before_relaxing)
         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
@@ -19915,7 +19915,7 @@ s_mips_frame (int ignore ATTRIBUTE_UNUSED)
     {
       long val;
 
-      if (cur_proc_ptr == (procS *) NULL)
+      if (cur_proc_ptr == NULL)
        {
          as_warn (_(".frame outside of .ent"));
          demand_empty_rest_of_line ();
@@ -19956,7 +19956,7 @@ s_mips_mask (int reg_type)
     {
       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 ();
index 68fd52d06a116677a35d3adb1b96d0b2a9da8509..631dcc924e6a6e782ffcbba4dbc005d3d9d78ce2 100644 (file)
@@ -3282,7 +3282,7 @@ mmix_force_relocation (fixS *fixP)
 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))
     {
index db66e201b438b79d593b6c774adc92d1a33c7430..f57540e6fb6bf24dbdc4331944c31d4574994343 100644 (file)
@@ -676,7 +676,7 @@ valueT
 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
@@ -697,7 +697,7 @@ md_begin (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++;
@@ -734,7 +734,7 @@ check_operand (unsigned long insn ATTRIBUTE_UNUSED,
 
       test = val;
 
-      if (test < (offsetT) min || test > (offsetT) max)
+      if (test < min || test > max)
        return 0;
       else
        return 1;
@@ -844,17 +844,18 @@ mn10200_insert_operand (unsigned long *insnp,
 
       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
@@ -1318,7 +1319,7 @@ md_assemble (char *str)
 
              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
index 3c8834e2c0fecc96c970377c920337d4a7513a10..4e24254e4e1fb82b4a1669a8f690256a67e0fbc6 100644 (file)
@@ -2312,7 +2312,7 @@ md_estimate_size_before_relax (fragS *fragp, asection *seg)
 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;
index 563365faaf7ef3cc65a4a7a291ba246f1401d020..d5a11f84bbc9b1d330bf1a8ad93852207a581d1d 100644 (file)
@@ -4396,7 +4396,7 @@ md_section_align (asection * seg, valueT addr)
 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;
@@ -4431,7 +4431,7 @@ md_apply_fix (fixS * fixp, valueT * valuep, segT seg)
   unsigned long insn;
   long value;
 
-  if (fixp->fx_addsy == (symbolS *) NULL)
+  if (fixp->fx_addsy == NULL)
     {
       value = *valuep;
       fixp->fx_done = 1;
@@ -4464,7 +4464,7 @@ md_apply_fix (fixS * fixp, valueT * valuep, segT seg)
     {
       value = fixp->fx_offset;
 
-      if (fixp->fx_subsy != (symbolS *) NULL)
+      if (fixp->fx_subsy != NULL)
        {
          if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section)
            {
index 9dd884f42f9dfb109b95a8824c5d119964807cd0..e5e9d5ca1f304414fdbc3add27ccf9676891cba4 100644 (file)
@@ -372,7 +372,7 @@ md_convert_frag (bfd   * abfd  ATTRIBUTE_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))
     /* The symbol is undefined (or is defined but not in this section).
index a159ddb2c545ca947676b9ecac93c544e5b181fb..dc5a8af96759a50333513a0116537e2262589848 100644 (file)
@@ -7687,10 +7687,10 @@ nds32_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
       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.
 
@@ -7831,7 +7831,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
   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')"),
index 5b3e0130628ade75efe33a4eff42a1fbdc26bde0..87a2ac0e3cda4ee5a660fa6d0ddb3134cd8166cb 100644 (file)
@@ -223,7 +223,7 @@ md_convert_frag (bfd *   abfd ATTRIBUTE_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)
@@ -391,4 +391,3 @@ or1k_cfi_frame_initial_instructions (void)
 {
     cfi_add_CFA_def_cfa_register (1);
 }
-
index 5a93b41786f2d35e3c2bd81c515c17c66f67e94a..5eec956810762bfecd35d650d64deab1eeecef3a 100644 (file)
@@ -1951,7 +1951,7 @@ ppc_cleanup (void)
     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.  */
@@ -2071,7 +2071,7 @@ ppc_insert_operand (uint64_t insn,
 
       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
@@ -2947,7 +2947,7 @@ ppc_frob_label (symbolS *sym)
   /* 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;
@@ -3452,7 +3452,7 @@ md_assemble (char *str)
              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)
@@ -3495,7 +3495,7 @@ md_assemble (char *str)
                   && (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))
@@ -3693,7 +3693,7 @@ md_assemble (char *str)
                  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
@@ -4647,7 +4647,7 @@ ppc_change_csect (symbolS *sym, offsetT align)
       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;
@@ -5288,7 +5288,7 @@ ppc_function (int ignore ATTRIBUTE_UNUSED)
   /* 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';
 
@@ -5389,7 +5389,6 @@ ppc_bf (int ignore ATTRIBUTE_UNUSED)
       saved_bi_sym = 0;
     }
 
-
   symbol_get_tc (sym)->output = 1;
 
   ppc_frob_label (sym);
@@ -5459,13 +5458,13 @@ ppc_biei (int ei)
     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);
@@ -5631,7 +5630,7 @@ ppc_ec (int ignore ATTRIBUTE_UNUSED)
 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
     {
@@ -5656,7 +5655,7 @@ ppc_toc (int ignore ATTRIBUTE_UNUSED)
       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;
@@ -5764,7 +5763,7 @@ ppc_tc (int ignore ATTRIBUTE_UNUSED)
     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"));
@@ -6008,7 +6007,7 @@ ppc_symbol_new_hook (symbolS *sym)
     return;
 
   s = strchr (S_GET_NAME (sym), '[');
-  if (s == (const char *) NULL)
+  if (s == NULL)
     {
       /* There is no suffix.  */
       return;
@@ -6109,7 +6108,7 @@ ppc_frob_symbol (symbolS *sym)
   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
     {
@@ -6118,7 +6117,7 @@ ppc_frob_symbol (symbolS *sym)
 
       name = S_GET_NAME (sym);
       s = strchr (name, '[');
-      if (s != (char *) NULL)
+      if (s != NULL)
        {
          unsigned int len;
          char *snew;
@@ -6130,7 +6129,7 @@ ppc_frob_symbol (symbolS *sym)
        }
     }
 
-  if (set_end != (symbolS *) NULL)
+  if (set_end != NULL)
     {
       SA_SET_SYM_ENDNDX (set_end, sym);
       set_end = NULL;
@@ -6139,7 +6138,7 @@ ppc_frob_symbol (symbolS *sym)
   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,
@@ -6159,7 +6158,7 @@ ppc_frob_symbol (symbolS *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
        {
@@ -6202,7 +6201,7 @@ ppc_frob_symbol (symbolS *sym)
        {
          /* 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
@@ -6257,10 +6256,10 @@ ppc_frob_symbol (symbolS *sym)
          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
@@ -6293,14 +6292,14 @@ ppc_frob_symbol (symbolS *sym)
          /* 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)
@@ -6598,17 +6597,17 @@ ppc_fix_adjustable (fixS *fix)
   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);
@@ -6989,7 +6988,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
      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
@@ -7763,7 +7762,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
       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;
index 00208e4fd06d2d3f033de4815a0ec3fb99592b6f..6200461440ec41146e243bcfa8db50d36cc5e883 100644 (file)
@@ -680,7 +680,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   /* 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;
 
@@ -751,7 +751,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
       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
index cb21620b5ff41475cdf927984fc36582dc01914f..f5740f8e81b8ec19073763d9a92887827eead04e 100644 (file)
@@ -5783,7 +5783,7 @@ riscv_md_end (void)
 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 ();
 }
 
index 9c8fcfe1ec4064b07d556a269090178b014fa672..8f7c5d1bc9548ae1a9d3da45491d27bfda45812a 100644 (file)
@@ -3891,7 +3891,7 @@ tc_gen_reloc (asection *section, fixS *fixp)
   *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."),
@@ -3930,11 +3930,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 {
   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);
 
   /*
index e1ab865a3227dd000c03b94ba9f26f0ace80d932..03f955944e8129cac28d414e795930b90d4ce400 100644 (file)
@@ -4798,7 +4798,7 @@ s3_nopic_need_relax (symbolS * sym, int before_relaxing)
          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
@@ -5574,7 +5574,7 @@ s3_s_score_mask (int reg_type ATTRIBUTE_UNUSED)
 {
   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 ();
@@ -5708,7 +5708,7 @@ s3_s_score_frame (int ignore ATTRIBUTE_UNUSED)
   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 ();
index 90bd5c2f4deda0cc9c3321d9ed3bb4965134ba60..d49abc25501a8e8428fb7d96d78fcd388b2ff94f 100644 (file)
@@ -3816,7 +3816,7 @@ long
 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))
     {
index 82e0eb1df311af4c9fe24ae79ad3e580437a035f..e189d1b88fa2c0a07b8f737de58baac89b33163e 100644 (file)
@@ -872,7 +872,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
   *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"),
@@ -950,7 +950,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   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);
index 87cf09a39fdc088491354c7bdd8d3f613bd8ffa2..7f00418f4791756187d411d900edb929318a722e 100644 (file)
@@ -1151,7 +1151,7 @@ symbolS *
 md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 {
   debug ("In md_undefined_symbol()\n");
-  return (symbolS *) 0;
+  return NULL;
 }
 
 valueT
index f5284d8219f7a977231eaec51adc3fad41f6eeae..0ee5f6d8b59730eb94070e7de1d7e71d43bb70ef 100644 (file)
@@ -3000,7 +3000,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixP)
   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"),
index ed3efc4966564f16b272a2c6788fa1d80c68ef7d..0add19b23eac7f90b7841bf922f2bd25efa09309 100644 (file)
@@ -533,7 +533,7 @@ tic54x_bss (int x ATTRIBUTE_UNUSED)
   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);
@@ -573,11 +573,11 @@ stag_add_field_symbols (struct stag *stag,
 
   /* 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)
@@ -593,7 +593,8 @@ stag_add_field_symbols (struct stag *stag,
        {
          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;
index f70388ca854587fa9af719c5a2053e1efc0060d4..fae4b0a20c49380cf99950f065dfa776d1175e95 100644 (file)
@@ -1467,7 +1467,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
       || 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);
index 85a59ac034d7879b61f1387e94ca334acb36ed85..8e1062b03300cb6978acf6544cc12a3d986e43bc 100644 (file)
@@ -3393,7 +3393,7 @@ v850_pcrel_from_section (fixS *fixp, segT section)
   /* 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)))
@@ -3417,7 +3417,7 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
       return;
     }
 
-  if (fixP->fx_addsy == (symbolS *) NULL)
+  if (fixP->fx_addsy == NULL)
     fixP->fx_addnumber = value,
     fixP->fx_done = 1;
 
@@ -3427,7 +3427,7 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
   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);
index e256d08a36eaac7e3bdd51ebddb87db222a52c88..dca86dac195d95c86bf368aa471415dd10368696 100644 (file)
@@ -278,7 +278,7 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
 {
   valueT value = * valueP;
 
-  if (fixP->fx_subsy != (symbolS *) NULL)
+  if (fixP->fx_subsy != NULL)
     as_bad_subtract (fixP);
 
   if (fixP->fx_addsy == NULL)
index 93c108f03685746673542d7bdd18da15a6bb0ca4..6fadf409cf479d6f95457257fc2e4f51df24775f 100644 (file)
@@ -493,7 +493,7 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED,
 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))
     {
index 239310d1553a9e9d9e02a121fcefba70035b48fd..be9cac7ce80b26cb75cc5a1ed64457d42bdb683b 100644 (file)
@@ -621,7 +621,7 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp)
   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."),
@@ -652,11 +652,11 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
 
   /* 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;
index f7807f5049d17ca76f80fddf69583b2f9ec4f77d..f86423da6d7820cab94f9ce0c9aa3748824230bd 100644 (file)
@@ -331,7 +331,7 @@ md_convert_frag (bfd *   abfd ATTRIBUTE_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))
       || xstormy16_force_relocation (fixP))
@@ -474,11 +474,11 @@ xstormy16_md_apply_fix (fixS *   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)
index c88fbbec70f5001304ab96c496b3b97c21146a06..8e6f7e7ec974944ea9156d3ce0cf27db2e959680 100644 (file)
@@ -169,7 +169,7 @@ vms_file_stats_name (const char *dirname,
       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.  */
@@ -278,7 +278,7 @@ vms_file_stats_name (const char *dirname,
   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)
     {
index a21ae322488f067a566ef61ace333c90262501a1..5eb8a5d1de82331465ca79999ac6bb370eb2268b 100644 (file)
@@ -236,7 +236,7 @@ get_debugseg_name (segT seg, const char *base_name)
     {
       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 = "";
     }
@@ -249,7 +249,7 @@ get_debugseg_name (segT seg, const char *base_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.  */
index 360127b53b34f795e846f020a44bdd7b0aad395a..27724bbe4744429bfd8771fd55d1cf08f5ceac93 100644 (file)
@@ -813,8 +813,8 @@ typedef struct varray {
 #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 */                  \
@@ -980,22 +980,22 @@ static const efdr_t init_file = {
     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 */
 };
 
@@ -1385,11 +1385,11 @@ static alloc_info_t alloc_counts[alloc_type_last];
 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
@@ -1478,8 +1478,8 @@ ecoff_read_begin_hook (void)
 {
   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;
 }
@@ -1496,9 +1496,9 @@ ecoff_symbol_new_hook (symbolS *symbolP)
      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;
@@ -1535,7 +1535,7 @@ add_varray_page (varray_t *vp /* varray to add page to */)
   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 */
@@ -1583,7 +1583,7 @@ add_string (varray_t *vp,                 /* string obstack */
        as_fatal (_("duplicate %s"), str);
     }
 
-  if (ret_hash != (shash_t **) NULL)
+  if (ret_hash != NULL)
     *ret_hash = hash_ptr;
 
   return hash_ptr->indx;
@@ -1607,9 +1607,9 @@ add_ecoff_symbol (const char *str,        /* symbol name */
   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;
@@ -1619,19 +1619,19 @@ add_ecoff_symbol (const char *str,      /* symbol name */
 
   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;
@@ -1643,8 +1643,8 @@ add_ecoff_symbol (const char *str,        /* symbol name */
      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,
@@ -1658,7 +1658,7 @@ add_ecoff_symbol (const char *str,        /* symbol name */
 
   /* 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;
@@ -1696,7 +1696,7 @@ add_ecoff_symbol (const char *str,        /* symbol name */
 
     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
        {
@@ -1715,10 +1715,10 @@ add_ecoff_symbol (const char *str,      /* symbol name */
              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;
@@ -1802,7 +1802,7 @@ add_aux_sym_symint (symint_t aux_word /* auxiliary information word */)
   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;
@@ -1825,7 +1825,7 @@ add_aux_sym_rndx (int file_index, symint_t sym_index)
   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;
@@ -1855,7 +1855,7 @@ add_aux_sym_tir (type_info_t *t,  /* current type information */
   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;
@@ -1903,17 +1903,17 @@ add_aux_sym_tir (type_info_t *t,        /* current type information */
       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];
@@ -1957,7 +1957,7 @@ add_aux_sym_tir (type_info_t *t,  /* current type information */
       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;
@@ -2007,16 +2007,16 @@ get_tag (const char *tag,       /* tag name */
   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;
@@ -2025,7 +2025,7 @@ get_tag (const char *tag, /* tag name */
       return tag_ptr;
     }
 
-  if (hash_ptr == (shash_t *) NULL)
+  if (hash_ptr == NULL)
     {
       char *perm;
 
@@ -2036,12 +2036,12 @@ get_tag (const char *tag,       /* tag name */
     }
 
   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;
@@ -2083,7 +2083,7 @@ add_unknown_tag (tag_t *ptag /* pointer to tag information */)
 
   (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;
 }
@@ -2111,7 +2111,7 @@ add_procedure (char *func /* func name */, int aent)
   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;
@@ -2121,7 +2121,7 @@ add_procedure (char *func /* func name */, int aent)
 
   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++;
@@ -2137,11 +2137,11 @@ add_procedure (char *func /* func name */, int aent)
   ++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)
@@ -2149,7 +2149,7 @@ add_procedure (char *func /* func name */, int aent)
          last_lineno = *last_lineno_ptr;
          last_lineno_ptr = &last_lineno->next;
        }
-      noproc_lineno = (lineno_list_t *) NULL;
+      noproc_lineno = NULL;
     }
 }
 
@@ -2176,11 +2176,11 @@ add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake)
 
   /* 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
@@ -2228,7 +2228,7 @@ add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake)
 
   /* 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]
@@ -2243,7 +2243,7 @@ add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake)
     }
 
   /* 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);
@@ -2261,10 +2261,7 @@ add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake)
       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"));
@@ -2396,14 +2393,14 @@ ecoff_directive_begin (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -2432,14 +2429,14 @@ ecoff_directive_bend (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -2452,7 +2449,7 @@ ecoff_directive_bend (int ignore ATTRIBUTE_UNUSED)
      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);
@@ -2493,7 +2490,7 @@ ecoff_directive_def (int ignore ATTRIBUTE_UNUSED)
 
   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"));
@@ -2507,9 +2504,9 @@ ecoff_directive_def (int ignore ATTRIBUTE_UNUSED)
       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;
     }
 
@@ -2529,7 +2526,7 @@ ecoff_directive_dim (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -2577,7 +2574,7 @@ ecoff_directive_scl (int ignore ATTRIBUTE_UNUSED)
 {
   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 ();
@@ -2602,7 +2599,7 @@ ecoff_directive_size (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -2652,7 +2649,7 @@ ecoff_directive_type (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -2719,7 +2716,7 @@ ecoff_directive_tag (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -2743,7 +2740,7 @@ ecoff_directive_val (int ignore ATTRIBUTE_UNUSED)
 {
   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 ();
@@ -2781,26 +2778,26 @@ ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
 
   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;
@@ -2856,14 +2853,13 @@ ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
          || 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)
@@ -2904,7 +2900,7 @@ ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
          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;
@@ -2936,11 +2932,11 @@ ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
 
       /* 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
@@ -2953,14 +2949,14 @@ ecoff_directive_end (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -2982,7 +2978,7 @@ ecoff_directive_end (int ignore ATTRIBUTE_UNUSED)
      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,
@@ -2994,7 +2990,7 @@ ecoff_directive_end (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -3008,10 +3004,10 @@ ecoff_directive_ent (int aent)
   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 ();
@@ -3081,7 +3077,7 @@ ecoff_directive_file (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -3105,7 +3101,7 @@ ecoff_directive_fmask (int ignore ATTRIBUTE_UNUSED)
 {
   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 ();
@@ -3133,7 +3129,7 @@ ecoff_directive_frame (int ignore ATTRIBUTE_UNUSED)
 {
   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 ();
@@ -3169,7 +3165,7 @@ ecoff_directive_mask (int ignore ATTRIBUTE_UNUSED)
 {
   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 ();
@@ -3198,7 +3194,7 @@ ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED)
   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 ();
@@ -3237,7 +3233,7 @@ ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED)
 
   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;
@@ -3250,12 +3246,12 @@ ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED)
   /* 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;
     }
@@ -3411,9 +3407,9 @@ ecoff_stab (int what,
     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;
     }
 
@@ -3470,7 +3466,7 @@ ecoff_stab (int what,
        {
          st = st_Nil;
          sc = sc_Nil;
-         sym = (symbolS *) NULL;
+         sym = NULL;
          value = get_absolute_expression ();
          addend = 0;
        }
@@ -3513,12 +3509,12 @@ ecoff_stab (int what,
   /* 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.  */
@@ -3590,7 +3586,7 @@ ecoff_padding_adjust (const struct ecoff_debug_swap *backend,
        (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;
     }
 
@@ -3617,14 +3613,14 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
   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;
@@ -3642,8 +3638,8 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
      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))
@@ -3658,7 +3654,7 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
       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;
@@ -3666,7 +3662,7 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
       /* 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.  */
@@ -3687,13 +3683,13 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
 
       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;
            }
@@ -3703,7 +3699,7 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
              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
@@ -3713,7 +3709,7 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
          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;
@@ -3721,13 +3717,13 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
                }
            }
 
-         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;
@@ -3811,15 +3807,15 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
       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);
@@ -3848,7 +3844,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
 
   /* 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;
@@ -3856,7 +3852,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
       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;
@@ -3869,14 +3865,14 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
          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;
@@ -3899,7 +3895,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                     information for the external).  */
                  local = 1;
                  as_sym = sym_ptr->as_sym;
-                 if (as_sym != (symbolS *) NULL)
+                 if (as_sym != NULL)
                    {
                      symint_t indx;
 
@@ -3914,7 +3910,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                        {
                          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))
@@ -4034,7 +4030,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                      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;
@@ -4055,13 +4051,13 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                          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;
@@ -4089,7 +4085,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                        }
                      else
                        {
-                         know (begin_ptr->index_ptr != (aux_t *) NULL);
+                         know (begin_ptr->index_ptr != NULL);
                          begin_ptr->index_ptr->data.isym =
                            isym - ifilesym + 1;
                        }
@@ -4102,8 +4098,8 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                      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"));
@@ -4126,8 +4122,8 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                        {
                          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))
@@ -4138,7 +4134,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                    }
 
                  for (f = sym_ptr->forward_ref;
-                      f != (forward_t *) NULL;
+                      f != NULL;
                       f = f->next)
                    {
                      know (local);
@@ -4158,7 +4154,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
 
                      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;
 
@@ -4168,7 +4164,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                  /* 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
@@ -4212,14 +4208,14 @@ ecoff_build_procs (const struct ecoff_debug_swap *backend,
 
   /* 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;
@@ -4233,14 +4229,14 @@ ecoff_build_procs (const struct ecoff_debug_swap *backend,
          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;
@@ -4301,14 +4297,14 @@ ecoff_build_aux (const struct ecoff_debug_swap *backend,
 
   /* 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;
@@ -4321,14 +4317,14 @@ ecoff_build_aux (const struct ecoff_debug_swap *backend,
          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;
@@ -4390,7 +4386,7 @@ ecoff_build_aux (const struct ecoff_debug_swap *backend,
 
   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
@@ -4411,12 +4407,12 @@ ecoff_build_strings (char **buf,
   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;
@@ -4446,14 +4442,14 @@ ecoff_build_ss (const struct ecoff_debug_swap *backend,
   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;
@@ -4471,8 +4467,7 @@ ecoff_build_ss (const struct ecoff_debug_swap *backend,
        }
     }
 
-  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.  */
@@ -4495,14 +4490,14 @@ ecoff_build_fdr (const struct ecoff_debug_swap *backend,
   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;
@@ -4531,7 +4526,7 @@ ecoff_setup_ext (void)
 {
   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;
@@ -4574,15 +4569,15 @@ ecoff_build_debug (HDRR *hdr,
   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;
@@ -4596,11 +4591,11 @@ ecoff_build_debug (HDRR *hdr,
      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;
 
@@ -4616,12 +4611,12 @@ ecoff_build_debug (HDRR *hdr,
      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)
@@ -4630,7 +4625,7 @@ ecoff_build_debug (HDRR *hdr,
              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);
     }
 
@@ -4774,7 +4769,7 @@ allocate_scope (void)
 #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
     {
@@ -4927,7 +4922,7 @@ allocate_tag (void)
 #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
     {
@@ -4967,7 +4962,7 @@ free_tag (tag_t *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);
+  free (ptr);
 #endif
 }
 \f
@@ -5051,10 +5046,10 @@ free_thead (thead_t *ptr)
   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
@@ -5108,7 +5103,7 @@ ecoff_set_gp_prolog_size (int sz)
 int
 ecoff_no_current_file (void)
 {
-  return cur_file_ptr == (efdr_t *) NULL;
+  return cur_file_ptr == NULL;
 }
 
 void
@@ -5120,13 +5115,13 @@ ecoff_generate_asm_lineno (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;
@@ -5139,12 +5134,12 @@ ecoff_generate_asm_lineno (void)
   /* 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;
     }
index c16e96b535ab0262d8a7765807518b080283632b..06283c29b9cddc061e9b219bbc2dc165d4e6a2c1 100644 (file)
@@ -132,7 +132,7 @@ static unsigned int nr_seen[2];
 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;
 
index c64ea4d7ebccbc7497a14a5c64c3a6b85ee06b99..f3af77c6835ef698315ac262632b3798f05a8a22 100644 (file)
@@ -58,7 +58,7 @@ struct saved_file
 void
 input_file_begin (void)
 {
-  f_in = (FILE *) 0;
+  f_in = NULL;
 }
 
 void
@@ -237,7 +237,7 @@ input_file_give_next_buffer (char *where /* Where to place 1st character of new
   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.
@@ -266,7 +266,7 @@ input_file_give_next_buffer (char *where /* Where to place 1st character of new
       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;
     }
 
index d611179309008e339f9b1928b85333232f12e3d4..dbf4782b8d45ee52d833f39e2c1ec921bec5e9cd 100644 (file)
@@ -223,7 +223,7 @@ static char *data_buffer;
 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);
@@ -256,7 +256,7 @@ file_info (const char *file_name)
   /* 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;
@@ -406,11 +406,11 @@ listing_newline (char *ps)
   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 ();
@@ -488,7 +488,7 @@ listing_prev_line (void)
   list_info_type *l;
   fragS *f;
 
-  if (head == (list_info_type *) NULL
+  if (head == NULL
       || head == listing_tail)
     return;
 
@@ -497,7 +497,7 @@ listing_prev_line (void)
   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;
 
@@ -810,7 +810,7 @@ calc_hex (list_info_type *list)
   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;
@@ -1013,7 +1013,7 @@ list_symbol_table (void)
 
   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)
        {
index d11489265be91284c1d2489ecf736c53b0afbd8f..859ac17f379dad9732666e091871ef2876c65e67 100644 (file)
@@ -221,7 +221,7 @@ as_warn (const char *format, ...)
       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);
     }
 }
 
@@ -294,7 +294,7 @@ as_bad (const char *format, ...)
   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.
index fefbc3aee050654966fafc2f112bcbefd6800f7b..874802e4d67f6ed25404d32b6b808bea13b3866d 100644 (file)
@@ -1235,7 +1235,7 @@ read_a_source_file (const char *name)
                                   || 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)
@@ -1296,7 +1296,7 @@ read_a_source_file (const char *name)
 
                      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)
                            {
@@ -1623,7 +1623,7 @@ s_align (signed int arg, int bytes_p)
     {
       if (arg < 0)
        as_warn (_("expected fill pattern missing"));
-      do_align (align, (char *) NULL, 0, max);
+      do_align (align, NULL, 0, max);
     }
   else
     {
@@ -3482,7 +3482,7 @@ s_space (int mult)
        }
       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);
index ecf77a1fe9bef3fbdaa031f69b8f6d3cddbb7ed9..842c93077a39a6d185e8994f3418dd8969d2ab6f 100644 (file)
@@ -78,7 +78,7 @@ remap_debug_filename (const char *filename)
     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);
index 4d95d769d452fef856f93dad657d55aa55d8d559..93ec61474408ddeabb9fa03797e2444b32fba94e 100644 (file)
@@ -222,7 +222,7 @@ fix_new (fragS *frag,                       /* Which frag?  */
         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
@@ -290,7 +290,7 @@ fix_at_start (fragS *frag, unsigned long size, symbolS *add_symbol,
              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.  */
@@ -369,9 +369,9 @@ chain_frchains_together_1 (segT section, struct frchain *frchp)
       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;
@@ -395,7 +395,7 @@ chain_frchains_together (bfd *abfd ATTRIBUTE_UNUSED,
   /* 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);
 
@@ -1293,7 +1293,7 @@ write_relocs (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
   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;
@@ -2145,7 +2145,7 @@ write_object_file (void)
     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
@@ -2167,12 +2167,12 @@ write_object_file (void)
       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;
        }
@@ -2194,7 +2194,7 @@ write_object_file (void)
      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;
@@ -2335,7 +2335,7 @@ write_object_file (void)
   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 ();
@@ -2344,7 +2344,7 @@ write_object_file (void)
   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)
@@ -2501,7 +2501,7 @@ write_object_file (void)
   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
@@ -2529,10 +2529,10 @@ write_object_file (void)
        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