|
|
2f9ed3 |
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
|
|
2f9ed3 |
From: Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
2f9ed3 |
Date: Wed, 12 Sep 2018 00:02:17 -0400
|
|
|
2f9ed3 |
Subject: gdb-rhbz795424-bitpos-arrayview.patch
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
;; This patch is needed to compile GDB after -Werror=narrowing has
|
|
|
2f9ed3 |
;; been enabled by default.
|
|
|
2f9ed3 |
;; Author: Sergio Durigan Junior.
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
diff --git a/gdb/common/array-view.h b/gdb/common/array-view.h
|
|
|
2f9ed3 |
--- a/gdb/common/array-view.h
|
|
|
2f9ed3 |
+++ b/gdb/common/array-view.h
|
|
|
2f9ed3 |
@@ -85,7 +85,7 @@ public:
|
|
|
2f9ed3 |
using value_type = T;
|
|
|
2f9ed3 |
using reference = T &;
|
|
|
2f9ed3 |
using const_reference = const T &;
|
|
|
2f9ed3 |
- using size_type = size_t;
|
|
|
2f9ed3 |
+ using size_type = ULONGEST;
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
/* Default construction creates an empty view. */
|
|
|
2f9ed3 |
constexpr array_view () noexcept
|
|
|
2f9ed3 |
@@ -114,7 +114,7 @@ public:
|
|
|
2f9ed3 |
count. */
|
|
|
2f9ed3 |
template
|
|
|
2f9ed3 |
typename = Requires<DecayedConvertible<U>>>
|
|
|
2f9ed3 |
- constexpr array_view (U *array, size_t size) noexcept
|
|
|
2f9ed3 |
+ constexpr array_view (U *array, ULONGEST size) noexcept
|
|
|
2f9ed3 |
: m_array (array), m_size (size)
|
|
|
2f9ed3 |
{}
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
@@ -128,7 +128,7 @@ public:
|
|
|
2f9ed3 |
{}
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
/* Create an array view from an array. */
|
|
|
2f9ed3 |
- template
|
|
|
2f9ed3 |
+ template
|
|
|
2f9ed3 |
typename = Requires<DecayedConvertible<U>>>
|
|
|
2f9ed3 |
constexpr array_view (U (&array)[Size]) noexcept
|
|
|
2f9ed3 |
: m_array (array), m_size (Size)
|
|
|
2f9ed3 |
@@ -161,9 +161,9 @@ public:
|
|
|
2f9ed3 |
/*constexpr14*/ T *end () noexcept { return m_array + m_size; }
|
|
|
2f9ed3 |
constexpr const T *end () const noexcept { return m_array + m_size; }
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
- /*constexpr14*/ reference operator[] (size_t index) noexcept
|
|
|
2f9ed3 |
+ /*constexpr14*/ reference operator[] (ULONGEST index) noexcept
|
|
|
2f9ed3 |
{ return m_array[index]; }
|
|
|
2f9ed3 |
- constexpr const_reference operator[] (size_t index) const noexcept
|
|
|
2f9ed3 |
+ constexpr const_reference operator[] (ULONGEST index) const noexcept
|
|
|
2f9ed3 |
{ return m_array[index]; }
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
constexpr size_type size () const noexcept { return m_size; }
|
|
|
2f9ed3 |
@@ -196,7 +196,7 @@ operator== (const gdb::array_view<T> &lhs, const gdb::array_view<T> &rhs)
|
|
|
2f9ed3 |
if (lhs.size () != rhs.size ())
|
|
|
2f9ed3 |
return false;
|
|
|
2f9ed3 |
|
|
|
2f9ed3 |
- for (size_t i = 0; i < lhs.size (); i++)
|
|
|
2f9ed3 |
+ for (ULONGEST i = 0; i < lhs.size (); i++)
|
|
|
2f9ed3 |
if (!(lhs[i] == rhs[i]))
|
|
|
2f9ed3 |
return false;
|
|
|
2f9ed3 |
|