summaryrefslogtreecommitdiff
path: root/gdb/m2-typeprint.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2006-05-27 17:39:29 +0000
committerJoel Brobecker <brobecker@gnat.com>2006-05-27 17:39:29 +0000
commit5648af48fbb248cc37aab894165ffd344ee03cd5 (patch)
treedd6cb2d5aa28f07f32778228d81d02f84e8324c8 /gdb/m2-typeprint.c
parent3f570048d764dc9730cfbcf0b84b707333124f1c (diff)
downloadbinutils-gdb-5648af48fbb248cc37aab894165ffd344ee03cd5.tar.gz
From Peter Schauer <peterschauer@gmx.net>
* m2-typeprint.c (m2_record_fields): Move variable declarations to the begining of the block.
Diffstat (limited to 'gdb/m2-typeprint.c')
-rw-r--r--gdb/m2-typeprint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
index 160305c7869..e057b65ce3c 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -504,13 +504,14 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
}
else if (show > 0)
{
+ int i;
+ int len = TYPE_NFIELDS (type);
+
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
fprintf_filtered (stream, "RECORD\n");
else if (TYPE_CODE (type) == TYPE_CODE_UNION)
/* i18n: Do not translate "CASE" and "OF" */
fprintf_filtered (stream, _("CASE <variant> OF\n"));
- int i;
- int len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
{