gdb: Use std::min and std::max throughout
[deliverable/binutils-gdb.git] / gdb / cli / cli-cmds.c
index c60b1d3c83c1a200207153ab020403ac7ff23cfb..5ab479185122afb1351f1f94c2dd90452cd11d74 100644 (file)
@@ -56,6 +56,7 @@
 #endif
 
 #include <fcntl.h>
+#include <algorithm>
 
 /* Prototypes for local command functions */
 
@@ -918,7 +919,7 @@ list_command (char *arg, int from_tty)
        {
          int first;
 
-         first = max (cursal.line - get_lines_to_list () / 2, 1);
+         first = std::max (cursal.line - get_lines_to_list () / 2, 1);
 
          /* A small special case --- if listing backwards, and we
             should list only one line, list the preceding line,
@@ -945,8 +946,8 @@ list_command (char *arg, int from_tty)
            error (_("Already at the start of %s."),
                   symtab_to_filename_for_display (cursal.symtab));
          print_source_lines (cursal.symtab,
-                             max (get_first_line_listed ()
-                                  - get_lines_to_list (), 1),
+                             std::max (get_first_line_listed ()
+                                       - get_lines_to_list (), 1),
                              get_first_line_listed (), 0);
        }
 
@@ -1090,7 +1091,7 @@ list_command (char *arg, int from_tty)
     error (_("No default source file yet.  Do \"help list\"."));
   if (dummy_beg)
     print_source_lines (sal_end.symtab,
-                       max (sal_end.line - (get_lines_to_list () - 1), 1),
+                       std::max (sal_end.line - (get_lines_to_list () - 1), 1),
                        sal_end.line + 1, 0);
   else if (sal.symtab == 0)
     error (_("No default source file yet.  Do \"help list\"."));
This page took 0.024642 seconds and 4 git commands to generate.