]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/solib-spu.c
Add casts to memory allocation related calls
[thirdparty/binutils-gdb.git] / gdb / solib-spu.c
index a629ec9818c78f36c71863a160ced3f8661deb7f..12ff49e20c4d1a0e0e435d85586ca9283cf1e344 100644 (file)
@@ -56,8 +56,8 @@ spu_relocate_main_executable (int spufs_fd)
   if (symfile_objfile == NULL)
     return;
 
-  new_offsets = alloca (symfile_objfile->num_sections
-                       * sizeof (struct section_offsets));
+  new_offsets = XALLOCAVEC (struct section_offsets,
+                           symfile_objfile->num_sections);
 
   for (i = 0; i < symfile_objfile->num_sections; i++)
     new_offsets->offsets[i] = SPUADDR (spufs_fd, 0);
@@ -373,7 +373,8 @@ spu_bfd_open (char *pathname)
 
       if (sect_size > 20)
        {
-         char *buf = alloca (sect_size - 20 + strlen (original_name) + 1);
+         char *buf
+           = (char *) alloca (sect_size - 20 + strlen (original_name) + 1);
 
          bfd_get_section_contents (abfd, spu_name, buf, 20, sect_size - 20);
          buf[sect_size - 20] = '\0';