mirror of
https://github.com/Michaelangel007/apple2gs_shr_converter.git
synced 2025-02-20 02:28:57 +00:00
Fix random() stdlib conflict in a2fcbmp.c
This commit is contained in:
parent
4885124b7c
commit
14b6605701
@ -1222,7 +1222,7 @@ unsigned char dlomaincolor[16] = {
|
|||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
/* http://stackoverflow.com/questions/7602919/how-do-i-generate-random-numbers-without-rand-function */
|
/* http://stackoverflow.com/questions/7602919/how-do-i-generate-random-numbers-without-rand-function */
|
||||||
ushort RandomSeed = (ushort)0xACE1;
|
ushort RandomSeed = (ushort)0xACE1;
|
||||||
ushort random()
|
ushort my_random()
|
||||||
{
|
{
|
||||||
ushort bit = ((RandomSeed >> 0) ^ (RandomSeed >> 2) ^ (RandomSeed >> 3) ^ (RandomSeed >> 5) ) & 1;
|
ushort bit = ((RandomSeed >> 0) ^ (RandomSeed >> 2) ^ (RandomSeed >> 3) ^ (RandomSeed >> 5) ) & 1;
|
||||||
|
|
||||||
@ -1243,7 +1243,7 @@ int RandomRange(int iMaxValue)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
/* get random number */
|
/* get random number */
|
||||||
iRetVal = (int)random();
|
iRetVal = (int)my_random();
|
||||||
/* get a positive value */
|
/* get a positive value */
|
||||||
if (iRetVal < 0) iRetVal *= -1;
|
if (iRetVal < 0) iRetVal *= -1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user