gas more enum casts

Remove more unnecessary enum casts.
diff --git a/gas/cond.c b/gas/cond.c
index c14399d..27898df 100644
--- a/gas/cond.c
+++ b/gas/cond.c
@@ -348,7 +348,7 @@
       if (operand.X_op != O_constant)
 	as_bad (_("non-constant expression in \".elseif\" statement"));
 
-      switch ((operatorT) arg)
+      switch (arg)
 	{
 	case O_eq: t = operand.X_add_number == 0; break;
 	case O_ne: t = operand.X_add_number != 0; break;
diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c
index d0cd3af..ae26d67 100644
--- a/gas/config/obj-macho.c
+++ b/gas/config/obj-macho.c
@@ -960,7 +960,7 @@
   if (prop < 0 || prop >= OBJ_MACH_O_FILE_PROP_MAX)
     as_fatal (_("internal error: bad file property ID %d"), prop);
 
-  switch ((obj_mach_o_file_properties) prop)
+  switch (prop)
     {
       case OBJ_MACH_O_FILE_PROP_SUBSECTS_VIA_SYMS:
         obj_mach_o_subsections_by_symbols = 1;
@@ -1023,7 +1023,7 @@
   if (sec != NULL)
     sectype = sec->flags & BFD_MACH_O_SECTION_TYPE_MASK;
 
-  switch ((obj_mach_o_symbol_type) type)
+  switch (type)
     {
       case OBJ_MACH_O_SYM_LOCAL:
 	/* This is an extension over the system tools.  */
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 2d66986..bfdf338 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -442,7 +442,7 @@
 #define ALPHA_RELOC_TABLE(op)						\
 (&alpha_reloc_op[ ((!USER_RELOC_P (op))					\
 		  ? (abort (), 0)					\
-		  : (int) (op) - (int) O_literal) ])
+		  : (op) - O_literal) ])
 
 #define DEF(NAME, RELOC, REQ, ALLOW) \
  { #NAME, sizeof(#NAME)-1, O_##NAME, RELOC, REQ, ALLOW}
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index ff14e91..391ff6f 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -522,7 +522,7 @@
 #define ARC_RELOC_TABLE(op)				\
   (&arc_reloc_op[ ((!USER_RELOC_P (op))			\
 		   ? (abort (), 0)			\
-		   : (int) (op) - (int) O_gotoff) ])
+		   : (op) - O_gotoff) ])
 
 #define DEF(NAME, RELOC, REQ)				\
   { #NAME, sizeof (#NAME)-1, O_##NAME, RELOC, REQ}
@@ -1444,7 +1444,7 @@
 	offset = insn->len;
 
       /* Some fixups are only used internally, thus no howto.  */
-      if ((int) fixup->reloc == 0)
+      if (fixup->reloc == 0)
 	as_fatal (_("Unhandled reloc type"));
 
       if ((int) fixup->reloc < 0)
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 5018dfc..3240e8d 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -1447,7 +1447,7 @@
 					    (bfd_reloc_code_real_type) code);
       reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
-      gas_assert (reloc->howto && (unsigned int) code == reloc->howto->type);
+      gas_assert (reloc->howto && code == reloc->howto->type);
       break;
     }
 #else /* OBJ_SOM */
diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c
index 1c8f7c5..82e0eb1 100644
--- a/gas/config/tc-spu.c
+++ b/gas/config/tc-spu.c
@@ -298,7 +298,7 @@
 	  insn.reloc[i] = BFD_RELOC_NONE;
 	}
       insn.opcode = format->opcode;
-      insn.tag = (enum spu_insns) (format - spu_opcodes);
+      insn.tag = format - spu_opcodes;
 
       syntax_error_arg = 0;
       syntax_error_param = 0;
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 1889608..040e397 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -1312,7 +1312,7 @@
       if (strncmp (directive_string, directive_info[i].name, len) == 0)
 	{
 	  input_line_pointer += len;
-	  *directive = (directiveE) i;
+	  *directive = i;
 	  if (*negated && !directive_info[i].can_be_negated)
 	    as_bad (_("directive %s cannot be negated"),
 		    directive_info[i].name);
@@ -1321,7 +1321,7 @@
     }
 
   as_bad (_("unknown directive"));
-  *directive = (directiveE) XTENSA_UNDEFINED;
+  *directive = XTENSA_UNDEFINED;
 }
 
 
