/* The find command.
- Copyright (C) 2008-2014 Free Software Foundation, Inc.
+ Copyright (C) 2008-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include "value.h"
#include "target.h"
#include "cli/cli-utils.h"
+#include <algorithm>
/* Copied from bfd_put_bits. */
if (args == NULL)
error (_("Missing search parameters."));
- pattern_buf = xmalloc (pattern_buf_size);
+ pattern_buf = (gdb_byte *) xmalloc (pattern_buf_size);
pattern_buf_end = pattern_buf;
old_cleanups = make_cleanup (free_current_contents, &pattern_buf);
/* Keep it simple and assume size == 'g' when watching for when we
need to grow the pattern buf. */
pattern_buf_size_need = (pattern_buf_end - pattern_buf
- + max (TYPE_LENGTH (t), sizeof (int64_t)));
+ + std::max (TYPE_LENGTH (t),
+ (unsigned) sizeof (int64_t)));
if (pattern_buf_size_need > pattern_buf_size)
{
size_t current_offset = pattern_buf_end - pattern_buf;
pattern_buf_size = pattern_buf_size_need * 2;
- pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
+ pattern_buf = (gdb_byte *) xrealloc (pattern_buf, pattern_buf_size);
pattern_buf_end = pattern_buf + current_offset;
}