]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/guile/scm-cmd.c
Add casts to memory allocation related calls
[thirdparty/binutils-gdb.git] / gdb / guile / scm-cmd.c
index e7826489b47b99adf8a39adc62b73c0bd8f76f92..900d7b0442a893b92eb10b8bc92ad4304a138450 100644 (file)
@@ -506,7 +506,7 @@ gdbscm_parse_command_name (const char *name,
                   || name[i - 1] == '_');
        --i)
     ;
-  result = xmalloc (lastchar - i + 2);
+  result = (char *) xmalloc (lastchar - i + 2);
   memcpy (result, &name[i], lastchar - i + 1);
   result[lastchar - i + 1] = '\0';
 
@@ -519,7 +519,7 @@ gdbscm_parse_command_name (const char *name,
       return result;
     }
 
-  prefix_text = xmalloc (i + 2);
+  prefix_text = (char *) xmalloc (i + 2);
   memcpy (prefix_text, name, i + 1);
   prefix_text[i + 1] = '\0';
 
@@ -601,7 +601,8 @@ char *
 gdbscm_canonicalize_command_name (const char *name, int want_trailing_space)
 {
   int i, out, seen_word;
-  char *result = scm_gc_malloc_pointerless (strlen (name) + 2, FUNC_NAME);
+  char *result
+    = (char *) scm_gc_malloc_pointerless (strlen (name) + 2, FUNC_NAME);
 
   i = out = seen_word = 0;
   while (name[i])