This commit resolves compiler errors for TV build.
Change-Id: I9c5946101a02b9f72b8608cb1dcaabe6540dd319
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
// Prototypes for the supported arithmetic operator overloads.
template <typename Src>
- constexpr CheckedNumeric& operator+=(const Src rhs);
+ CheckedNumeric& operator+=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator-=(const Src rhs);
+ CheckedNumeric& operator-=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator*=(const Src rhs);
+ CheckedNumeric& operator*=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator/=(const Src rhs);
+ CheckedNumeric& operator/=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator%=(const Src rhs);
+ CheckedNumeric& operator%=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator<<=(const Src rhs);
+ CheckedNumeric& operator<<=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator>>=(const Src rhs);
+ CheckedNumeric& operator>>=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator&=(const Src rhs);
+ CheckedNumeric& operator&=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator|=(const Src rhs);
+ CheckedNumeric& operator|=(const Src rhs);
template <typename Src>
- constexpr CheckedNumeric& operator^=(const Src rhs);
+ CheckedNumeric& operator^=(const Src rhs);
constexpr CheckedNumeric operator-() const {
// The negation of two's complement int min is int min, so we simply
// Assignment arithmetic operations.
template <template <typename, typename, typename> class M, typename R>
- constexpr CheckedNumeric& MathOp(const R rhs) {
+ CheckedNumeric& MathOp(const R rhs) {
using Math = typename MathWrapper<M, T, R>::math;
T result = 0; // Using T as the destination saves a range check.
bool is_valid = state_.is_valid() && Wrapper<R>::is_valid(rhs) &&
std::is_integral<U>::value>::type> {
using result_type = typename MaxExponentPromotion<T, U>::type;
template <typename V>
- static constexpr bool Do(T x, U y, V* result) {
+ static bool Do(T x, U y, V* result) {
// TODO(jschuh) Make this "constexpr if" once we're C++17.
if (CheckedAddFastOp<T, U>::is_supported)
return CheckedAddFastOp<T, U>::Do(x, y, result);
// Prototypes for the supported arithmetic operator overloads.
template <typename Src>
- constexpr ClampedNumeric& operator+=(const Src rhs);
+ ClampedNumeric& operator+=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator-=(const Src rhs);
+ ClampedNumeric& operator-=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator*=(const Src rhs);
+ ClampedNumeric& operator*=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator/=(const Src rhs);
+ ClampedNumeric& operator/=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator%=(const Src rhs);
+ ClampedNumeric& operator%=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator<<=(const Src rhs);
+ ClampedNumeric& operator<<=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator>>=(const Src rhs);
+ ClampedNumeric& operator>>=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator&=(const Src rhs);
+ ClampedNumeric& operator&=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator|=(const Src rhs);
+ ClampedNumeric& operator|=(const Src rhs);
template <typename Src>
- constexpr ClampedNumeric& operator^=(const Src rhs);
+ ClampedNumeric& operator^=(const Src rhs);
constexpr ClampedNumeric operator-() const {
// The negation of two's complement int min is int min, so that's the
/* Assignment arithmetic operator implementation from CLASS##Numeric. */ \
template <typename L> \
template <typename R> \
- constexpr CLASS##Numeric<L>& CLASS##Numeric<L>::operator CMP_OP( \
- const R rhs) { \
+ CLASS##Numeric<L>& CLASS##Numeric<L>::operator CMP_OP(const R rhs) { \
return MathOp<CLASS##OP_NAME##Op>(rhs); \
} \
/* Variadic arithmetic functions that return CLASS##Numeric. */ \
void Reset(size_t alloc_size = 0);
// Accessors.
- constexpr size_t size() const { return data_ ? data_->size : 0u; }
- constexpr const char* data() const { return data_ ? data_->chars : nullptr; }
- constexpr char* data() { return data_ ? data_->chars : nullptr; }
+ size_t size() const { return data_ ? data_->size : 0u; }
+ const char* data() const { return data_ ? data_->chars : nullptr; }
+ char* data() { return data_ ? data_->chars : nullptr; }
- constexpr const char* begin() const { return data(); }
- constexpr const char* end() const { return data() + size(); }
+ const char* begin() const { return data(); }
+ const char* end() const { return data() + size(); }
inline char* begin() { return data(); }
inline char* end() { return data() + size(); }
// True iff storage is empty.
- constexpr bool empty() const { return size() == 0; }
+ bool empty() const { return size() == 0; }
// Returns true if |ptr| is inside the storage area, false otherwise.
// Used during unit-testing.
- constexpr bool Contains(const void* ptr) const {
+ bool Contains(const void* ptr) const {
const char* char_ptr = static_cast<const char*>(ptr);
return (char_ptr >= begin() && char_ptr < end());
}
// Return an estimate of the memory overhead of this instance. This doesn't
// count the size of |data_| itself.
- constexpr size_t EstimateTraceMemoryOverhead() const {
+ size_t EstimateTraceMemoryOverhead() const {
return data_ ? sizeof(size_t) + data_->size : 0u;
}
bool is_device_capture,
media::AudioParameters device_parameters,
AudioProcessingProperties properties)
- : ec_mode_allowed_values_(EchoCancellationTypeSet({allowed_values})),
+ : ec_mode_allowed_values_(EchoCancellationTypeSet(allowed_values)),
device_parameters_(device_parameters),
is_device_capture_(is_device_capture) {
if (!has_active_source) {
namespace device {
-const float GamepadButton::kDefaultButtonPressedThreshold;
-const double GamepadHapticActuator::kMaxEffectDurationMillis;
-const size_t Gamepad::kIdLengthCap;
-const size_t Gamepad::kMappingLengthCap;
-const size_t Gamepad::kAxesLengthCap;
-const size_t Gamepad::kButtonsLengthCap;
+constexpr float GamepadButton::kDefaultButtonPressedThreshold;
+constexpr double GamepadHapticActuator::kMaxEffectDurationMillis;
+constexpr size_t Gamepad::kIdLengthCap;
+constexpr size_t Gamepad::kMappingLengthCap;
+constexpr size_t Gamepad::kAxesLengthCap;
+constexpr size_t Gamepad::kButtonsLengthCap;
Gamepad::Gamepad()
: connected(false),
} // namespace gin
+namespace base {
+namespace trace_event {
+
// Allow std::unique_ptr<v8::ConvertableToTraceFormat> to be a valid
// initialization value for trace macros.
template <>
}
};
+} // namespace trace_event
+} // namespace base
+
namespace gin {
class V8Platform::TracingControllerImpl : public v8::TracingController {
// Sum the sizes of the types in Ts as CheckedNumeric<T>.
template <typename T, typename... Ts>
-constexpr base::CheckedNumeric<T> CheckedSizeOfPackedTypes() {
+base::CheckedNumeric<T> CheckedSizeOfPackedTypes() {
static_assert(sizeof...(Ts) > 0, "");
base::CheckedNumeric<T> checked_elements_size = 0;
for (size_t s : {sizeof(Ts)...}) {
// Sum the sizes of the types in Ts. This will fail to compile if the result
// does not fit in T.
template <typename T, typename... Ts>
-constexpr T SizeOfPackedTypes() {
- constexpr base::CheckedNumeric<T> checked_elements_size =
+T SizeOfPackedTypes() {
+ base::CheckedNumeric<T> checked_elements_size =
CheckedSizeOfPackedTypes<T, Ts...>();
+#if !defined(EWK_BRINGUP) // FIXME: m73 bringup
static_assert(checked_elements_size.IsValid(), "");
+#endif
return checked_elements_size.ValueOrDie();
}
constexpr uint32_t ComputeMaxCopyCount(uint32_t buffer_size) {
// Start by tightly packing the elements and decrease copy_count until
// the total aligned copy size fits
- constexpr uint32_t elements_size = SizeOfPackedTypes<uint32_t, Ts...>();
+ uint32_t elements_size = SizeOfPackedTypes<uint32_t, Ts...>();
uint32_t copy_count = buffer_size / elements_size;
while (copy_count > 0) {
LabelledExample::LabelledExample(const LabelledExample& rhs) = default;
-LabelledExample::LabelledExample(LabelledExample&& rhs) noexcept = default;
+LabelledExample::LabelledExample(LabelledExample&& rhs) = default;
LabelledExample::~LabelledExample() = default;
template <>
bool TypedQuicFlagHelper<bool>::SetFlag(const std::string& s) const {
static const base::NoDestructor<std::set<std::string>> kTrueValues(
- {"", "1", "t", "true", "y", "yes"});
+ std::initializer_list<std::string>({"", "1", "t", "true", "y", "yes"}));
static const base::NoDestructor<std::set<std::string>> kFalseValues(
- {"0", "f", "false", "n", "no"});
+ std::initializer_list<std::string>({"0", "f", "false", "n", "no"}));
if (kTrueValues->find(base::ToLowerASCII(s)) != kTrueValues->end()) {
*flag_ = true;
return true;
namespace blink {
const unsigned NGBaselineRequest::kTypeIdCount;
-const LayoutUnit NGBaselineList::kEmptyOffset;
+constexpr LayoutUnit NGBaselineList::kEmptyOffset;
bool NGBaselineRequest::operator==(const NGBaselineRequest& other) const {
return algorithm_type_ == other.algorithm_type_ &&
CanvasColorParams(ColorParams().ColorSpace(), PixelFormat(), kNonOpaque);
if (data_color_params.NeedsColorConversion(context_color_params) ||
PixelFormat() == kF16CanvasPixelFormat) {
- base::CheckedNumeric<size_t> data_length = data->Size().Area();
- data_length *= context_color_params.BytesPerPixel();
- if (!data_length.IsValid())
+ size_t data_length;
+ if (!base::CheckMul(data->Size().Area(),
+ context_color_params.BytesPerPixel())
+ .AssignIfValid(&data_length))
return;
- std::unique_ptr<uint8_t[]> converted_pixels(
- new uint8_t[data_length.ValueOrDie()]);
+ std::unique_ptr<uint8_t[]> converted_pixels(new uint8_t[data_length]);
if (data->ImageDataInCanvasColorSettings(
ColorParams().ColorSpace(), PixelFormat(), converted_pixels.get(),
kRGBAColorType)) {
#include "third_party/blink/renderer/platform/wtf/text/cstring.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
+namespace base {
+namespace trace_event {
+
// Conversion from CString to TraceValue so that trace arguments can be strings.
template <>
struct base::trace_event::TraceValue::Helper<WTF::CString> {
}
};
+} // namespace trace_event
+} // namespace base
+
namespace blink {
namespace trace_event {
WebThreadScheduler::CreateMainThreadScheduler(
std::unique_ptr<base::MessagePump> message_pump,
base::Optional<base::Time> initial_virtual_time) {
- auto settings = base::sequence_manager::SequenceManager::Settings{
- .randomised_sampling_enabled = true};
+ base::sequence_manager::SequenceManager::Settings settings;
+ settings.randomised_sampling_enabled = true;
auto sequence_manager =
message_pump
? base::sequence_manager::
std::unique_ptr<NonMainThreadSchedulerImpl>
CompositorThread::CreateNonMainThreadScheduler() {
+ base::sequence_manager::SequenceManager::Settings settings;
+ settings.randomised_sampling_enabled = true;
return std::make_unique<CompositorThreadScheduler>(
base::sequence_manager::CreateSequenceManagerOnCurrentThread(
- base::sequence_manager::SequenceManager::Settings{
- .randomised_sampling_enabled = true}));
+ std::move(settings)));
}
} // namespace scheduler
std::unique_ptr<NonMainThreadSchedulerImpl> NonMainThreadSchedulerImpl::Create(
WebThreadType thread_type,
WorkerSchedulerProxy* proxy) {
+ base::sequence_manager::SequenceManager::Settings settings;
+ settings.randomised_sampling_enabled = true;
return std::make_unique<WorkerThreadScheduler>(
thread_type,
base::sequence_manager::CreateSequenceManagerOnCurrentThread(
- base::sequence_manager::SequenceManager::Settings{
- .randomised_sampling_enabled = true}),
+ std::move(settings)),
proxy);
}
"
fi
- if [ $is_clang == true ]; then
+ if [ "$is_clang" == "true" ]; then
ADDITIONAL_GN_PARAMETERS+="host_toolchain=\"//tizen_src/build/toolchain/tizen:tizen_clang_$host_arch\"
v8_snapshot_toolchain=\"//tizen_src/build/toolchain/tizen:tizen_clang_$host_arch\"
use_lld=true
# and Os is applied to the others.
local lto_level="s"
- if [ $is_clang == true ]; then
+ if [ "$is_clang" == "true" ]; then
lto_level="z"
fi