changes newest versions to oldest
[netris.git] / util.c
diff --git a/util.c b/util.c
index 306c197c8afee5799f70dffbacd6d2555e00e307..a667a5bd0cdb8cc0d674ed5ead0cef39b97bbfe9 100644 (file)
--- a/util.c
+++ b/util.c
@@ -15,8 +15,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: util.c,v 1.29 1999/05/16 06:56:33 mhw Exp $
  */
 
 #include "netris.h"
@@ -33,8 +31,9 @@
 #include "util.h"
 
 static MyEventType AlarmGenFunc(EventGenRec *gen, MyEvent *event);
-static EventGenRec alarmGen =
-       { &alarmGen, 0, FT_read, -1, AlarmGenFunc, EM_alarm };
+static EventGenRec alarmGen = {
+       &alarmGen, 0, FT_read, -1, AlarmGenFunc, EM_alarm
+};
 static EventGenRec *nextGen = &alarmGen;
 
 static int myRandSeed = 1;
@@ -58,8 +57,9 @@ void Header(void)
        fprintf(stderr,
                "NETRIS %s\t(c) 1994-1996,1999 Mark H. Weaver <mhw@netris.org>\n"
                "          \t(c) 2002 Shiar <shiar@shiar.org>\n\n",
-               version_string);
-} //Header
+               version_string
+       );
+}
 
 void Usage(void)
 {
@@ -86,7 +86,8 @@ void Usage(void)
                "\n"
                "  -r, --robot <cmd>\tExecute program to control the game instead of keyboard\n"
                "  -F, --fair-robot\tUse fair robot interface\n"
-               "\n", DEFAULT_PORT, DEFAULT_KEYS);
+               "\n", DEFAULT_PORT, DEFAULT_KEYS
+       );
 }
 
 void DistInfo(void)
@@ -105,8 +106,9 @@ void DistInfo(void)
                "You should have received a copy of the GNU General Public License\n"
                "along with this program; if not, write to the Free Software\n"
                "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n"
-               "\n");
-} //DistInfo
+               "\n"
+       );
+}
 
 void Rules(void)
 {
@@ -129,8 +131,9 @@ void Rules(void)
                "multiple rows.\n"
                "\n"
                "The longest surviving player wins the game.\n"
-               "\n");
-} //Rules
+               "\n"
+       );
+}
 
 ///////////// RANDOM /////////////
 
@@ -142,13 +145,13 @@ void SRandom(int seed)
 {
        Game.seed = seed;
        myRandSeed = seed % 31751 + 1;
-} //SRandom
+}
 
 int Random(int min, int max1)
 { //return a random value
        myRandSeed = (myRandSeed * 31751 + 15437) % 32767;
        return myRandSeed % (max1 - min) + min;
-} //Random
+}
 
 ///////////// I/O /////////////
 
@@ -167,7 +170,7 @@ int MyRead(int fd, void *data, int len)
                        return result;
        }
        return len;
-} //MyRead
+}
 
 int MyWrite(int fd, void *data, int len)
 {
@@ -184,7 +187,7 @@ int MyWrite(int fd, void *data, int len)
                        return result;
        }
        return len;
-} //MyWrite
+}
 
 ///////////// TIME /////////////
 
@@ -213,12 +216,12 @@ void SetTimeval(struct timeval *tv, long usec)
 {
        tv->tv_sec = usec / 1000000;
        tv->tv_usec = usec % 1000000;
-} //SetTimeval
+}
 
 long GetTimeval(struct timeval *tv)
 {
        return tv->tv_sec * 1000000 + tv->tv_usec;
-} //GetTimeval
+}
 
 long AbsTimeval(void)
 {
@@ -226,22 +229,22 @@ long AbsTimeval(void)
 
        gettimeofday(&tv, NULL);
        return GetTimeval(&tv);
-} //CurTimeval
+}
 
 void ResetBaseTime(void)
 { //Reset the timer
        baseTimeval = AbsTimeval();
-} //ResetBaseTime
+}
 
 void PauseTime(void)
 { //Pause the timer
        baseTimeval -= AbsTimeval();
-} //PauseTime
+}
 
 void ResumeTime(void)
 { //Unpause timer
        baseTimeval += AbsTimeval();
-} //ResumeTime
+}
 
 long CurTimeval(void)
 {
@@ -249,7 +252,7 @@ long CurTimeval(void)
 
        gettimeofday(&tv, NULL);
        return GetTimeval(&tv) - baseTimeval;
-} //CurTimeval
+}
 
 static long SetITimer1(long interval, long value)
 {
@@ -285,7 +288,7 @@ volatile void fatal(char *msg)
 {
        fprintf(stderr, "%s\n", msg);
        exit(1);
-} //fatal
+}
 
 void BlockSignals(MySigSet *saved, ...)
 {
@@ -312,7 +315,7 @@ void BlockSignals(MySigSet *saved, ...)
        *saved = sigblock(set);
 #endif
        va_end(args);
-} //BlockSignals
+}
 
 void RestoreSignals(MySigSet *saved, MySigSet *set)
 {
@@ -324,7 +327,7 @@ void RestoreSignals(MySigSet *saved, MySigSet *set)
        else
                sigsetmask(*set);
 #endif
-} //RestoreSignals
+}
 
 ///////////// EVENTS /////////////
 
@@ -333,7 +336,7 @@ void AddEventGen(EventGenRec *gen)
        assert(gen->next == NULL);
        gen->next = nextGen->next;
        nextGen->next = gen;
-} //AddEventGen
+}
 
 void RemoveEventGen(EventGenRec *gen)
 {
@@ -344,7 +347,7 @@ void RemoveEventGen(EventGenRec *gen)
                nextGen->next = gen->next;
                gen->next = NULL;
        }
-} //RemoveEventGen
+}
 
 MyEventType WaitMyEvent(MyEvent *event, int mask)
 { //poll
@@ -398,9 +401,5 @@ MyEventType WaitMyEvent(MyEvent *event, int mask)
                } while (gen != nextGen);
                retry = 1;
        }
-} //WaitMyEvent
+}
 
-/*
- * vi: ts=4 ai
- * vim: noai si
- */