You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by rr...@apache.org on 2019/04/30 14:07:08 UTC

[trafficserver] branch master updated: cppcheck: Fix issues found in I_IOBuffer.h

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

rrm 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 ed7c200  cppcheck: Fix issues found in I_IOBuffer.h
ed7c200 is described below

commit ed7c2001d8f9f689d0853db7e80078d59ba22c4e
Author: Bill Chen <bi...@linkedin.com>
AuthorDate: Thu Apr 25 08:03:35 2019 -0700

    cppcheck: Fix issues found in I_IOBuffer.h
---
 iocore/eventsystem/I_IOBuffer.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/iocore/eventsystem/I_IOBuffer.h b/iocore/eventsystem/I_IOBuffer.h
index 90b599a..1742016 100644
--- a/iocore/eventsystem/I_IOBuffer.h
+++ b/iocore/eventsystem/I_IOBuffer.h
@@ -585,6 +585,7 @@ public:
     const_iterator() = default; ///< Default constructor.
 
     /// Copy constructor.
+    // cppcheck-suppress noExplicitConstructor; copy constructor
     const_iterator(self_type const &that);
 
     /// Assignment.
@@ -1298,6 +1299,7 @@ public:
 #endif
 
   MIOBuffer(void *b, int64_t bufsize, int64_t aWater_mark);
+  // cppcheck-suppress noExplicitConstructor; allow implicit conversion
   MIOBuffer(int64_t default_size_index);
   MIOBuffer();
   ~MIOBuffer();
@@ -1372,7 +1374,7 @@ class MIOBuffer_tracker
   const char *loc;
 
 public:
-  MIOBuffer_tracker(const char *_loc) : loc(_loc) {}
+  explicit MIOBuffer_tracker(const char *_loc) : loc(_loc) {}
   MIOBuffer *
   operator()(int64_t size_index = default_large_iobuffer_size)
   {
@@ -1393,7 +1395,7 @@ class Empty_MIOBuffer_tracker
   const char *loc;
 
 public:
-  Empty_MIOBuffer_tracker(const char *_loc) : loc(_loc) {}
+  explicit Empty_MIOBuffer_tracker(const char *_loc) : loc(_loc) {}
   MIOBuffer *
   operator()(int64_t size_index = default_large_iobuffer_size)
   {
@@ -1431,7 +1433,7 @@ class IOBufferBlock_tracker
   const char *loc;
 
 public:
-  IOBufferBlock_tracker(const char *_loc) : loc(_loc) {}
+  explicit IOBufferBlock_tracker(const char *_loc) : loc(_loc) {}
   IOBufferBlock *
   operator()()
   {
@@ -1477,7 +1479,7 @@ class IOBufferData_tracker
   const char *loc;
 
 public:
-  IOBufferData_tracker(const char *_loc) : loc(_loc) {}
+  explicit IOBufferData_tracker(const char *_loc) : loc(_loc) {}
   IOBufferData *
   operator()(int64_t size_index = default_large_iobuffer_size, AllocType type = DEFAULT_ALLOC)
   {