X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=32addcc96738cf86cf0e76a0c1008d1d022e46cd;hb=eac70dd1506787967e790af36b5ab29676ad4fd7;hp=cd2e98cf78d1cb0b0581eb7a304ed8944bcdfdd9;hpb=1787d72dbd0f3ff703050df00dc6ebb5eebe14d7;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index cd2e98c..32addcc 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -4072,6 +4072,26 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) * \*---------------------------------------------------------------------------*/ +/* + * Decent random number generator, at least not as bad as Windows + * standard rand, which returns a value in the range 0 to 0x7fff. + */ +unsigned int randstate; + +int +myrandom(void) +{ + randstate = randstate * 1664525 + 1013904223; + return (int) randstate & 0x7fffffff; +} + +void +mysrandom(unsigned int seed) +{ + randstate = seed; +} + + /* * returns TRUE if user selects a different color, FALSE otherwise */ @@ -6334,11 +6354,9 @@ DisplayMessage(char *str1, char *str2) VOID DisplayError(char *str, int error) { - FARPROC lpProc; char buf[MSG_SIZ*2], buf2[MSG_SIZ]; int len; - char *p, *q; - + if (error == 0) { strcpy(buf, str); } else {