@@ -10321,7 +10321,7 @@
 				 min_steps, stretch);
   gas_assert (num_steps >= min_steps && num_steps <= RELAX_IMMED_MAXSTEPS);
 
-  fragP->tc_frag_data.slot_subtypes[slot] = (int) RELAX_IMMED + num_steps;
+  fragP->tc_frag_data.slot_subtypes[slot] = RELAX_IMMED + num_steps;
 
   /* Figure out the number of bytes needed.  */
   num_literal_bytes = get_num_stack_literal_bytes (&istack);
@@ -10350,8 +10350,7 @@
 					 min_steps, stretch + old_size);
 	  gas_assert (num_steps >= min_steps && num_steps <= RELAX_IMMED_MAXSTEPS);
 
-	  fragP->tc_frag_data.slot_subtypes[slot]
-	    = (int) RELAX_IMMED + num_steps;
+	  fragP->tc_frag_data.slot_subtypes[slot] = RELAX_IMMED + num_steps;
 
 	  num_literal_bytes = get_num_stack_literal_bytes (&istack);
 	  literal_diff
diff --git a/gas/ecoff.c b/gas/ecoff.c
index c84d0a8..360127b 100644
--- a/gas/ecoff.c
+++ b/gas/ecoff.c
@@ -1379,7 +1379,7 @@
 };
 
 /* Keep track of different sized allocation requests.  */
-static alloc_info_t alloc_counts[(int) alloc_type_last];
+static alloc_info_t alloc_counts[alloc_type_last];
 
 /* Record whether we have seen any debugging information.  */
 int ecoff_debugging_seen = 0;
@@ -1529,8 +1529,8 @@
 #endif
     new_links->datum = allocate_page ();
 
-  alloc_counts[(int) alloc_type_varray].total_alloc++;
-  alloc_counts[(int) alloc_type_varray].total_pages++;
+  alloc_counts[alloc_type_varray].total_alloc++;
+  alloc_counts[alloc_type_varray].total_pages++;
 
   new_links->start_index = vp->num_allocated;
   vp->objects_last_page = 0;
@@ -1635,8 +1635,8 @@
   psym->sym_index = -1;
   memset (&psym->ecoff_sym, 0, sizeof (EXTR));
   psym->ecoff_sym.asym.value = value;
-  psym->ecoff_sym.asym.st = (unsigned) type;
-  psym->ecoff_sym.asym.sc = (unsigned) storage;
+  psym->ecoff_sym.asym.st = type;
+  psym->ecoff_sym.asym.sc = storage;
   psym->ecoff_sym.asym.index = indx;
 
   /* If there is an associated symbol, we wait until the end of the
@@ -1700,7 +1700,7 @@
 	as_fatal (_("too many st_End's"));
       else
 	{
-	  st_t begin_type = (st_t) pscope->lsym->ecoff_sym.asym.st;
+	  st_t begin_type = pscope->lsym->ecoff_sym.asym.st;
 
 	  psym->begin_ptr = pscope->lsym;
 
@@ -1861,16 +1861,16 @@
   vp = &cur_file_ptr->aux_syms;
 
   memset (&aux, 0, sizeof (aux));
-  aux.ti.bt = (int) t->basic_type;
+  aux.ti.bt = t->basic_type;
   aux.ti.continued = 0;
   aux.ti.fBitfield = t->bitfield;
 
-  aux.ti.tq0 = (int) t->type_qualifiers[0];
-  aux.ti.tq1 = (int) t->type_qualifiers[1];
-  aux.ti.tq2 = (int) t->type_qualifiers[2];
-  aux.ti.tq3 = (int) t->type_qualifiers[3];
-  aux.ti.tq4 = (int) t->type_qualifiers[4];
-  aux.ti.tq5 = (int) t->type_qualifiers[5];
+  aux.ti.tq0 = t->type_qualifiers[0];
+  aux.ti.tq1 = t->type_qualifiers[1];
+  aux.ti.tq2 = t->type_qualifiers[2];
+  aux.ti.tq3 = t->type_qualifiers[3];
+  aux.ti.tq4 = t->type_qualifiers[4];
+  aux.ti.tq5 = t->type_qualifiers[5];
 
   /* For anything that adds additional information, we must not hash,
      so check here, and reset our state.  */
