summaryrefslogtreecommitdiffstats
path: root/js/src/vm
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-09-19 18:59:49 -0500
committertrav90 <travawine@palemoon.org>2018-09-19 18:59:49 -0500
commit33cd07bcee1268be688a9080cbc96007f06a91f5 (patch)
tree51fd98a35bdfda06b79f74d6cf1ca5b4b1d9fda2 /js/src/vm
parent4f89ce5af980776cdf6900280c0fcf52c70e84c1 (diff)
downloadUXP-33cd07bcee1268be688a9080cbc96007f06a91f5.tar
UXP-33cd07bcee1268be688a9080cbc96007f06a91f5.tar.gz
UXP-33cd07bcee1268be688a9080cbc96007f06a91f5.tar.lz
UXP-33cd07bcee1268be688a9080cbc96007f06a91f5.tar.xz
UXP-33cd07bcee1268be688a9080cbc96007f06a91f5.zip
Give uint8_clamped a defaulted (and also trivial) default constructor, copy constructor, and copy-assignment operator.
This also allows uint8_clamped to be permissibly memmove'd and memcpy'd.
Diffstat (limited to 'js/src/vm')
-rw-r--r--js/src/vm/ArrayBufferObject.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/js/src/vm/ArrayBufferObject.h b/js/src/vm/ArrayBufferObject.h
index 6614f5220..e9c9bc0e0 100644
--- a/js/src/vm/ArrayBufferObject.h
+++ b/js/src/vm/ArrayBufferObject.h
@@ -457,8 +457,8 @@ ClampDoubleToUint8(const double x);
struct uint8_clamped {
uint8_t val;
- uint8_clamped() { }
- uint8_clamped(const uint8_clamped& other) : val(other.val) { }
+ uint8_clamped() = default;
+ uint8_clamped(const uint8_clamped& other) = default;
// invoke our assignment helpers for constructor conversion
explicit uint8_clamped(uint8_t x) { *this = x; }
@@ -469,10 +469,7 @@ struct uint8_clamped {
explicit uint8_clamped(int32_t x) { *this = x; }
explicit uint8_clamped(double x) { *this = x; }
- uint8_clamped& operator=(const uint8_clamped& x) {
- val = x.val;
- return *this;
- }
+ uint8_clamped& operator=(const uint8_clamped& x) = default;
uint8_clamped& operator=(uint8_t x) {
val = x;