* value.c (set_value_bitpos, set_value_bitsize): Define.
* value.h (set_value_bitpos, set_value_bitsize): Declare.
* ada-lang.c, valarith.c: Update.
2005-02-07 Andrew Cagney <cagney@gnu.org>
+ * value.c (set_value_bitpos, set_value_bitsize): Define.
+ * value.h (set_value_bitpos, set_value_bitsize): Declare.
+ * ada-lang.c, valarith.c: Update.
+
* cp-valprint.c, c-valprint.c, infcall.c: Use value_contents or
value_contents_writeable, include note that there are problems.
* breakpoint.c, infcall.c: Use VALUE_LVAL.
result = allocate_value (type);
VALUE_LVAL (result) = VALUE_LVAL (val);
- result->bitsize = value_bitsize (val);
- result->bitpos = value_bitpos (val);
+ set_value_bitsize (result, value_bitsize (val));
+ set_value_bitpos (result, value_bitpos (val));
VALUE_ADDRESS (result) = VALUE_ADDRESS (val) + value_offset (val);
if (value_lazy (val)
|| TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val)))
if (VALUE_LVAL (obj) == lval_internalvar)
VALUE_LVAL (v) = lval_internalvar_component;
VALUE_ADDRESS (v) = VALUE_ADDRESS (obj) + value_offset (obj) + offset;
- v->bitpos = bit_offset + value_bitpos (obj);
- v->bitsize = bit_size;
+ set_value_bitpos (v, bit_offset + value_bitpos (obj));
+ set_value_bitsize (v, bit_size);
if (value_bitpos (v) >= HOST_CHAR_BIT)
{
VALUE_ADDRESS (v) += 1;
- v->bitpos -= HOST_CHAR_BIT;
+ set_value_bitpos (v, value_bitpos (v) - HOST_CHAR_BIT);
}
}
else
- v->bitsize = bit_size;
+ set_value_bitsize (v, bit_size);
unpacked = (unsigned char *) value_contents (v);
srcBitsLeft = bit_size;
bit_index = index % TARGET_CHAR_BIT;
byte >>= (BITS_BIG_ENDIAN ? TARGET_CHAR_BIT - 1 - bit_index : bit_index);
v = value_from_longest (LA_BOOL_TYPE, byte & 1);
- v->bitpos = bit_index;
- v->bitsize = 1;
+ set_value_bitpos (v, bit_index);
+ set_value_bitsize (v, 1);
VALUE_LVAL (v) = VALUE_LVAL (array);
if (VALUE_LVAL (array) == lval_internalvar)
VALUE_LVAL (v) = lval_internalvar_component;
{
return value->bitpos;
}
+void
+set_value_bitpos (struct value *value, int bit)
+{
+ value->bitpos = bit;
+}
int
value_bitsize (struct value *value)
{
return value->bitsize;
}
+void
+set_value_bitsize (struct value *value, int bit)
+{
+ value->bitsize = bit;
+}
bfd_byte *
value_contents_raw (struct value *value)
extern void deprecated_set_value_type (struct value *value,
struct type *type);
extern int value_bitsize (struct value *);
+extern void set_value_bitsize (struct value *, int bit);
extern int value_bitpos (struct value *);
+extern void set_value_bitpos (struct value *, int bit);
extern int value_offset (struct value *);
extern void set_value_offset (struct value *, int offset);