diff options
author | mark a. foltz <mfoltz@chromium.org> | 2020-05-28 11:42:36 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-28 23:35:55 +0000 |
commit | b4e53be8a002064d2a140d5f73c4568454d299e0 (patch) | |
tree | 4aac3910cb1b195dedaf2899294ff9815584f3ec /util | |
parent | 8cce349b0a595ddf7178d5730e980ace3a1d1a53 (diff) | |
download | openscreen-b4e53be8a002064d2a140d5f73c4568454d299e0.tar.gz |
[Open Screen] Fix lint errors.
This fixes a number of lint errors in the codebase flagged by cpplint.py.
It also turns off a couple of checks:
1. The header check is too restrictive
2. The whitespace/braces check doesn't fully grok initializer list syntax.
Bug: b/156101497
Change-Id: I11caefdc14fa1c5891022357bee35595673c4341
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2219135
Reviewed-by: Ryan Keane <rwkeane@google.com>
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/big_endian.cc | 2 | ||||
-rw-r--r-- | util/big_endian.h | 2 | ||||
-rw-r--r-- | util/crypto/secure_hash.h | 2 | ||||
-rw-r--r-- | util/weak_ptr.h | 3 |
4 files changed, 5 insertions, 4 deletions
diff --git a/util/big_endian.cc b/util/big_endian.cc index d5658900..59992d60 100644 --- a/util/big_endian.cc +++ b/util/big_endian.cc @@ -30,4 +30,4 @@ bool BigEndianWriter::Write(const void* buffer, size_t length) { return false; } -} // namespace openscreen
\ No newline at end of file +} // namespace openscreen diff --git a/util/big_endian.h b/util/big_endian.h index b2067d75..0953ddf0 100644 --- a/util/big_endian.h +++ b/util/big_endian.h @@ -150,7 +150,7 @@ class BigEndianBuffer { public: class Cursor { public: - Cursor(BigEndianBuffer* buffer) + explicit Cursor(BigEndianBuffer* buffer) : buffer_(buffer), origin_(buffer_->current_) {} Cursor(const Cursor& other) = delete; Cursor(Cursor&& other) = delete; diff --git a/util/crypto/secure_hash.h b/util/crypto/secure_hash.h index 7c007f96..f748cc45 100644 --- a/util/crypto/secure_hash.h +++ b/util/crypto/secure_hash.h @@ -21,7 +21,7 @@ namespace openscreen { // same as if we have the full input in advance. class SecureHash { public: - SecureHash(const EVP_MD* type); + explicit SecureHash(const EVP_MD* type); SecureHash(const SecureHash& other); SecureHash(SecureHash&& other); SecureHash& operator=(const SecureHash& other); diff --git a/util/weak_ptr.h b/util/weak_ptr.h index cb6967a1..c941017d 100644 --- a/util/weak_ptr.h +++ b/util/weak_ptr.h @@ -6,6 +6,7 @@ #define UTIL_WEAK_PTR_H_ #include <memory> +#include <utility> #include "util/osp_logging.h" @@ -92,7 +93,7 @@ class WeakPtr { } // Create/Assign from nullptr. - WeakPtr(std::nullptr_t) {} + WeakPtr(std::nullptr_t) {} // NOLINT WeakPtr& operator=(std::nullptr_t) { impl_.reset(); |