Cumulative changes required to enable / ease compilation in Linux with gcc. (PR #861)

Split MouseInterface to isolate DirectInput code.
Avoid overflow in platforms where RAND_MAX is a big integer constant.
Fix include files for gcc (where enums cannot be forward declared).
This commit is contained in:
Andrea
2020-11-10 20:33:55 +00:00
committed by GitHub
parent 3d8acbbc83
commit 8cc04e2b86
18 changed files with 317 additions and 239 deletions

View File

@@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "DiskImage.h"
#include "DiskImageHelper.h"
#include "Log.h"
#include "Card.h"
#include "Memory.h"
ImageInfo::ImageInfo()
@@ -1089,7 +1090,7 @@ public:
BYTE n = 0;
for (UINT j = 0; j < 8; j++)
{
if (rand() < ((RAND_MAX * 3) / 10)) // ~30% of buffer are 1 bits
if (rand() < RAND_THRESHOLD(3, 10)) // ~30% of buffer are 1 bits
n |= 1 << j;
}
m_pWOZEmptyTrack[i] = n;