Fix some little compiler warings with MSVS
[xboard.git] / winboard / winboard.c
index cd2e98c..32addcc 100644 (file)
@@ -4072,6 +4072,26 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  *\r
 \*---------------------------------------------------------------------------*/\r
 \r
+/*\r
+ * Decent random number generator, at least not as bad as Windows\r
+ * standard rand, which returns a value in the range 0 to 0x7fff.\r
+ */\r
+unsigned int randstate;\r
+\r
+int\r
+myrandom(void)\r
+{\r
+  randstate = randstate * 1664525 + 1013904223;\r
+  return (int) randstate & 0x7fffffff;\r
+}\r
+\r
+void\r
+mysrandom(unsigned int seed)\r
+{\r
+  randstate = seed;\r
+}\r
+\r
+\r
 /* \r
  * returns TRUE if user selects a different color, FALSE otherwise \r
  */\r
@@ -6334,11 +6354,9 @@ DisplayMessage(char *str1, char *str2)
 VOID\r
 DisplayError(char *str, int error)\r
 {\r
-  FARPROC lpProc;\r
   char buf[MSG_SIZ*2], buf2[MSG_SIZ];\r
   int len;\r
-  char *p, *q;\r
-\r
\r
   if (error == 0) {\r
     strcpy(buf, str);\r
   } else {\r