@@ -3909,8 +3909,8 @@
 		         we must offset it by the vma of the section,
 		         just as BFD does, because BFD will not see
 		         this value).  */
-		      if (sym_ptr->ecoff_sym.asym.st == (int) st_Block
-			  && sym_ptr->ecoff_sym.asym.sc == (int) sc_Text)
+		      if (sym_ptr->ecoff_sym.asym.st == st_Block
+			  && sym_ptr->ecoff_sym.asym.sc == sc_Text)
 			{
 			  symbolS *begin_sym;
 
@@ -4021,8 +4021,8 @@
 			      sc = sc_Data;
 			    }
 
-			  sym_ptr->ecoff_sym.asym.st = (int) st;
-			  sym_ptr->ecoff_sym.asym.sc = (int) sc;
+			  sym_ptr->ecoff_sym.asym.st = st;
+			  sym_ptr->ecoff_sym.asym.sc = sc;
 			}
 
 		      /* This is just an external symbol if it is
@@ -4035,7 +4035,7 @@
 			   || S_IS_WEAK (as_sym)
 			   || ! S_IS_DEFINED (as_sym))
 			  && sym_ptr->proc_ptr == (proc_t *) NULL
-			  && sym_ptr->ecoff_sym.asym.st != (int) st_Nil
+			  && sym_ptr->ecoff_sym.asym.st != st_Nil
 			  && ! ECOFF_IS_STAB (&sym_ptr->ecoff_sym.asym))
 			local = 0;
 
@@ -4070,7 +4070,7 @@
 		      begin_ptr = sym_ptr->begin_ptr;
 		      know (begin_ptr->sym_index != -1);
 		      sym_ptr->ecoff_sym.asym.index = begin_ptr->sym_index;
-		      if (sym_ptr->ecoff_sym.asym.sc != (int) sc_Info)
+		      if (sym_ptr->ecoff_sym.asym.sc != sc_Info)
 			sym_ptr->ecoff_sym.asym.iss =
 			  begin_ptr->ecoff_sym.asym.iss;
 
@@ -4122,7 +4122,7 @@
 #endif
 			}
 		      else if (begin_type == st_Block
-			       && sym_ptr->ecoff_sym.asym.sc != (int) sc_Info)
+			       && sym_ptr->ecoff_sym.asym.sc != sc_Info)
 			{
 			  symbolS *begin_sym;
 
@@ -4545,8 +4545,8 @@
 
 	  lsym = symbol_get_obj (sym)->ecoff_symbol;
 	  lsym->ecoff_sym.asym.value = 0;
-	  lsym->ecoff_sym.asym.st = (int) st_Nil;
-	  lsym->ecoff_sym.asym.sc = (int) sc_Nil;
+	  lsym->ecoff_sym.asym.st = st_Nil;
+	  lsym->ecoff_sym.asym.sc = sc_Nil;
 	  lsym->ecoff_sym.asym.index = indexNil;
 	}
 
@@ -4773,23 +4773,23 @@
 
 #ifndef MALLOC_CHECK
 
-  ptr = alloc_counts[(int) alloc_type_scope].free_list.f_scope;
+  ptr = alloc_counts[alloc_type_scope].free_list.f_scope;
   if (ptr != (scope_t *) NULL)
-    alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr->free;
+    alloc_counts[alloc_type_scope].free_list.f_scope = ptr->free;
   else
     {
-      int unallocated	= alloc_counts[(int) alloc_type_scope].unallocated;
-      page_type *cur_page	= alloc_counts[(int) alloc_type_scope].cur_page;
+      int unallocated = alloc_counts[alloc_type_scope].unallocated;
+      page_type *cur_page = alloc_counts[alloc_type_scope].cur_page;
 
       if (unallocated == 0)
 	{
 	  unallocated = PAGE_SIZE / sizeof (scope_t);
-	  alloc_counts[(int) alloc_type_scope].cur_page = cur_page = allocate_page ();
-	  alloc_counts[(int) alloc_type_scope].total_pages++;
+	  alloc_counts[alloc_type_scope].cur_page = cur_page = allocate_page ();
+	  alloc_counts[alloc_type_scope].total_pages++;
 	}
 
       ptr = &cur_page->scope[--unallocated];
-      alloc_counts[(int) alloc_type_scope].unallocated = unallocated;
+      alloc_counts[alloc_type_scope].unallocated = unallocated;
     }
 
 #else
@@ -4798,7 +4798,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_scope].total_alloc++;
+  alloc_counts[alloc_type_scope].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
@@ -4808,13 +4808,13 @@
 static void
 free_scope (scope_t *ptr)
 {
-  alloc_counts[(int) alloc_type_scope].total_free++;
+  alloc_counts[alloc_type_scope].total_free++;
 
 #ifndef MALLOC_CHECK
-  ptr->free = alloc_counts[(int) alloc_type_scope].free_list.f_scope;
-  alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr;
+  ptr->free = alloc_counts[alloc_type_scope].free_list.f_scope;
+  alloc_counts[alloc_type_scope].free_list.f_scope = ptr;
 #else
-  free ((void *) ptr);
+  free (ptr);
 #endif
 }
 
@@ -4827,18 +4827,18 @@
 
 #ifndef MALLOC_CHECK
 
-  int unallocated = alloc_counts[(int) alloc_type_vlinks].unallocated;
-  page_type *cur_page = alloc_counts[(int) alloc_type_vlinks].cur_page;
+  int unallocated = alloc_counts[alloc_type_vlinks].unallocated;
+  page_type *cur_page = alloc_counts[alloc_type_vlinks].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (vlinks_t);
-      alloc_counts[(int) alloc_type_vlinks].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int) alloc_type_vlinks].total_pages++;
+      alloc_counts[alloc_type_vlinks].cur_page = cur_page = allocate_page ();
+      alloc_counts[alloc_type_vlinks].total_pages++;
     }
 
   ptr = &cur_page->vlinks[--unallocated];
-  alloc_counts[(int) alloc_type_vlinks].unallocated = unallocated;
+  alloc_counts[alloc_type_vlinks].unallocated = unallocated;
 
 #else
 
@@ -4846,7 +4846,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_vlinks].total_alloc++;
+  alloc_counts[alloc_type_vlinks].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
@@ -4860,18 +4860,18 @@
 
 #ifndef MALLOC_CHECK
 
-  int unallocated = alloc_counts[(int) alloc_type_shash].unallocated;
-  page_type *cur_page = alloc_counts[(int) alloc_type_shash].cur_page;
+  int unallocated = alloc_counts[alloc_type_shash].unallocated;
+  page_type *cur_page = alloc_counts[alloc_type_shash].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (shash_t);
-      alloc_counts[(int) alloc_type_shash].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int) alloc_type_shash].total_pages++;
+      alloc_counts[alloc_type_shash].cur_page = cur_page = allocate_page ();
+      alloc_counts[alloc_type_shash].total_pages++;
     }
 
   ptr = &cur_page->shash[--unallocated];
-  alloc_counts[(int) alloc_type_shash].unallocated = unallocated;
+  alloc_counts[alloc_type_shash].unallocated = unallocated;
 
 #else
 
@@ -4879,7 +4879,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_shash].total_alloc++;
+  alloc_counts[alloc_type_shash].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
@@ -4893,18 +4893,18 @@
 
 #ifndef MALLOC_CHECK
 
-  int unallocated = alloc_counts[(int) alloc_type_thash].unallocated;
-  page_type *cur_page = alloc_counts[(int) alloc_type_thash].cur_page;
+  int unallocated = alloc_counts[alloc_type_thash].unallocated;
+  page_type *cur_page = alloc_counts[alloc_type_thash].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (thash_t);
-      alloc_counts[(int) alloc_type_thash].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int) alloc_type_thash].total_pages++;
+      alloc_counts[alloc_type_thash].cur_page = cur_page = allocate_page ();
+      alloc_counts[alloc_type_thash].total_pages++;
     }
 
   ptr = &cur_page->thash[--unallocated];
-  alloc_counts[(int) alloc_type_thash].unallocated = unallocated;
+  alloc_counts[alloc_type_thash].unallocated = unallocated;
 
 #else
 
@@ -4912,7 +4912,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_thash].total_alloc++;
+  alloc_counts[alloc_type_thash].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
@@ -4926,23 +4926,23 @@
 
 #ifndef MALLOC_CHECK
 
-  ptr = alloc_counts[(int) alloc_type_tag].free_list.f_tag;
+  ptr = alloc_counts[alloc_type_tag].free_list.f_tag;
   if (ptr != (tag_t *) NULL)
-    alloc_counts[(int) alloc_type_tag].free_list.f_tag = ptr->free;
+    alloc_counts[alloc_type_tag].free_list.f_tag = ptr->free;
   else
     {
-      int unallocated = alloc_counts[(int) alloc_type_tag].unallocated;
-      page_type *cur_page = alloc_counts[(int) alloc_type_tag].cur_page;
+      int unallocated = alloc_counts[alloc_type_tag].unallocated;
+      page_type *cur_page = alloc_counts[alloc_type_tag].cur_page;
 
       if (unallocated == 0)
 	{
 	  unallocated = PAGE_SIZE / sizeof (tag_t);
-	  alloc_counts[(int) alloc_type_tag].cur_page = cur_page = allocate_page ();
-	  alloc_counts[(int) alloc_type_tag].total_pages++;
+	  alloc_counts[alloc_type_tag].cur_page = cur_page = allocate_page ();
+	  alloc_counts[alloc_type_tag].total_pages++;
 	}
 
       ptr = &cur_page->tag[--unallocated];
-      alloc_counts[(int) alloc_type_tag].unallocated = unallocated;
+      alloc_counts[alloc_type_tag].unallocated = unallocated;
     }
 
 #else
@@ -4951,7 +4951,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_tag].total_alloc++;
+  alloc_counts[alloc_type_tag].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
@@ -4961,11 +4961,11 @@
 static void
 free_tag (tag_t *ptr)
 {
-  alloc_counts[(int) alloc_type_tag].total_free++;
+  alloc_counts[alloc_type_tag].total_free++;
 
 #ifndef MALLOC_CHECK
-  ptr->free = alloc_counts[(int) alloc_type_tag].free_list.f_tag;
-  alloc_counts[(int) alloc_type_tag].free_list.f_tag = ptr;
+  ptr->free = alloc_counts[alloc_type_tag].free_list.f_tag;
+  alloc_counts[alloc_type_tag].free_list.f_tag = ptr;
 #else
   free ((PTR_T) ptr);
 #endif
@@ -4980,18 +4980,18 @@
 
 #ifndef MALLOC_CHECK
 
-  int unallocated = alloc_counts[(int) alloc_type_forward].unallocated;
-  page_type *cur_page = alloc_counts[(int) alloc_type_forward].cur_page;
+  int unallocated = alloc_counts[alloc_type_forward].unallocated;
+  page_type *cur_page = alloc_counts[alloc_type_forward].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (forward_t);
-      alloc_counts[(int) alloc_type_forward].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int) alloc_type_forward].total_pages++;
+      alloc_counts[alloc_type_forward].cur_page = cur_page = allocate_page ();
+      alloc_counts[alloc_type_forward].total_pages++;
     }
 
   ptr = &cur_page->forward[--unallocated];
-  alloc_counts[(int) alloc_type_forward].unallocated = unallocated;
+  alloc_counts[alloc_type_forward].unallocated = unallocated;
 
 #else
 
@@ -4999,7 +4999,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_forward].total_alloc++;
+  alloc_counts[alloc_type_forward].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
@@ -5013,23 +5013,23 @@
 
 #ifndef MALLOC_CHECK
 
-  ptr = alloc_counts[(int) alloc_type_thead].free_list.f_thead;
-  if (ptr != (thead_t *) NULL)
-    alloc_counts[(int) alloc_type_thead].free_list.f_thead = ptr->free;
+  ptr = alloc_counts[alloc_type_thead].free_list.f_thead;
+  if (ptr != NULL)
+    alloc_counts[alloc_type_thead].free_list.f_thead = ptr->free;
   else
     {
-      int unallocated = alloc_counts[(int) alloc_type_thead].unallocated;
-      page_type *cur_page = alloc_counts[(int) alloc_type_thead].cur_page;
+      int unallocated = alloc_counts[alloc_type_thead].unallocated;
+      page_type *cur_page = alloc_counts[alloc_type_thead].cur_page;
 
       if (unallocated == 0)
 	{
 	  unallocated = PAGE_SIZE / sizeof (thead_t);
-	  alloc_counts[(int) alloc_type_thead].cur_page = cur_page = allocate_page ();
-	  alloc_counts[(int) alloc_type_thead].total_pages++;
+	  alloc_counts[alloc_type_thead].cur_page = cur_page = allocate_page ();
+	  alloc_counts[alloc_type_thead].total_pages++;
 	}
 
       ptr = &cur_page->thead[--unallocated];
-      alloc_counts[(int) alloc_type_thead].unallocated = unallocated;
+      alloc_counts[alloc_type_thead].unallocated = unallocated;
     }
 
 #else
@@ -5038,7 +5038,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_thead].total_alloc++;
+  alloc_counts[alloc_type_thead].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
@@ -5048,11 +5048,11 @@
 static void
 free_thead (thead_t *ptr)
 {
-  alloc_counts[(int) alloc_type_thead].total_free++;
+  alloc_counts[alloc_type_thead].total_free++;
 
 #ifndef MALLOC_CHECK
-  ptr->free = (thead_t *) alloc_counts[(int) alloc_type_thead].free_list.f_thead;
-  alloc_counts[(int) alloc_type_thead].free_list.f_thead = ptr;
+  ptr->free = (thead_t *) alloc_counts[alloc_type_thead].free_list.f_thead;
+  alloc_counts[alloc_type_thead].free_list.f_thead = ptr;
 #else
   free ((PTR_T) ptr);
 #endif
@@ -5065,18 +5065,18 @@
 
 #ifndef MALLOC_CHECK
 
-  int unallocated = alloc_counts[(int) alloc_type_lineno].unallocated;
-  page_type *cur_page = alloc_counts[(int) alloc_type_lineno].cur_page;
+  int unallocated = alloc_counts[alloc_type_lineno].unallocated;
+  page_type *cur_page = alloc_counts[alloc_type_lineno].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (lineno_list_t);
-      alloc_counts[(int) alloc_type_lineno].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int) alloc_type_lineno].total_pages++;
+      alloc_counts[alloc_type_lineno].cur_page = cur_page = allocate_page ();
+      alloc_counts[alloc_type_lineno].total_pages++;
     }
 
   ptr = &cur_page->lineno[--unallocated];
-  alloc_counts[(int) alloc_type_lineno].unallocated = unallocated;
+  alloc_counts[alloc_type_lineno].unallocated = unallocated;
 
 #else
 
@@ -5084,7 +5084,7 @@
 
 #endif
 
-  alloc_counts[(int) alloc_type_lineno].total_alloc++;
+  alloc_counts[alloc_type_lineno].total_alloc++;
   memset (ptr, 0, sizeof (*ptr));
   return ptr;
 }
diff --git a/gas/ehopt.c b/gas/ehopt.c
index ab976ba..8852820 100644
--- a/gas/ehopt.c
+++ b/gas/ehopt.c
@@ -334,7 +334,7 @@
 	/* Stop scanning if we don't see the expected FDE fields.  */
 	d->state = state_error;
       else
