• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision90 (tree)
Time2018-05-01 23:18:29
Authorquiret

Log Message

- adjusted endian a little more

Change Summary

Incremental Difference

--- common/sdk/Endian.h (revision 89)
+++ common/sdk/Endian.h (revision 90)
@@ -51,13 +51,10 @@
5151 template <typename numberType>
5252 struct big_endian
5353 {
54+ // Required to be default for POD handling.
5455 inline big_endian( void ) = default;
56+ inline big_endian( const big_endian& right ) = default;
5557
56- inline big_endian( const big_endian& right )
57- {
58- *(numberType*)this->data = *(numberType*)right.data;
59- }
60-
6158 inline big_endian( numberType right )
6259 {
6360 this->operator = ( right );
@@ -89,13 +86,8 @@
8986 return right;
9087 }
9188
92- inline big_endian& operator = ( const big_endian& right )
93- {
94- *(numberType*)this->data = *(numberType*)right.data;
89+ inline big_endian& operator = ( const big_endian& right ) = default;
9590
96- return *this;
97- }
98-
9991 private:
10092 char data[ sizeof(numberType) ];
10193 };
@@ -103,13 +95,10 @@
10395 template <typename numberType>
10496 struct little_endian
10597 {
98+ // Required to be default for POD handling.
10699 inline little_endian( void ) = default;
100+ inline little_endian( const little_endian& right ) = default;
107101
108- inline little_endian( const little_endian& right )
109- {
110- *(numberType*)this->data = *(numberType*)right.data;
111- }
112-
113102 inline little_endian( numberType right )
114103 {
115104 this->operator = ( right );
@@ -141,13 +130,8 @@
141130 return right;
142131 }
143132
144- inline little_endian& operator = ( const little_endian& right )
145- {
146- *(numberType*)this->data = *(numberType*)right.data;
133+ inline little_endian& operator = ( const little_endian& right ) = default;
147134
148- return *this;
149- }
150-
151135 private:
152136 char data[ sizeof(numberType) ];
153137 };
Show on old repository browser