This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Reorder variable declarations in ada_value_primitive_packed_val
- From: Joel Brobecker <brobecke at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 9 Oct 2015 21:34:47 -0000
- Subject: [binutils-gdb] Reorder variable declarations in ada_value_primitive_packed_val
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a1c95e6b6ede168770664cdca8ae1568187554b4
commit a1c95e6b6ede168770664cdca8ae1568187554b4
Author: Joel Brobecker <brobecker@adacore.com>
Date: Fri Oct 9 14:12:29 2015 -0700
Reorder variable declarations in ada_value_primitive_packed_val
This patch just changes the order in which local variables are declared
so as to group the logically-related variables together. No code
change otherwise.
gdb/ChangeLog:
* ada-lang.c (ada_value_primitive_packed_val): Reorder local
variable declarations.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/ada-lang.c | 22 +++++++++++++---------
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ff3e7d5..968992e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-10-09 Joel Brobecker <brobecker@adacore.com>
+ * ada-lang.c (ada_value_primitive_packed_val): Reorder local
+ variable declarations.
+
+2015-10-09 Joel Brobecker <brobecker@adacore.com>
+
* ada-lang.c (ada_value_primitive_packed_val): Change the type
of local variables src and unpacked to "gdb_type *" instead of
"unsigned char *".
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a5e68d5..1dbbb07 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -2398,19 +2398,23 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
struct type *type)
{
struct value *v;
- int src_idx, /* Index into the source area */
- unpacked_idx, /* Index into the unpacked buffer */
- srcBitsLeft, /* Number of source bits left to move */
- src_bytes_left, /* Number of source bytes left to process. */
- unpacked_bytes_left, /* Number of bytes left to set in unpacked. */
- unusedLS, /* Number of bits in next significant
- byte of source that are unused */
- accumSize; /* Number of meaningful bits in accum */
+
gdb_byte *src; /* First byte containing data to unpack */
+ int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
+ int src_idx; /* Index into the source area */
+ int src_bytes_left; /* Number of source bytes left to process. */
+ int srcBitsLeft; /* Number of source bits left to move */
+ int unusedLS; /* Number of bits in next significant
+ byte of source that are unused */
+
gdb_byte *unpacked;
+ int unpacked_idx; /* Index into the unpacked buffer */
+ int unpacked_bytes_left; /* Number of bytes left to set in unpacked. */
+
unsigned long accum; /* Staging area for bits being transferred */
+ int accumSize; /* Number of meaningful bits in accum */
unsigned char sign;
- int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
+
/* Transmit bytes from least to most significant; delta is the direction
the indices move. */
int delta = gdbarch_bits_big_endian (get_type_arch (type)) ? -1 : 1;