]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change value::m_initialized to bool
authorTom Tromey <tom@tromey.com>
Tue, 14 Feb 2023 16:40:35 +0000 (09:40 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 15 Feb 2023 22:07:07 +0000 (15:07 -0700)
This changes value::m_initialized to be a bool and updates the various
uses.

Reviewed-By: Bruno Larsen <blarsen@redhat.com>
gdb/dwarf2/expr.c
gdb/dwarf2/expr.h
gdb/value.h

index 60d9bf5f1f95f91db8100eeed59ece75ecacc032..760c5c4b0d0ca1a251d79a50f3f8a6762e3a7859 100644 (file)
@@ -1496,7 +1496,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
   type *address_type = this->address_type ();
 
   this->m_location = DWARF_VALUE_MEMORY;
-  this->m_initialized = 1;  /* Default is initialized.  */
+  this->m_initialized = true;  /* Default is initialized.  */
 
   if (this->m_recursion_depth > this->m_max_recursion_depth)
     error (_("DWARF-2 expression error: Loop detected (%d)."),
@@ -2192,7 +2192,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
            error (_("DWARF-2 expression error: DW_OP_GNU_uninit must always "
                   "be the very last op."));
 
-         this->m_initialized = 0;
+         this->m_initialized = false;
          goto no_push;
 
        case DW_OP_call2:
index 44fc645116a493a98f305afb50f1e8fe900bfbdd..7a64316160e3b07a47b8885cae92281944afc54a 100644 (file)
@@ -164,9 +164,9 @@ private:
   ULONGEST m_len = 0;
   const gdb_byte *m_data = nullptr;
 
-  /* Initialization status of variable: Non-zero if variable has been
-     initialized; zero otherwise.  */
-  int m_initialized = 0;
+  /* Initialization status of variable: True if variable has been
+     initialized; false otherwise.  */
+  bool m_initialized = false;
 
   /* A vector of pieces.
 
index 233f42d32a05615bed6375c9a8944427490e0556..41327ebe3b8618a332e43f587fc99c2808fd4f7b 100644 (file)
@@ -134,7 +134,7 @@ private:
   explicit value (struct type *type_)
     : m_modifiable (true),
       m_lazy (true),
-      m_initialized (1),
+      m_initialized (true),
       m_stack (0),
       m_is_zero (false),
       m_in_history (false),
@@ -338,11 +338,11 @@ public:
 
   /* Set or return field indicating whether a variable is initialized or
      not, based on debugging information supplied by the compiler.
-     1 = initialized; 0 = uninitialized.  */
-  int initialized () const
+     true = initialized; false = uninitialized.  */
+  bool initialized () const
   { return m_initialized; }
 
-  void set_initialized (int value)
+  void set_initialized (bool value)
   { m_initialized = value; }
 
   /* If lval == lval_memory, return the address in the inferior.  If
@@ -638,7 +638,7 @@ private:
   bool m_lazy : 1;
 
   /* If value is a variable, is it initialized or not.  */
-  unsigned int m_initialized : 1;
+  bool m_initialized : 1;
 
   /* If value is from the stack.  If this is set, read_stack will be
      used instead of read_memory to enable extra caching.  */