case 'C':
          gas_assert (!mips_opts.micromips);
-         INSERT_OPERAND (0, COPZ, insn, va_arg (args, unsigned long));
+         INSERT_OPERAND (0, COPZ, insn, va_arg (args, int));
          continue;
 
        case 'k':
          INSERT_OPERAND (mips_opts.micromips,
-                         CACHE, insn, va_arg (args, unsigned long));
+                         CACHE, insn, va_arg (args, int));
          continue;
 
        case '|':
 
        case '\\':
          INSERT_OPERAND (mips_opts.micromips,
-                         3BITPOS, insn, va_arg (args, unsigned int));
+                         3BITPOS, insn, va_arg (args, int));
          continue;
 
        case '~':
          INSERT_OPERAND (mips_opts.micromips,
-                         OFFSET12, insn, va_arg (args, unsigned long));
+                         OFFSET12, insn, va_arg (args, int));
          continue;
 
        case 'N':
 
     case M_MSGSND:
       gas_assert (!mips_opts.micromips);
-      {
-       unsigned long temp = (treg << 16) | (0x01);
-       macro_build (NULL, "c2", "C", temp);
-      }
+      macro_build (NULL, "c2", "C", (treg << 16) | 0x01);
       break;
 
     case M_MSGLD:
       gas_assert (!mips_opts.micromips);
-      {
-       unsigned long temp = (0x02);
-       macro_build (NULL, "c2", "C", temp);
-      }
+      macro_build (NULL, "c2", "C", 0x02);
       break;
 
     case M_MSGLD_T:
       gas_assert (!mips_opts.micromips);
-      {
-       unsigned long temp = (treg << 16) | (0x02);
-       macro_build (NULL, "c2", "C", temp);
-      }
+      macro_build (NULL, "c2", "C", (treg << 16) | 0x02);
       break;
 
     case M_MSGWAIT:
 
     case M_MSGWAIT_T:
       gas_assert (!mips_opts.micromips);
-      {
-       unsigned long temp = (treg << 16) | 0x03;
-       macro_build (NULL, "c2", "C", temp);
-      }
+      macro_build (NULL, "c2", "C", (treg << 16) | 0x03);
       break;
 
     case M_J_A:
                macro_build (NULL, s, fmt, treg, breg);
              else
                macro_build (NULL, s, fmt, treg,
-                            (unsigned long) offset_expr.X_add_number, breg);
+                            (int) offset_expr.X_add_number, breg);
            }
          else
            {
              if (offbits == 0)
                macro_build (NULL, s, fmt, treg, tempreg);
              else
-               macro_build (NULL, s, fmt, treg, 0L, tempreg);
+               macro_build (NULL, s, fmt, treg, 0, tempreg);
            }
          break;
        }
            macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_LO16, tempreg);
          else
            macro_build (NULL, s, fmt, treg,
-                        (unsigned long) offset_expr.X_add_number, tempreg);
+                        (int) offset_expr.X_add_number, tempreg);
        }
       else if (offbits != 16)
        {
          if (offbits == 0)
            macro_build (NULL, s, fmt, treg, tempreg);
          else
-           macro_build (NULL, s, fmt, treg, 0L, tempreg);
+           macro_build (NULL, s, fmt, treg, 0, tempreg);
        }
       else if (mips_pic == NO_PIC)
        {
       gas_assert (!mips_opts.micromips);
       /* For now we just do C (same as Cz).  The parameter will be
          stored in insn_opcode by mips_ip.  */
-      macro_build (NULL, s, "C", ip->insn_opcode);
+      macro_build (NULL, s, "C", (int) ip->insn_opcode);
       break;
 
     case M_MOVE:
       if (!target_big_endian)
        ep->X_add_number += off;
       if (offbits == 12)
-       macro_build (NULL, s, "t,~(b)",
-                    tempreg, (unsigned long) ep->X_add_number, breg);
+       macro_build (NULL, s, "t,~(b)", tempreg, (int) ep->X_add_number, breg);
       else
        macro_build (ep, s, "t,o(b)", tempreg, -1,
                     offset_reloc[0], offset_reloc[1], offset_reloc[2], breg);
        ep->X_add_number += off;
       if (offbits == 12)
        macro_build (NULL, s2, "t,~(b)",
-                    tempreg, (unsigned long) ep->X_add_number, breg);
+                    tempreg, (int) ep->X_add_number, breg);
       else
        macro_build (ep, s2, "t,o(b)", tempreg, -1,
                     offset_reloc[0], offset_reloc[1], offset_reloc[2], breg);