noside);
}
else
- result = value_struct_elt (argp, &args, name, static_memfuncp,
+ result = value_struct_elt (argp, args, name, static_memfuncp,
"structure");
return result;
char_type = type2;
inchar = (char) unpack_long (type2,
- value_contents (inval2));
+ value_contents (inval2).data ());
for (idx = 0; idx < count; idx++)
{
ptr[idx] = inchar;
char_type = TYPE_TARGET_TYPE (type2);
for (idx = 0; idx < count; idx++)
- {
- memcpy (&ptr[idx * inval2len], value_contents (inval2),
- inval2len);
- }
+ memcpy (&ptr[idx * inval2len], value_contents (inval2).data (),
+ inval2len);
}
outval = value_string (ptr.data (), count * inval2len, char_type);
}
{
char_type = type1;
- ptr[0] = (char) unpack_long (type1, value_contents (inval1));
+ ptr[0] = (char) unpack_long (type1, value_contents (inval1).data ());
}
else
{
char_type = TYPE_TARGET_TYPE (type1);
- memcpy (ptr.data (), value_contents (inval1), inval1len);
+ memcpy (ptr.data (), value_contents (inval1).data (), inval1len);
}
if (type2->code () == TYPE_CODE_CHAR)
{
ptr[inval1len] =
- (char) unpack_long (type2, value_contents (inval2));
+ (char) unpack_long (type2, value_contents (inval2).data ());
}
else
{
- memcpy (&ptr[inval1len], value_contents (inval2), inval2len);
+ memcpy (&ptr[inval1len], value_contents (inval2).data (), inval2len);
}
outval = value_string (ptr.data (), inval1len + inval2len, char_type);
}
if (is_floating_type (type1))
{
*eff_type_x = type1;
- memcpy (x, value_contents (arg1), TYPE_LENGTH (type1));
+ memcpy (x, value_contents (arg1).data (), TYPE_LENGTH (type1));
}
else if (is_integral_type (type1))
{
if (is_floating_type (type2))
{
*eff_type_y = type2;
- memcpy (y, value_contents (arg2), TYPE_LENGTH (type2));
+ memcpy (y, value_contents (arg2).data (), TYPE_LENGTH (type2));
}
else if (is_integral_type (type2))
{
type2 = type1;
}
- v1.read_fixed_point (gdb::make_array_view (value_contents (arg1),
+ v1.read_fixed_point (gdb::make_array_view (value_contents (arg1).data (),
TYPE_LENGTH (type1)),
type_byte_order (type1), type1->is_unsigned (),
type1->fixed_point_scaling_factor ());
- v2.read_fixed_point (gdb::make_array_view (value_contents (arg2),
+ v2.read_fixed_point (gdb::make_array_view (value_contents (arg2).data (),
TYPE_LENGTH (type2)),
type_byte_order (type2), type2->is_unsigned (),
type2->fixed_point_scaling_factor ());
value *fp_val = allocate_value (type1);
fp.write_fixed_point
- (gdb::make_array_view (value_contents_raw (fp_val),
+ (gdb::make_array_view (value_contents_raw (fp_val).data (),
TYPE_LENGTH (type1)),
type_byte_order (type1),
type1->is_unsigned (),
v2.data (), &eff_type_v2);
target_float_binop (op, v1.data (), eff_type_v1,
v2.data (), eff_type_v2,
- value_contents_raw (val), result_type);
+ value_contents_raw (val).data (), result_type);
}
else if (type1->code () == TYPE_CODE_BOOL
|| type2->code () == TYPE_CODE_BOOL)
result_type = type1;
val = allocate_value (result_type);
- store_signed_integer (value_contents_raw (val),
+ store_signed_integer (value_contents_raw (val).data (),
TYPE_LENGTH (result_type),
type_byte_order (result_type),
v);
}
val = allocate_value (result_type);
- store_unsigned_integer (value_contents_raw (val),
+ store_unsigned_integer (value_contents_raw (val).data (),
TYPE_LENGTH (value_type (val)),
type_byte_order (result_type),
v);
}
val = allocate_value (result_type);
- store_signed_integer (value_contents_raw (val),
+ store_signed_integer (value_contents_raw (val).data (),
TYPE_LENGTH (value_type (val)),
type_byte_order (result_type),
v);
val = allocate_value (vector_type);
for (i = 0; i < high_bound - low_bound + 1; i++)
/* Duplicate the contents of elval into the destination vector. */
- memcpy (value_contents_writeable (val) + (i * TYPE_LENGTH (eltype)),
- value_contents_all (elval), TYPE_LENGTH (eltype));
+ memcpy (value_contents_writeable (val).data () + (i * TYPE_LENGTH (eltype)),
+ value_contents_all (elval).data (), TYPE_LENGTH (eltype));
return val;
}
{
tmp = value_binop (value_subscript (val1, i),
value_subscript (val2, i), op);
- memcpy (value_contents_writeable (val) + i * elsize,
- value_contents_all (tmp),
+ memcpy (value_contents_writeable (val).data () + i * elsize,
+ value_contents_all (tmp).data (),
elsize);
}
value_free_to_mark (mark);
return val;
}
\f
-/* Simulate the C operator ! -- return 1 if ARG1 contains zero. */
+/* See value.h. */
-int
+bool
value_logical_not (struct value *arg1)
{
int len;
type1 = check_typedef (value_type (arg1));
if (is_floating_value (arg1))
- return target_float_is_zero (value_contents (arg1), type1);
+ return target_float_is_zero (value_contents (arg1).data (), type1);
len = TYPE_LENGTH (type1);
- p = value_contents (arg1);
+ p = value_contents (arg1).data ();
while (--len >= 0)
{
{
int len1 = TYPE_LENGTH (value_type (arg1));
int len2 = TYPE_LENGTH (value_type (arg2));
- const gdb_byte *s1 = value_contents (arg1);
- const gdb_byte *s2 = value_contents (arg2);
+ const gdb_byte *s1 = value_contents (arg1).data ();
+ const gdb_byte *s2 = value_contents (arg2).data ();
int i, len = len1 < len2 ? len1 : len2;
for (i = 0; i < len; i++)
&& ((len = (int) TYPE_LENGTH (type1))
== (int) TYPE_LENGTH (type2)))
{
- p1 = value_contents (arg1);
- p2 = value_contents (arg2);
+ p1 = value_contents (arg1).data ();
+ p2 = value_contents (arg2).data ();
while (--len >= 0)
{
if (*p1++ != *p2++)
return (type1->code () == type2->code ()
&& TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
- && memcmp (value_contents (arg1), value_contents (arg2),
+ && memcmp (value_contents (arg1).data (),
+ value_contents (arg2).data (),
TYPE_LENGTH (type1)) == 0);
}
if (is_integral_type (type) || is_floating_value (arg1)
|| (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
|| type->code () == TYPE_CODE_COMPLEX)
- return value_from_contents (type, value_contents (arg1));
+ return value_from_contents (type, value_contents (arg1).data ());
else
error (_("Argument to positive operation not a number."));
}
for (i = 0; i < high_bound - low_bound + 1; i++)
{
tmp = value_neg (value_subscript (arg1, i));
- memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
- value_contents_all (tmp), TYPE_LENGTH (eltype));
+ memcpy ((value_contents_writeable (val).data ()
+ + i * TYPE_LENGTH (eltype)),
+ value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
}
return val;
}
for (i = 0; i < high_bound - low_bound + 1; i++)
{
tmp = value_complement (value_subscript (arg1, i));
- memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
- value_contents_all (tmp), TYPE_LENGTH (eltype));
+ memcpy ((value_contents_writeable (val).data ()
+ + i * TYPE_LENGTH (eltype)),
+ value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
}
}
else if (type->code () == TYPE_CODE_COMPLEX)
&& eltype->code () != TYPE_CODE_ENUM
&& eltype->code () != TYPE_CODE_BOOL)
error (_("First argument of 'IN' has wrong type"));
- member = value_bit_index (settype, value_contents (set),
+ member = value_bit_index (settype, value_contents (set).data (),
value_as_long (element));
if (member < 0)
error (_("First argument of 'IN' not in range"));