Extract string-printing out of ada_val_print_array
authorJoel Brobecker <brobecker@adacore.com>
Thu, 19 Dec 2013 16:06:46 +0000 (20:06 +0400)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 7 Jan 2014 04:17:39 +0000 (08:17 +0400)
commit71855601a553755743aff19a36c53c62f3d63270
tree88d0a4521214f0a1ee9cdd92fd28b75241499cb3
parent4eb27a304c5943962ba1afa90b6eaa6eb6b25a74
Extract string-printing out of ada_val_print_array

This patch creates a new function called "ada_val_print_string"
whose code is directly extracted out of ada_val_print_array.
The extracted code is then replaced by a call to this new function,
followed by a "return". The return avoids the need for an "else"
branch, with the associated block nesting. The latter is not really
terrible in this case, but it seems more readable this way.

gdb/ChangeLog:

        * ada-valprint.c (ada_val_print_string): New function,
        extracted from ada_val_print_array.
        (ada_val_print_array): Replace extracted code by call
        to ada_val_print_string followed by a return.  Move
        "else" branch to the function's top block.
gdb/ChangeLog
gdb/ada-valprint.c