You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2018/05/18 19:52:44 UTC

[trafficserver] branch master updated: WCCP: Fix issues with gcc8.

This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6932805  WCCP: Fix issues with gcc8.
6932805 is described below

commit 6932805c592cc494298cafc6df7382c999cc0e02
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Fri May 18 11:03:44 2018 -0500

    WCCP: Fix issues with gcc8.
---
 lib/wccp/WccpEndPoint.cc |  1 -
 lib/wccp/WccpLocal.h     | 15 +++++++--------
 lib/wccp/WccpMsg.cc      |  2 --
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/lib/wccp/WccpEndPoint.cc b/lib/wccp/WccpEndPoint.cc
index 90b0035..2815875 100644
--- a/lib/wccp/WccpEndPoint.cc
+++ b/lib/wccp/WccpEndPoint.cc
@@ -373,7 +373,6 @@ CacheImpl::defineServiceGroup(ServiceGroup const &svc, ServiceGroup::Result *res
   if (spot == m_groups.end()) { // not defined
     group        = &(m_groups[svc_id]);
     group->m_svc = svc;
-    memset(&group->m_id, 0, sizeof(group->m_id));
     group->m_id.initDefaultHash(m_addr);
     zret = ServiceGroup::DEFINED;
   } else {
diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h
index b66b5e9..d4114c2 100644
--- a/lib/wccp/WccpLocal.h
+++ b/lib/wccp/WccpLocal.h
@@ -782,7 +782,7 @@ public:
   typedef CacheIdBox self; ///< Self reference type.
 
   /// Default constructor.
-  CacheIdBox();
+  CacheIdBox() = default;
 
   /// @name Accessors
   //@{
@@ -839,10 +839,10 @@ protected:
   self &require(size_t n ///< Minimum buffer size required.
   );
 
-  CacheIdElt *m_base;       ///< Base address of memory for element.
-  CacheIdElt::Tail *m_tail; ///< Base address of trailing data elements.
-  size_t m_size;            ///< Size of element (valid data in buffer);
-  size_t m_cap;             ///< Size of allocated memory. Zero if external memory.
+  CacheIdElt *m_base       = nullptr; ///< Base address of memory for element.
+  CacheIdElt::Tail *m_tail = nullptr; ///< Base address of trailing data elements.
+  size_t m_size            = 0;       ///< Size of element (valid data in buffer);
+  size_t m_cap             = 0;       ///< Size of allocated memory. Zero if external memory.
 };
 
 /** Base class for all components.
@@ -866,14 +866,14 @@ class ComponentBase
 public:
   typedef ComponentBase self; ///< Self reference type.
   /// Default constructor.
-  ComponentBase();
+  ComponentBase() = default;
   /// Check for not present.
   bool isEmpty() const;
 
 protected:
   /// Base of component in message data.
   /// If this is @c NULL then the component is not in the message.
-  char *m_base;
+  char *m_base = nullptr;
 };
 
 /// Synthetic component to represent the overall message header.
@@ -3465,7 +3465,6 @@ MaskAssignElt::init(uint32_t srcAddr, uint32_t dstAddr, uint16_t srcPort, uint16
   return zret;
 }
 
-inline ComponentBase::ComponentBase() : m_base(0) {}
 inline bool
 ComponentBase::isEmpty() const
 {
diff --git a/lib/wccp/WccpMsg.cc b/lib/wccp/WccpMsg.cc
index 8878cb5..ee833ab 100644
--- a/lib/wccp/WccpMsg.cc
+++ b/lib/wccp/WccpMsg.cc
@@ -80,8 +80,6 @@ CacheHashIdElt::setBuckets(bool state)
   return *this;
 }
 
-CacheIdBox::CacheIdBox() : m_base(0), m_tail(0), m_size(0), m_cap(0) {}
-
 size_t
 CacheIdBox::getSize() const
 {

-- 
To stop receiving notification emails like this one, please contact
amc@apache.org.