summaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2002-11-22 16:32:45 +0000
committerAndreas Schwab <schwab@suse.de>2002-11-22 16:32:45 +0000
commit1a159848a3f7346c4e0f86c1eb1ef1e3d8625029 (patch)
treecddc4b622a875ecd821697669a5e7a91f7488bc2 /gdb/valops.c
parent2049cc7d650f2d493a1e0fe8aedf0ed7f1cfdc66 (diff)
downloadgdb-1a159848a3f7346c4e0f86c1eb1ef1e3d8625029.tar.gz
* valops.c (value_slice): Move declaration of `offset' to avoid
warning.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 2249e8a15d7..a1da69dcba4 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3392,7 +3392,7 @@ struct value *
value_slice (struct value *array, int lowbound, int length)
{
struct type *slice_range_type, *slice_type, *range_type;
- LONGEST lowerbound, upperbound, offset;
+ LONGEST lowerbound, upperbound;
struct value *slice;
struct type *array_type;
array_type = check_typedef (VALUE_TYPE (array));
@@ -3443,7 +3443,7 @@ value_slice (struct value *array, int lowbound, int length)
else
{
struct type *element_type = TYPE_TARGET_TYPE (array_type);
- offset
+ LONGEST offset
= (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
slice_type = create_array_type ((struct type *) NULL, element_type,
slice_range_type);