From 822249304ccc00fd27d82808cc3b9e490c73ca2d Mon Sep 17 00:00:00 2001 From: Kp Date: Wed, 2 Aug 2017 02:49:13 +0000 Subject: [PATCH] Remove useless unaligned write Little endian systems stored sound as a `uint32_t`, but sent only the lowest byte. Store only that byte, since the destination was unaligned and was the last field in the message. --- similar/main/multi.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/similar/main/multi.cpp b/similar/main/multi.cpp index b40fcf12b..efb7a45aa 100644 --- a/similar/main/multi.cpp +++ b/similar/main/multi.cpp @@ -3960,14 +3960,7 @@ void multi_send_sound_function (char whichfunc, char sound) count++; multibuf[1]=Player_num; count++; multibuf[2]=whichfunc; count++; - if (!words_bigendian) - { - *reinterpret_cast(multibuf+count)=sound; count++; - } - else - { multibuf[3] = sound; count++; // this would probably work on the PC as well. Jason? - } multi_send_data(multibuf,4,2); }