-	d->state = (enum frame_state) (d->state + 1);
+	d->state++;
       break;
 
     case state_saw_pc_begin:
diff --git a/gas/expr.c b/gas/expr.c
index 78a247c..c16e96b 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1880,7 +1880,7 @@
   know (!is_whitespace (*input_line_pointer));
 
   op_left = operatorf (&op_chars);
-  while (op_left != O_illegal && op_rank[(int) op_left] > rank)
+  while (op_left != O_illegal && op_rank[op_left] > rank)
     {
       segT rightseg;
       bool is_unsigned;
@@ -1889,7 +1889,7 @@
       input_line_pointer += op_chars;	/* -> after operator.  */
 
       right.X_md = 0;
-      rightseg = expr (op_rank[(int) op_left], &right, mode);
+      rightseg = expr (op_rank[op_left], &right, mode);
       if (right.X_op == O_absent)
 	{
 	  as_warn (_("missing operand; zero assumed"));
@@ -1915,12 +1915,12 @@
       op_right = operatorf (&op_chars);
 
       know (op_right == O_illegal || op_left == O_index
-	    || op_rank[(int) op_right] <= op_rank[(int) op_left]);
-      know ((int) op_left >= (int) O_multiply);
+	    || op_rank[op_right] <= op_rank[op_left]);
+      know (op_left >= O_multiply);
 #ifndef md_operator
-      know ((int) op_left <= (int) O_index);
+      know (op_left <= O_index);
 #else
-      know ((int) op_left < (int) O_max);
+      know (op_left < O_max);
 #endif
 
       /* input_line_pointer->after right-hand quantity.  */