gdb: include gdbsupport/buildargv.h in ser-mingw.c
[binutils-gdb.git] / gdb / p-exp.y
index 02ad6bddc4fed4a2269da438c7cbef00b9139edf..62b0a3be5a9a61e9a6d9c3f27cb343efcbcc2a3c 100644 (file)
@@ -1,5 +1,5 @@
 /* YACC parser for Pascal expressions, for GDB.
-   Copyright (C) 2000-2021 Free Software Foundation, Inc.
+   Copyright (C) 2000-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -651,8 +651,7 @@ variable:   block COLONCOLON name
                            error (_("No symbol \"%s\" in specified context."),
                                   copy.c_str ());
 
-                         pstate->push_new<var_value_operation>
-                           (sym.symbol, sym.block);
+                         pstate->push_new<var_value_operation> (sym);
                        }
        ;
 
@@ -690,8 +689,7 @@ variable:   name_not_typename
                              if (symbol_read_needs_frame (sym.symbol))
                                pstate->block_tracker->update (sym);
 
-                             pstate->push_new<var_value_operation>
-                               (sym.symbol, sym.block);
+                             pstate->push_new<var_value_operation> (sym);
                              current_type = sym.symbol->type; }
                          else if ($1.is_a_field_of_this)
                            {
@@ -1109,28 +1107,28 @@ yylex (void)
 
   /* See if it is a special token of length 3.  */
   if (explen > 2)
-    for (int i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
-      if (strncasecmp (tokstart, tokentab3[i].oper, 3) == 0
-         && (!isalpha (tokentab3[i].oper[0]) || explen == 3
+    for (const auto &token : tokentab3)
+      if (strncasecmp (tokstart, token.oper, 3) == 0
+         && (!isalpha (token.oper[0]) || explen == 3
              || (!isalpha (tokstart[3])
                  && !isdigit (tokstart[3]) && tokstart[3] != '_')))
        {
          pstate->lexptr += 3;
-         yylval.opcode = tokentab3[i].opcode;
-         return tokentab3[i].token;
+         yylval.opcode = token.opcode;
+         return token.token;
        }
 
   /* See if it is a special token of length 2.  */
   if (explen > 1)
-  for (int i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
-      if (strncasecmp (tokstart, tokentab2[i].oper, 2) == 0
-         && (!isalpha (tokentab2[i].oper[0]) || explen == 2
+    for (const auto &token : tokentab2)
+      if (strncasecmp (tokstart, token.oper, 2) == 0
+         && (!isalpha (token.oper[0]) || explen == 2
              || (!isalpha (tokstart[2])
                  && !isdigit (tokstart[2]) && tokstart[2] != '_')))
        {
          pstate->lexptr += 2;
-         yylval.opcode = tokentab2[i].opcode;
-         return tokentab2[i].token;
+         yylval.opcode = token.opcode;
+         return token.token;
        }
 
   switch (c = *tokstart)