Commit 4a2a0c4e authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Change constexpr inline functions to just constexpr.

They are explicitly inline. Fix some lint errors along the way.

Change-Id: I94b8ea7ed7ab2025163d92f06db220f889094cb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315223Reviewed-by: default avatarFlorin Malita <fmalita@chromium.org>
Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791504}
parent 750b10be
......@@ -27,7 +27,7 @@ namespace bits {
// Returns true iff |value| is a power of 2.
template <typename T,
typename = typename std::enable_if<std::is_integral<T>::value>>
constexpr inline bool IsPowerOfTwo(T value) {
constexpr bool IsPowerOfTwo(T value) {
// From "Hacker's Delight": Section 2.1 Manipulating Rightmost Bits.
//
// Only positive integers with a single bit set are powers of two. If only one
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_BASE_NTLM_CONSTANTS_H_
#define NET_BASE_NTLM_CONSTANTS_H_
#ifndef NET_NTLM_NTLM_CONSTANTS_H_
#define NET_NTLM_NTLM_CONSTANTS_H_
#include <stddef.h>
#include <stdint.h>
......@@ -66,16 +66,14 @@ enum class NegotiateFlags : uint32_t {
kTargetInfo = 0x800000,
};
constexpr inline NegotiateFlags operator|(NegotiateFlags lhs,
NegotiateFlags rhs) {
constexpr NegotiateFlags operator|(NegotiateFlags lhs, NegotiateFlags rhs) {
using TFlagsInt = std::underlying_type<NegotiateFlags>::type;
return static_cast<NegotiateFlags>(static_cast<TFlagsInt>(lhs) |
static_cast<TFlagsInt>(rhs));
}
constexpr inline NegotiateFlags operator&(NegotiateFlags lhs,
NegotiateFlags rhs) {
constexpr NegotiateFlags operator&(NegotiateFlags lhs, NegotiateFlags rhs) {
using TFlagsInt = std::underlying_type<NegotiateFlags>::type;
return static_cast<NegotiateFlags>(static_cast<TFlagsInt>(lhs) &
......@@ -101,14 +99,14 @@ enum class TargetInfoAvFlags : uint32_t {
using TAvFlagsInt = std::underlying_type<TargetInfoAvFlags>::type;
constexpr inline TargetInfoAvFlags operator|(TargetInfoAvFlags lhs,
TargetInfoAvFlags rhs) {
constexpr TargetInfoAvFlags operator|(TargetInfoAvFlags lhs,
TargetInfoAvFlags rhs) {
return static_cast<TargetInfoAvFlags>(static_cast<TAvFlagsInt>(lhs) |
static_cast<TAvFlagsInt>(rhs));
}
constexpr inline TargetInfoAvFlags operator&(TargetInfoAvFlags lhs,
TargetInfoAvFlags rhs) {
constexpr TargetInfoAvFlags operator&(TargetInfoAvFlags lhs,
TargetInfoAvFlags rhs) {
return static_cast<TargetInfoAvFlags>(static_cast<TAvFlagsInt>(lhs) &
static_cast<TAvFlagsInt>(rhs));
}
......@@ -187,4 +185,4 @@ static constexpr NegotiateFlags kNegotiateMessageFlags =
} // namespace ntlm
} // namespace net
#endif // NET_BASE_NTLM_CONSTANTS_H_
#endif // NET_NTLM_NTLM_CONSTANTS_H_
......@@ -164,15 +164,15 @@ constexpr bool operator!=(const LayoutPoint& a, const LayoutPoint& b) {
return !(a == b);
}
constexpr inline LayoutPoint ToPoint(const LayoutSize& size) {
constexpr LayoutPoint ToPoint(const LayoutSize& size) {
return LayoutPoint(size.Width(), size.Height());
}
constexpr inline LayoutPoint ToLayoutPoint(const LayoutSize& p) {
constexpr LayoutPoint ToLayoutPoint(const LayoutSize& p) {
return LayoutPoint(p.Width(), p.Height());
}
constexpr inline LayoutSize ToSize(const LayoutPoint& a) {
constexpr LayoutSize ToSize(const LayoutPoint& a) {
return LayoutSize(a.X(), a.Y());
}
......
......@@ -86,7 +86,7 @@ ALWAYS_INLINE int GetMinSaturatedSetResultForTesting() {
// TODO(thakis): Remove these two lines once http://llvm.org/PR26504 is resolved
class PLATFORM_EXPORT LayoutUnit;
constexpr inline bool operator<(const LayoutUnit&, const LayoutUnit&);
constexpr bool operator<(const LayoutUnit&, const LayoutUnit&);
class LayoutUnit {
DISALLOW_NEW();
......@@ -588,11 +588,11 @@ inline LayoutUnit operator+(const IntegerType a, const LayoutUnit& b) {
return LayoutUnit(a) + b;
}
constexpr inline float operator+(const float a, const LayoutUnit& b) {
constexpr float operator+(const float a, const LayoutUnit& b) {
return a + b.ToFloat();
}
constexpr inline double operator+(const double a, const LayoutUnit& b) {
constexpr double operator+(const double a, const LayoutUnit& b) {
return a + b.ToDouble();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment