diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-31 13:41:35 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-13 15:21:08 -0700 |
commit | ee7bb2944b75ce482dbf3bdb2d396efc98f1cf89 (patch) | |
tree | d5ffc773a34b580cd981ce5c529f8232c4e5a355 /gdb/valops.c | |
parent | b27556e3c10e197cc31021649a6113bb305b970e (diff) | |
download | fsf-binutils-gdb-ee7bb2944b75ce482dbf3bdb2d396efc98f1cf89.zip fsf-binutils-gdb-ee7bb2944b75ce482dbf3bdb2d396efc98f1cf89.tar.gz fsf-binutils-gdb-ee7bb2944b75ce482dbf3bdb2d396efc98f1cf89.tar.bz2 |
Turn value_zero into static "constructor"
This turns value_zero into a static "constructor" of value.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index b711f31..50f8903 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -271,7 +271,7 @@ value_cast_structs (struct type *type, struct value *v2) T2. This wouldn't work properly for classes with virtual bases, but those were handled above. */ v = search_struct_field (t2->name (), - value_zero (t1, not_lval), t1, 1); + value::zero (t1, not_lval), t1, 1); if (v) { /* Downcasting is possible (t1 is superclass of v2). */ @@ -640,7 +640,7 @@ value_cast (struct type *type, struct value *arg2) error (_("can only cast scalar to vector of same size")); else if (code1 == TYPE_CODE_VOID) { - return value_zero (to_type, not_lval); + return value::zero (to_type, not_lval); } else if (type->length () == type2->length ()) { @@ -848,7 +848,7 @@ value_dynamic_cast (struct type *type, struct value *arg) /* Handle NULL pointers. */ if (value_as_long (arg) == 0) - return value_zero (type, not_lval); + return value::zero (type, not_lval); arg = value_ind (arg); } @@ -928,7 +928,7 @@ value_dynamic_cast (struct type *type, struct value *arg) : value_addr (result)); if (resolved_type->code () == TYPE_CODE_PTR) - return value_zero (type, not_lval); + return value::zero (type, not_lval); error (_("dynamic_cast failed")); } @@ -4167,7 +4167,7 @@ cast_into_complex (struct type *type, struct value *val) else if (val->type ()->code () == TYPE_CODE_FLT || val->type ()->code () == TYPE_CODE_INT) return value_literal_complex (val, - value_zero (real_type, not_lval), + value::zero (real_type, not_lval), type); else error (_("cannot cast non-number to complex")); |