aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2014-01-29 14:25:18 +0400
committerJoel Brobecker <brobecker@adacore.com>2014-01-29 14:41:04 +0400
commita7c88acd1ed0b886e7aff708df153c5663a9ebbb (patch)
tree6c652b2250f0425cbf958567972170b4b4dd0384 /gdb/valops.c
parentec673e648cf7b2fa6a03342b0bca3ed3855f002f (diff)
downloadgdb-a7c88acd1ed0b886e7aff708df153c5663a9ebbb.zip
gdb-a7c88acd1ed0b886e7aff708df153c5663a9ebbb.tar.gz
gdb-a7c88acd1ed0b886e7aff708df153c5663a9ebbb.tar.bz2
Minor reformatting in valops.c::value_slice
I noticed that a small lexical block was over indented by 2 characters. So this patch starts by reducing the indentation. While looking at this area of the code, I also noticed a couple of lines that had trailing spaces, so this patch also removes them. And finally, it fixes one tiny to put the assignment operator at the start of the next line, rather than at the end of the first line. gdb/ChangeLog: * valops.c (value_slice): Minor reformatting.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index deb01cb..898401d 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3614,32 +3614,33 @@ value_slice (struct value *array, int lowbound, int length)
done with it. */
slice_range_type = create_range_type ((struct type *) NULL,
TYPE_TARGET_TYPE (range_type),
- lowbound,
+ lowbound,
lowbound + length - 1);
- {
- struct type *element_type = TYPE_TARGET_TYPE (array_type);
- LONGEST offset =
- (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
+ {
+ struct type *element_type = TYPE_TARGET_TYPE (array_type);
+ LONGEST offset
+ = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
- slice_type = create_array_type ((struct type *) NULL,
- element_type,
- slice_range_type);
- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
+ slice_type = create_array_type ((struct type *) NULL,
+ element_type,
+ slice_range_type);
+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
- if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
- slice = allocate_value_lazy (slice_type);
- else
- {
- slice = allocate_value (slice_type);
- value_contents_copy (slice, 0, array, offset,
- TYPE_LENGTH (slice_type));
- }
+ if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
+ slice = allocate_value_lazy (slice_type);
+ else
+ {
+ slice = allocate_value (slice_type);
+ value_contents_copy (slice, 0, array, offset,
+ TYPE_LENGTH (slice_type));
+ }
+
+ set_value_component_location (slice, array);
+ VALUE_FRAME_ID (slice) = VALUE_FRAME_ID (array);
+ set_value_offset (slice, value_offset (array) + offset);
+ }
- set_value_component_location (slice, array);
- VALUE_FRAME_ID (slice) = VALUE_FRAME_ID (array);
- set_value_offset (slice, value_offset (array) + offset);
- }
return slice;
}