[3/3] Remove a couple unnecessary casts

Message ID 20240320-bcache-type-v1-3-fe616105e9ae@adacore.com
State New
Headers
Series Better type safety for bcache |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Tom Tromey March 20, 2024, 8:24 p.m. UTC
  After the previous bcache change, a couple of casts in objfiles.h are
now redundant.
---
 gdb/objfiles.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Alexandra Petlanova Hajkova March 27, 2024, 7:50 p.m. UTC | #1
On Wed, Mar 20, 2024 at 9:25 PM Tom Tromey <tromey@adacore.com> wrote:

> After the previous bcache change, a couple of casts in objfiles.h are
> now redundant.
> ---
>  gdb/objfiles.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> It's nice to get rid of redundant things. Causes no regressions as
> expected.
>
  

Patch

diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 8b8b7182e87..ab655906508 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -234,14 +234,14 @@  struct objfile_per_bfd_storage
 
   const char *intern (const char *str)
   {
-    return (const char *) string_cache.insert (str, strlen (str) + 1);
+    return string_cache.insert (str, strlen (str) + 1);
   }
 
   /* Same as the above, but for an std::string.  */
 
   const char *intern (const std::string &str)
   {
-    return (const char *) string_cache.insert (str.c_str (), str.size () + 1);
+    return string_cache.insert (str.c_str (), str.size () + 1);
   }
 
   /* Get the BFD this object is associated to.  */