From: Tom Tromey Date: Thu, 31 Aug 2023 18:11:46 +0000 (-0600) Subject: Remove dead code from varobj_set_display_format X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=665b55a92ed514d4eb32f78278dd7f0e39865f04;p=binutils-gdb.git Remove dead code from varobj_set_display_format varobj_set_display_format takes an enum and exhaustively switches on the values -- but also has a default. This default case is dead code. Reviewed-by: Keith Seitz --- diff --git a/gdb/varobj.c b/gdb/varobj.c index 52e62aca265..760809c6f51 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -488,20 +488,7 @@ enum varobj_display_formats varobj_set_display_format (struct varobj *var, enum varobj_display_formats format) { - switch (format) - { - case FORMAT_NATURAL: - case FORMAT_BINARY: - case FORMAT_DECIMAL: - case FORMAT_HEXADECIMAL: - case FORMAT_OCTAL: - case FORMAT_ZHEXADECIMAL: - var->format = format; - break; - - default: - var->format = variable_default_display (var); - } + var->format = format; if (varobj_value_is_changeable_p (var) && var->value != nullptr && !var->value->lazy ())