gas/arc: Use BFD_VMA_FMT for printf format specifier
[deliverable/binutils-gdb.git] / gas / macro.c
index cddf26ab79ea23599d449f5b817f508181aa7907..0d1a1d24eae78ec003b9f7c74e97121c8de598e6 100644 (file)
@@ -404,7 +404,7 @@ get_any_string (size_t idx, sb *in, sb *out)
        }
       else
        {
-         char *br_buf = (char *) xmalloc (1);
+         char *br_buf = XNEWVEC (char, 1);
          char *in_br = br_buf;
 
          *in_br = '\0';
@@ -438,7 +438,7 @@ get_any_string (size_t idx, sb *in, sb *out)
                    --in_br;
                  else
                    {
-                     br_buf = (char *) xmalloc (strlen (in_br) + 2);
+                     br_buf = XNEWVEC (char, strlen (in_br) + 2);
                      strcpy (br_buf + 1, in_br);
                      free (in_br);
                      in_br = br_buf;
@@ -471,7 +471,7 @@ new_formal (void)
 {
   formal_entry *formal;
 
-  formal = (formal_entry *) xmalloc (sizeof (formal_entry));
+  formal = XNEW (formal_entry);
 
   sb_new (&formal->name);
   sb_new (&formal->def);
@@ -655,7 +655,7 @@ define_macro (size_t idx, sb *in, sb *label,
   sb name;
   const char *error = NULL;
 
-  macro = (macro_entry *) xmalloc (sizeof (macro_entry));
+  macro = XNEW (macro_entry);
   sb_new (&macro->sub);
   sb_new (&name);
   macro->file = file;
@@ -1250,9 +1250,7 @@ check_macro (const char *line, sb *expand,
   if (is_name_ender (*s))
     ++s;
 
-  copy = (char *) xmalloc (s - line + 1);
-  memcpy (copy, line, s - line);
-  copy[s - line] = '\0';
+  copy = xmemdup0 (line, s - line);
   for (cls = copy; *cls != '\0'; cls ++)
     *cls = TOLOWER (*cls);
 
@@ -1289,7 +1287,7 @@ delete_macro (const char *name)
   macro_entry *macro;
 
   len = strlen (name);
-  copy = (char *) xmalloc (len + 1);
+  copy = XNEWVEC (char, len + 1);
   for (i = 0; i < len; ++i)
     copy[i] = TOLOWER (name[i]);
   copy[i] = '\0';
This page took 0.023642 seconds and 4 git commands to generate.