From: Joel Brobecker Date: Sat, 27 May 2006 17:50:50 +0000 (+0000) Subject: From Peter Schauer X-Git-Tag: gdb_6_5-20060621-release~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a672a29835dd3b6f2c50bc94c88d80899f838f34;p=thirdparty%2Fbinutils-gdb.git From Peter Schauer * m2-typeprint.c (m2_record_fields): Move variable declarations to the begining of the block. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7fa4079c9bd..810e44186f1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2006-05-27 Joel Brobecker + + From Peter Schauer + * m2-typeprint.c (m2_record_fields): Move variable declarations + to the begining of the block. + 2006-05-20 Gaius Mulley * NEWS: (Improved Modula-2 language support): New section. 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 OF\n")); - int i; - int len = TYPE_NFIELDS (type); for (i = TYPE_N_BASECLASSES (type); i < len; i++) {