@@ -129,43 +129,8 @@ class DMDUTILAPI DMD
129129 uint16_t width;
130130 uint16_t height;
131131
132- void convertToHostByteOrder ()
133- {
134- // uint8_t and bool are not converted, as they are already in host byte order.
135- mode = static_cast <Mode>(ntohl (static_cast <uint32_t >(mode)));
136- layout = static_cast <AlphaNumericLayout>(ntohl (static_cast <uint32_t >(layout)));
137- depth = ntohl (depth);
138- for (size_t i = 0 ; i < 256 * 64 ; i++)
139- {
140- segData[i] = ntohs (segData[i]);
141- }
142- for (size_t i = 0 ; i < 128 ; i++)
143- {
144- segData2[i] = ntohs (segData2[i]);
145- }
146- width = ntohs (width);
147- height = ntohs (height);
148- }
149-
150- Update toNetworkByteOrder () const
151- {
152- // uint8_t and bool are not converted, as they are already in network byte order.
153- Update copy = *this ;
154- copy.mode = static_cast <Mode>(htonl (static_cast <uint32_t >(mode)));
155- copy.layout = static_cast <AlphaNumericLayout>(htonl (static_cast <uint32_t >(layout)));
156- copy.depth = htonl (depth);
157- for (size_t i = 0 ; i < 256 * 64 ; i++)
158- {
159- copy.segData [i] = htons (segData[i]);
160- }
161- for (size_t i = 0 ; i < 128 ; i++)
162- {
163- copy.segData2 [i] = htons (segData2[i]);
164- }
165- copy.width = htons (width);
166- copy.height = htons (height);
167- return copy;
168- }
132+ void convertToHostByteOrder ();
133+ Update toNetworkByteOrder () const ;
169134 };
170135
171136 struct StreamHeader
@@ -179,23 +144,8 @@ class DMDUTILAPI DMD
179144 uint8_t disconnectOthers = 0 ; // 0 => no, 1 => yes
180145 uint32_t length = 0 ;
181146
182- void convertToHostByteOrder ()
183- {
184- // uint8_t and char are not converted, as they are already in host byte order.
185- mode = static_cast <Mode>(ntohl (static_cast <uint32_t >(mode)));
186- width = ntohs (width);
187- height = ntohs (height);
188- length = ntohl (length);
189- }
190-
191- void convertToNetworkByteOrder ()
192- {
193- // uint8_t and char are not converted, as they are already in network byte order.
194- mode = static_cast <Mode>(htonl (static_cast <uint32_t >(mode)));
195- width = htons (width);
196- height = htons (height);
197- length = htonl (length);
198- }
147+ void convertToHostByteOrder ();
148+ void convertToNetworkByteOrder ();
199149 };
200150
201151 struct PathsHeader
@@ -206,7 +156,6 @@ class DMDUTILAPI DMD
206156 char pupVideosPath[DMDUTIL_MAX_PATH_SIZE] = {0 };
207157
208158 void convertToHostByteOrder () {}
209-
210159 void convertToNetworkByteOrder () {}
211160 };
212161#pragma pack(pop) // Reset to default packing
0 commit comments