@@ -131,6 +131,7 @@ class DMDUTILAPI DMD
131131
132132 void convertToHostByteOrder ()
133133 {
134+ // uint8_t and bool are not converted, as they are already in host byte order.
134135 mode = static_cast <Mode>(ntohl (static_cast <uint32_t >(mode)));
135136 layout = static_cast <AlphaNumericLayout>(ntohl (static_cast <uint32_t >(layout)));
136137 depth = ntohl (depth);
@@ -148,6 +149,7 @@ class DMDUTILAPI DMD
148149
149150 Update toNetworkByteOrder () const
150151 {
152+ // uint8_t and bool are not converted, as they are already in network byte order.
151153 Update copy = *this ;
152154 copy.mode = static_cast <Mode>(htonl (static_cast <uint32_t >(mode)));
153155 copy.layout = static_cast <AlphaNumericLayout>(htonl (static_cast <uint32_t >(layout)));
@@ -179,24 +181,20 @@ class DMDUTILAPI DMD
179181
180182 void convertToHostByteOrder ()
181183 {
182- version = ntohs (version);
184+ // uint8_t and char are not converted, as they are already in host byte order.
183185 mode = static_cast <Mode>(ntohl (static_cast <uint32_t >(mode)));
184186 width = ntohs (width);
185187 height = ntohs (height);
186188 length = ntohl (length);
187- buffered = ntohs (buffered);
188- disconnectOthers = ntohs (disconnectOthers);
189189 }
190190
191191 void convertToNetworkByteOrder ()
192192 {
193- version = htons (version);
193+ // uint8_t and char are not converted, as they are already in network byte order.
194194 mode = static_cast <Mode>(htonl (static_cast <uint32_t >(mode)));
195195 width = htons (width);
196196 height = htons (height);
197197 length = htonl (length);
198- buffered = htons (buffered);
199- disconnectOthers = htons (disconnectOthers);
200198 }
201199 };
202200
0 commit comments