From 2896b2cc5046b04877ffc3d51da584c11b09721d Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Wed, 5 Aug 2020 12:59:02 +0000 Subject: Turn off lint for test marco definitions we can actually use clang-tidy to cleanup our code. --- document/src/vespa/document/base/globalid.h | 6 +++--- document/src/vespa/document/bucket/bucketid.h | 8 ++++---- document/src/vespa/document/test/make_bucket_space.cpp | 4 ++-- document/src/vespa/document/test/make_bucket_space.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'document') diff --git a/document/src/vespa/document/base/globalid.h b/document/src/vespa/document/base/globalid.h index 16781145bf0..7e49b1b22cb 100644 --- a/document/src/vespa/document/base/globalid.h +++ b/document/src/vespa/document/base/globalid.h @@ -77,7 +77,7 @@ public: /** * Constructs a new global id with all 0 bits. */ - GlobalId() { set("\0\0\0\0\0\0\0\0\0\0\0\0"); } + GlobalId() noexcept { set("\0\0\0\0\0\0\0\0\0\0\0\0"); } @@ -87,7 +87,7 @@ public: * * @param gid The address to the data to copy. */ - explicit GlobalId(const void *gid) { set(gid); } + explicit GlobalId(const void *gid) noexcept { set(gid); } GlobalId(const GlobalId &rhs) = default; @@ -130,7 +130,7 @@ public: * * @param id The bytes to set. */ - void set(const void *id) { memcpy(_gid._buffer, id, sizeof(_gid._buffer)); } + void set(const void *id) noexcept { memcpy(_gid._buffer, id, sizeof(_gid._buffer)); } /** * Returns the raw byte array that constitutes this global id. diff --git a/document/src/vespa/document/bucket/bucketid.h b/document/src/vespa/document/bucket/bucketid.h index 0f8e3f23f7d..b31f9080acc 100644 --- a/document/src/vespa/document/bucket/bucketid.h +++ b/document/src/vespa/document/bucket/bucketid.h @@ -49,11 +49,11 @@ public: using Type = uint64_t; using List = bucket::BucketIdList; /** Create an initially unset bucket id. */ - BucketId() : _id(0) {} + BucketId() noexcept : _id(0) {} /** Create a bucket id with the given raw unchecked content. */ - explicit BucketId(Type id) : _id(id) {} + explicit BucketId(Type id) noexcept : _id(id) {} /** Create a bucket id using a set of bits from a raw unchecked value. */ - BucketId(uint32_t useBits, Type id) : _id(createUsedBits(useBits, id)) { } + BucketId(uint32_t useBits, Type id) noexcept : _id(createUsedBits(useBits, id)) { } bool operator<(const BucketId& id) const { return getId() < id.getId(); @@ -175,7 +175,7 @@ private: return _stripMasks[getUsedBits()]; } - static Type createUsedBits(uint32_t used, Type id) { + static Type createUsedBits(uint32_t used, Type id) noexcept { uint32_t availBits = maxNumBits; Type usedCount(used); usedCount <<= availBits; diff --git a/document/src/vespa/document/test/make_bucket_space.cpp b/document/src/vespa/document/test/make_bucket_space.cpp index bafda79ee66..631c33da6d0 100644 --- a/document/src/vespa/document/test/make_bucket_space.cpp +++ b/document/src/vespa/document/test/make_bucket_space.cpp @@ -4,12 +4,12 @@ namespace document::test { -BucketSpace makeBucketSpace() +BucketSpace makeBucketSpace() noexcept { return BucketSpace(1); } -BucketSpace makeBucketSpace(const vespalib::string &docTypeName) +BucketSpace makeBucketSpace(const vespalib::string &docTypeName) noexcept { // Used by persistence conformance test to map from document type name // to bucket space. See document::TestDocRepo for known document types. diff --git a/document/src/vespa/document/test/make_bucket_space.h b/document/src/vespa/document/test/make_bucket_space.h index 8b17eaea1ac..efcd8007954 100644 --- a/document/src/vespa/document/test/make_bucket_space.h +++ b/document/src/vespa/document/test/make_bucket_space.h @@ -8,7 +8,7 @@ namespace document::test { // Helper functions used by unit tests -BucketSpace makeBucketSpace(); -BucketSpace makeBucketSpace(const vespalib::string &docTypeName); +BucketSpace makeBucketSpace() noexcept; +BucketSpace makeBucketSpace(const vespalib::string &docTypeName) noexcept; } -- cgit v1.2.3