You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2022/10/04 16:25:54 UTC
[trafficserver] 01/01: Revert "Fix warnings from GCC 12.0.1 (#8684)"
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch revert-8684-gcc_12_0_1_warning_fixes
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 55cef40b8a24dd3fb132a0d8010452267775d2b8
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Tue Oct 4 11:25:47 2022 -0500
Revert "Fix warnings from GCC 12.0.1 (#8684)"
This reverts commit 0ae34d4d1699d978f6938027efb2ecb9ae05c89a.
---
example/plugins/cpp-api/boom/boom.cc | 5 +----
include/tscore/IntrusivePtr.h | 6 +-----
include/tscpp/api/Headers.h | 10 ++--------
iocore/net/quic/QUICFrame.h | 5 +----
lib/swoc/include/swoc/DiscreteRange.h | 6 +-----
src/tscore/HostLookup.cc | 6 +-----
src/wccp/WccpMeta.h | 6 +-----
7 files changed, 8 insertions(+), 36 deletions(-)
diff --git a/example/plugins/cpp-api/boom/boom.cc b/example/plugins/cpp-api/boom/boom.cc
index 7a3a3234d..a312e7f20 100644
--- a/example/plugins/cpp-api/boom/boom.cc
+++ b/example/plugins/cpp-api/boom/boom.cc
@@ -98,16 +98,13 @@ GlobalPlugin *plugin;
// Functor that decides whether the HTTP error can be rewritten or not.
// Rewritable codes are: 2xx, 3xx, 4xx, 5xx and 6xx.
// 1xx is NOT rewritable!
-class IsRewritableCode
+class IsRewritableCode : public std::unary_function<std::string, bool>
{ // could probably be replaced with mem_ptr_fun()..
private:
int current_code_;
std::string current_code_string_;
public:
- using argument_type = std::string;
- using result_type = bool;
-
explicit IsRewritableCode(int current_code) : current_code_(current_code)
{
std::ostringstream oss;
diff --git a/include/tscore/IntrusivePtr.h b/include/tscore/IntrusivePtr.h
index 70cc671e3..bfe63a3ae 100644
--- a/include/tscore/IntrusivePtr.h
+++ b/include/tscore/IntrusivePtr.h
@@ -330,13 +330,9 @@ public:
static void finalize(T *t);
/// Strict weak order for STL containers.
- class Order
+ class Order : public std::binary_function<IntrusivePtr<T>, IntrusivePtr<T>, bool>
{
public:
- using first_argument_type = IntrusivePtr<T>;
- using second_argument_type = IntrusivePtr<T>;
- using result_type = bool;
-
/// Default constructor.
Order() {}
/// Compare by raw pointer.
diff --git a/include/tscpp/api/Headers.h b/include/tscpp/api/Headers.h
index ffaffde81..9e6daea8e 100644
--- a/include/tscpp/api/Headers.h
+++ b/include/tscpp/api/Headers.h
@@ -109,15 +109,12 @@ class HeaderField;
/**
* @brief A header field value iterator iterates through all header fields.
*/
-class header_field_value_iterator
+class header_field_value_iterator : public std::iterator<std::forward_iterator_tag, int>
{
private:
HeaderFieldValueIteratorState *state_;
public:
- using iterator_category = std::forward_iterator_tag;
- using value_type = int;
-
/**
* Constructor for header_field_value_iterator, this shouldn't need to be used directly.
* @param bufp the TSMBuffer associated with the headers
@@ -172,16 +169,13 @@ public:
/**
* @brief A header field iterator is an iterator that dereferences to a HeaderField.
*/
-class header_field_iterator
+class header_field_iterator : public std::iterator<std::forward_iterator_tag, int>
{
private:
HeaderFieldIteratorState *state_;
header_field_iterator(void *hdr_buf, void *hdr_loc, void *field_loc);
public:
- using iterator_category = std::forward_iterator_tag;
- using value_type = int;
-
~header_field_iterator();
/**
diff --git a/iocore/net/quic/QUICFrame.h b/iocore/net/quic/QUICFrame.h
index 0eda989e6..9530c7eac 100644
--- a/iocore/net/quic/QUICFrame.h
+++ b/iocore/net/quic/QUICFrame.h
@@ -204,12 +204,9 @@ public:
class AckBlockSection
{
public:
- class const_iterator
+ class const_iterator : public std::iterator<std::input_iterator_tag, QUICAckFrame::AckBlock>
{
public:
- using iterator_category = std::input_iterator_tag;
- using value_type = QUICAckFrame::AckBlock;
-
const_iterator(uint8_t index, const std::vector<QUICAckFrame::AckBlock> *ack_blocks);
const QUICAckFrame::AckBlock &
diff --git a/lib/swoc/include/swoc/DiscreteRange.h b/lib/swoc/include/swoc/DiscreteRange.h
index 503911cac..dd130d860 100644
--- a/lib/swoc/include/swoc/DiscreteRange.h
+++ b/lib/swoc/include/swoc/DiscreteRange.h
@@ -319,11 +319,7 @@ public:
The first pair of elements that are not equal determine the ordering
of the overall tuples.
*/
- struct lexicographic_order {
- using first_argument_type = self_type;
- using second_argument_type = self_type;
- using result_type = bool;
-
+ struct lexicographic_order : public std::binary_function<self_type, self_type, bool> {
//! Functor operator.
bool operator()(self_type const &lhs, self_type const &rhs) const;
};
diff --git a/src/tscore/HostLookup.cc b/src/tscore/HostLookup.cc
index 440474e94..b695e0f47 100644
--- a/src/tscore/HostLookup.cc
+++ b/src/tscore/HostLookup.cc
@@ -231,11 +231,7 @@ struct CharIndexBlock {
class CharIndex
{
public:
- struct iterator {
- using iterator_category = std::forward_iterator_tag;
- using value_type = HostBranch;
- using difference_type = int;
-
+ struct iterator : public std::iterator<std::forward_iterator_tag, HostBranch, int> {
using self_type = iterator;
struct State {
diff --git a/src/wccp/WccpMeta.h b/src/wccp/WccpMeta.h
index 11a9b09cf..464e8bafc 100644
--- a/src/wccp/WccpMeta.h
+++ b/src/wccp/WccpMeta.h
@@ -54,11 +54,7 @@ template <bool VALUE> struct TEST_IF_TRUE : public TEST_RESULT<TEST_BOOL<VALUE>>
};
// Helper for assigning a value to all instances in a container.
-template <typename T, typename R, typename A1> struct TsAssignMember {
- using first_argument_type = T;
- using second_argument_type = A1;
- using result_type = R;
-
+template <typename T, typename R, typename A1> struct TsAssignMember : public std::binary_function<T, A1, R> {
R T::*_m;
A1 _arg1;
TsAssignMember(R T::*m, A1 const &arg1) : _m(m), _arg1(arg1) {}