summaryrefslogtreecommitdiff
path: root/gdb
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
commit75f37363f5bcbd3bf5c5993eff6e74133f156f78 (patch)
tree21d3ad955eec439fc191d69044a21be44aae92d4 /gdb
parentfd371d91de5b95bea32998348da95df6e8536da5 (diff)
downloadgdb-75f37363f5bcbd3bf5c5993eff6e74133f156f78.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')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/m2-typeprint.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 675d1fa788a..1cc0b6f6fc8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-27 Joel Brobecker <brobecker@adacore.com>
+
+ From Peter Schauer <peterschauer@gmx.net>
+ * m2-typeprint.c (m2_record_fields): Move variable declarations
+ to the begining of the block.
+
2006-05-23 Mark Mitchell <mark@codesourcery.com>
* mt-tdep.c (mt_register_name): Correct out-of-range logic to
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++)
{