remove reference comments after functions
authorMischa POSLAWSKY <netris@shiar.org>
Tue, 27 Feb 2007 11:30:06 +0000 (12:30 +0100)
committerMischa POSLAWSKY <netris@shiar.org>
Tue, 27 Feb 2007 11:30:06 +0000 (12:30 +0100)
board.c
curses.c
game.c
inet.c
server.c
util.c

diff --git a/board.c b/board.c
index 7946d571fc82ce14212f4505eb4ed4939c72963c..8f03ff3c31f18d3fbbd45cfc7d655f21e13e4b84 100644 (file)
--- a/board.c
+++ b/board.c
@@ -132,7 +132,7 @@ void ClearField(int scr)
                for (x = 0; x < Players[scr].boardWidth; ++x) {
                        oldBoard[scr][y][x] = board[scr][y][x] = BT_none;
                }
-} //ClearField
+}
 
 unsigned char GetBlock(int scr, int y, int x)
 { //Returns the block on field at position (x,y)
@@ -142,7 +142,7 @@ unsigned char GetBlock(int scr, int y, int x)
                return BT_none;
        else
                return board[scr][y][x];
-} //GetBlock
+}
 
 void SetBlock(int scr, int y, int x, unsigned char type)
 {
@@ -151,7 +151,7 @@ void SetBlock(int scr, int y, int x, unsigned char type)
                board[scr][y][x] = type;
                changed[scr][y] |= 1 << x;
        }
-} //SetBlock
+}
 
 int RefreshBoard(int scr)
 { //draw changes to screen
@@ -169,19 +169,19 @@ int RefreshBoard(int scr)
                        any = 1;
                } //changed row
        return any;
-} //RefreshBoard
+}
 
 int GlanceFunc(int scr, int y, int x, unsigned char type)
 {
        PlotBlockXY(y, x, type);
        return 0;
-} //GlanceFunc
+}
 
 int ShadowFunc(int scr, int y, int x, unsigned char type)
 { //draw shadow
        SetBlock(scr, y, x, BT_shadow);
        return 0;
-} //ShadowFunc
+}
 
 int PlotFunc(int scr, int y, int x, unsigned char type)
 {
@@ -197,7 +197,7 @@ void PlotShape(char shape, int scr, int y, int x, int shadow)
                ShapeIterate(shape, scr, shadowy + 1, x, ShadowFunc);
        } //draw shadow
        ShapeIterate(shape, scr, y, x, PlotFunc);
-} //PlotShape
+}
 
 int EraseFunc(int scr, int y, int x, unsigned char type)
 {
@@ -209,7 +209,7 @@ void EraseShape(char shape, int scr, int y, int x, int shadow)
        ShapeIterate(shape, scr, y, x, EraseFunc);
        if (shadow && scr == me) //draw shadow
                ShapeIterate(shape, scr, shadowy + 1, x, EraseFunc);
-} //EraseShape
+}
 
 int CollisionFunc(int scr, int y, int x, unsigned char type)
 {
@@ -218,7 +218,7 @@ int CollisionFunc(int scr, int y, int x, unsigned char type)
 int ShapeFits(char shape, int scr, int y, int x)
 { //check if there's nothing in the way
        return !ShapeIterate(shape, scr, y, x, CollisionFunc);
-} //ShapeFits
+}
 
 int VisibleFunc(int scr, int y, int x, unsigned char type)
 {
@@ -228,7 +228,7 @@ int VisibleFunc(int scr, int y, int x, unsigned char type)
 int ShapeVisible(char shape, int scr, int y, int x)
 {
        return ShapeIterate(shape, scr, y, x, VisibleFunc);
-} //ShapeVisible
+}
 
 int MovePiece(int scr, int deltaY, int deltaX)
 {
@@ -245,7 +245,7 @@ int MovePiece(int scr, int deltaY, int deltaX)
        PlotShape(Players[scr].curShape, scr, Players[scr].curY, Players[scr].curX,
                scr == me);
        return result;
-} //MovePiece
+}
 
 int RotatePiece(int scr, int dir)
 {
@@ -270,7 +270,7 @@ int RotatePiece(int scr, int dir)
        PlotShape(Players[scr].curShape, scr,
                Players[scr].curY, Players[scr].curX, scr == me);
        return result;
-} //RotatePiece
+}
 
 int DropPiece(int scr)
 {
@@ -286,7 +286,7 @@ int DropPiece(int scr)
        PlotShape(Players[scr].curShape, scr,
                Players[scr].curY, Players[scr].curX, 0);
        return count;
-} //DropPiece
+}
 
 int BlockFree(int scr, int x, int y, unsigned char z)
 { //Check if blocks are empty below block (x,y) and sticking to (x,y) mask <z>
@@ -398,7 +398,7 @@ void InsertJunk(int scr, int color, int count, int column)
                else break;
        PlotShape(Players[scr].curShape, scr, Players[scr].curY, Players[scr].curX,
                scr == me);
-} //InoertJunk
+}
 
 /*
  * vi: ts=4 ai
index e7f18c44ba3edce4c7822b0f9f0636fa2198a0ff..6363d2674d8899e5b6c0cf52a79d550adc86cf85 100644 (file)
--- a/curses.c
+++ b/curses.c
@@ -127,14 +127,14 @@ void InitScreens(void)
                for (i = 0; i<MSG_HEIGHT; i++)
                        message[i] = messages[i];  //set pointers
        }
-} //InitScreens
+}
 
 void CleanupScreens(void)
 {
        RemoveEventGen(&keyGen);
        endwin();                      //end curses
        OutputTermStr(term_ve, 1);
-} //CleanupScreens
+}
 
 void GetTermcapInfo(void)
 {
@@ -191,7 +191,7 @@ void GetTermcapInfo(void)
        }
        if (!term_vi || !term_ve)
                term_vi = term_ve = NULL;
-} //GetTermcapInfo
+}
 
 void OutputTermStr(char *str, int flush)
 {
@@ -199,7 +199,7 @@ void OutputTermStr(char *str, int flush)
                fputs(str, stdout);
                if (flush) fflush(stdout);
        }
-} //OutputTermStr
+}
 
 void DrawTitle(void)
 {
@@ -220,7 +220,7 @@ void DrawTitle(void)
        else memcpy(&s[cols], "\0", 1);
        mvaddstr(0, 0, s);
        standend();     //normal text
-} //DrawTitle
+}
 
 void DrawBox(int x1, int y1, int x2, int y2)
 { //draw grid
@@ -240,7 +240,7 @@ void DrawBox(int x1, int y1, int x2, int y2)
        for (x = x1 + 1; x < x2; x++)
                addch(Sets.ascii ? '-' : ACS_HLINE);
        addch(Sets.ascii ? '+' : ACS_LRCORNER);
-} //DrawBox
+}
 
 void DrawField(int scr)
 { //draw field for player scr
@@ -269,7 +269,7 @@ void DrawField(int scr)
        } //draw field
 
        ShowPause(scr);
-} //DrawField
+}
 
 void InitFields(void)
 { //calculate positions of all fields
@@ -335,7 +335,7 @@ void InitFields(void)
        }
        for (scr = 1; scr <= maxPlayer; scr++)
                DrawField(scr);
-} //InitFields
+}
 
 void CleanupScreen(int scr)
 {
@@ -360,7 +360,7 @@ void DisplayMessage(char *p)
        waddstr(msgwin, p);
        if (haveColor) wstandend(msgwin);
        waddch(msgwin, '\n');
-} //DisplayMessage
+}
 
 void Message(char *fmt, ...)
 { //print game/bot message
@@ -383,7 +383,7 @@ void Message(char *fmt, ...)
        DisplayMessage(s);
        wclrtoeol(msgwin);
        wrefresh(msgwin);
-} //Message
+}
 
 void Messagetype(char c, int x, char *s)
 { //show single typed character
@@ -399,7 +399,7 @@ void Messagetype(char c, int x, char *s)
                mvwaddch(msgwin, messageHeight - 1, (x+1) % (messageWidth-1), '_');
        } //typing mode
        wrefresh(msgwin);
-} //Messagetype
+}
 
 void PlotBlock1(int y, int x, unsigned char type)
 { //display block on screen
@@ -472,7 +472,7 @@ void PlotBlock1(int y, int x, unsigned char type)
                if (Sets.standout) standend();
 #endif
        } //display one brick
-} //PlotBlock1
+}
 void PlotBlock1S(int y, int x, unsigned char type)
 { //display block small
        move(y, x);
@@ -496,7 +496,7 @@ void PlotBlock1S(int y, int x, unsigned char type)
                if (Sets.standout) standend();
 #endif
        } //display one brick
-} //PlotBlock1S
+}
 void PlotBlock(int scr, int y, int x, unsigned char type)
 {
        if (y >= 0 && y < Players[scr].boardVisible &&
@@ -506,11 +506,11 @@ void PlotBlock(int scr, int y, int x, unsigned char type)
                else
                        PlotBlock1S(boardYPos[scr] - y, boardXPos[scr] + x, type);
        } //on screen
-} //PlotBlock
+}
 void PlotBlockXY(int y, int x, unsigned char type)
 { //Draw block at specified position on screen (not on field)
        PlotBlock1(20 - y, 2 * x, type);
-} //PlotBlock
+}
 
 void ShowScore(int scr, struct _Score score)
 { //show score stuff
@@ -537,7 +537,7 @@ void ShowScore(int scr, struct _Score score)
                for (i = 7; i <= 10; i++)
                        mvaddstr(i, statusXPos, "             ");
        } //too early to display stats, remove old..
-} //ShowScore
+}
 
 void FieldMessage(int playa, char *message)
 { //put a message over playa's field
@@ -563,7 +563,7 @@ void FieldMessage(int playa, char *message)
                for (x = 0; x <= Players[playa].boardWidth; x++)
                        PlotBlock(playa, y, x, GetBlock(playa, y, x));
        } //restore field
-} //FieldMessage
+}
 
 void ShowPause(int playa)
 { //put paused over player's field
@@ -584,18 +584,18 @@ void ShowPause(int playa)
                        boardSize[playa] > 1 ? "G A M E  O V E R" : "GAME  OVER");
        else
                FieldMessage(playa, boardSize[playa] > 1 ? "E M P T Y" : "EMPTY");
-} //ShowPause
+}
 
 
 void ShowTime(void)
 { //display timer
        mvprintw(statusYPos, statusXPos, "timer %7.0f ", CurTimeval() / 1e6);
-} //ShowTime
+}
 
 void ScheduleFullRedraw(void)
 {
        touchwin(stdscr);
-} //ScheduleFullRedraw
+}
 
 void CatchWinCh(int sig)
 { //handle window resize
@@ -603,7 +603,7 @@ void CatchWinCh(int sig)
        refresh();    //and reinit display (with different sizes)
        InitFields();  //manually redraw everything
        refresh();    //refresh
-} //CatchWinCh
+}
 
 static MyEventType KeyGenFunc(EventGenRec *gen, MyEvent *event)
 { //read keypresses
@@ -611,7 +611,7 @@ static MyEventType KeyGenFunc(EventGenRec *gen, MyEvent *event)
                return E_key;
        else
                return E_none;
-} //KeyGenFunc
+}
 
 /*
  * vi: ts=4 ai
diff --git a/game.c b/game.c
index 430bd0ec4db12bf5995b0a5d5512c059df59d4d6..e0a8cdad5e7fbd8976e1dabaed6547a06936981a 100644 (file)
--- a/game.c
+++ b/game.c
@@ -102,7 +102,7 @@ void MapKeys(char *newKeys)
        }
        if (errs)
                exit(1);
-} //MapKeys
+}
 
 void WriteConf(void)
 {
@@ -116,7 +116,7 @@ void WriteConf(void)
 
        fclose(file_out);
        fprintf(stderr, "Wrote new game configuration to %s\n", CONFIG_FILE);
-} //WriteConf
+}
 
 void HandleOption(char tag, char *value)
 {
@@ -170,7 +170,7 @@ void HandleOption(char tag, char *value)
                default:
                        Usage(); exit(1);
        }
-} //HandleParam
+}
 
 void ReadConf(char *filename)
 {
@@ -204,7 +204,7 @@ void ReadConf(char *filename)
                fprintf(stderr, "Unable to open config file %s.\n", filename);
        } //defaults
 
-} //ReadConf
+}
 
 int StartNewPiece(int scr, char shape)
 {
@@ -234,7 +234,7 @@ void checkPaused(void)
        for (i = 1; i < MAX_SCREENS; i++) if (Players[i].alive > 0)
                paused |= Players[i].flags & SCF_paused;
        if (paused) paused = 1;
-} //checkPaused
+}
 
 void StartGame(void)
 { //init new game
@@ -257,7 +257,7 @@ void StartGame(void)
                ClearField(i);
        } //reset all players
        InitFields();
-} //StartGame
+}
 
 void CheckClears(int scr)
 { //check for full lines
@@ -302,7 +302,7 @@ void CheckClears(int scr)
                        } //singleplayer
                } //IT'S YOU
        } //lines cleared
-} //CheckClears
+}
 
 void OneGame(void)
 {
diff --git a/inet.c b/inet.c
index 8f1f4538dd739ca2cea9f80e2bf38d845c914fad..236a73edb627479cfca606d5d7800608639d9eeb 100644 (file)
--- a/inet.c
+++ b/inet.c
@@ -46,7 +46,7 @@ static sigjmp_buf close_env;
 void CatchInt(int sig)
 {
        siglongjmp(close_env, 1);
-} //CatchInt
+}
 
 int InitiateConnection(char *hostStr, short port)
 { //connect to host
@@ -77,7 +77,7 @@ int InitiateConnection(char *hostStr, short port)
        }
        AddEventGen(&netGen);
        return 0;
-} //InitiateConnection
+}
 
 void HandShake(void)
 { //talk to your host
@@ -140,7 +140,7 @@ void HandShake(void)
                        fatal("Hm, the party apparantly ended prematurely.");
        }
        while (event.u.net.type != NP_gamedata);
-} //HandShake
+}
 
 
 MyEventType NetGenFunc(EventGenRec *gen, MyEvent *event)
@@ -175,7 +175,7 @@ MyEventType NetGenFunc(EventGenRec *gen, MyEvent *event)
        event->u.net.data = gen->buf + HEADER_SIZE3;
        if (type == NP_endConn) return E_lostConn;
        return E_net;
-} //NetGenFunc
+}
 
 void SendPacket(short uid, NetPacketType type, int size, void *data)
 { //send shit to server
@@ -188,7 +188,7 @@ void SendPacket(short uid, NetPacketType type, int size, void *data)
                die("write (header)");
        if (size > 0 && data && MyWrite(netGen.fd, data, size) != size)
                die("write");
-} //SendPacket
+}
 
 void CloseNet(void)
 { //kick some connection's ass!
@@ -201,7 +201,7 @@ void CloseNet(void)
        }
        if (netGen.next)
                RemoveEventGen(&netGen);
-} //CloseNet
+}
 
 /*
  * vi: ts=4 ai
index 11c42e31a2e733d1c8e890934db1b83625bcf62e..bcf3f04ece98235ebeb6cd63ac765c03b8408323 100644 (file)
--- a/server.c
+++ b/server.c
@@ -91,12 +91,12 @@ void SendPacketTo(short playa, short uid, NetPacketType type, int size, void *da
                if (size > 0 && data && MyWrite(netGen[playa].fd, data, size) != size)
                        die("write");
        }
-} //SendPacketTo
+}
 
 static MyEventType AlarmGenFunc(EventGenRec *gen, MyEvent *event)
 {
        return E_alarm;
-} //AlarmGenFunc
+}
 
 void SCloseNet(short playa)
 { //kick some connection's ass!
@@ -112,7 +112,7 @@ void SCloseNet(short playa)
        }
        if (netGen[playa].next)
                RemoveEventGen(&netGen[playa]);
-} //SCloseNet
+}
 
 void CloseNets(void)
 { //nou oogjes dicht en snaveltjes toe
@@ -122,7 +122,7 @@ void CloseNets(void)
        for (i = 1; i < MAX_SCREENS; i++)
                SCloseNet(i); //bye everybuddy
        fprintf(stderr, "* All Done\n\n");
-} //CloseNets
+}
 
 MyEventType NetGenFunc(EventGenRec *gen, MyEvent *event)
 { //receive
@@ -158,7 +158,7 @@ MyEventType NetGenFunc(EventGenRec *gen, MyEvent *event)
                return E_lostConn;
        } //client sent quit signal
        return E_net;
-} //NetGenFunc
+}
 
 
 static MyEventType ConnGenFunc(EventGenRec *gen, MyEvent *event)
@@ -197,7 +197,7 @@ static MyEventType ConnGenFunc(EventGenRec *gen, MyEvent *event)
                                }
                        } //E_connect
        return E_connect;
-} //ConnGenFunc
+}
 
 void CountPlayers(void)
 { //count number of players/teams
@@ -211,7 +211,7 @@ void CountPlayers(void)
                        } //player of same team counted before
                playercount++;
        } //player alive
-} //CountPlayers
+}
 
 int StartServer(void)
 {
@@ -418,7 +418,7 @@ int StartServer(void)
                } //game (ready to) start(ed)
        } while (1);
        fprintf(stderr, "* Exiting server\n");
-} //StartServer
+}
 
 
 void SHeader(void)
@@ -461,7 +461,7 @@ void WriteConf(void)
 
        fclose(file_out);
        fprintf(stderr, "Wrote new game configuration to %s\n", CONFIG_FILE);
-} //WriteConf
+}
 
 void HandleOption(char tag, char *value)
 {
@@ -500,7 +500,7 @@ void HandleOption(char tag, char *value)
                default:
                        break;
        }
-} //HandleParam
+}
 
 void ReadConf(char *filename)
 {
@@ -535,7 +535,7 @@ void ReadConf(char *filename)
                fprintf(stderr, "Unable to open config file %s.\n", filename);
        } //defaults
 
-} //ReadConf
+}
 
 void CatchInt(int sig)
 {
diff --git a/util.c b/util.c
index 306c197c8afee5799f70dffbacd6d2555e00e307..94a87f36305367dcb3f2727ba30aec51c7d7fbfd 100644 (file)
--- a/util.c
+++ b/util.c
@@ -59,7 +59,7 @@ void Header(void)
                "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
+}
 
 void Usage(void)
 {
@@ -106,7 +106,7 @@ void DistInfo(void)
                "along with this program; if not, write to the Free Software\n"
                "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n"
                "\n");
-} //DistInfo
+}
 
 void Rules(void)
 {
@@ -130,7 +130,7 @@ void Rules(void)
                "\n"
                "The longest surviving player wins the game.\n"
                "\n");
-} //Rules
+}
 
 ///////////// RANDOM /////////////
 
@@ -142,13 +142,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 +167,7 @@ int MyRead(int fd, void *data, int len)
                        return result;
        }
        return len;
-} //MyRead
+}
 
 int MyWrite(int fd, void *data, int len)
 {
@@ -184,7 +184,7 @@ int MyWrite(int fd, void *data, int len)
                        return result;
        }
        return len;
-} //MyWrite
+}
 
 ///////////// TIME /////////////
 
@@ -213,12 +213,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 +226,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 +249,7 @@ long CurTimeval(void)
 
        gettimeofday(&tv, NULL);
        return GetTimeval(&tv) - baseTimeval;
-} //CurTimeval
+}
 
 static long SetITimer1(long interval, long value)
 {
@@ -285,7 +285,7 @@ volatile void fatal(char *msg)
 {
        fprintf(stderr, "%s\n", msg);
        exit(1);
-} //fatal
+}
 
 void BlockSignals(MySigSet *saved, ...)
 {
@@ -312,7 +312,7 @@ void BlockSignals(MySigSet *saved, ...)
        *saved = sigblock(set);
 #endif
        va_end(args);
-} //BlockSignals
+}
 
 void RestoreSignals(MySigSet *saved, MySigSet *set)
 {
@@ -324,7 +324,7 @@ void RestoreSignals(MySigSet *saved, MySigSet *set)
        else
                sigsetmask(*set);
 #endif
-} //RestoreSignals
+}
 
 ///////////// EVENTS /////////////
 
@@ -333,7 +333,7 @@ void AddEventGen(EventGenRec *gen)
        assert(gen->next == NULL);
        gen->next = nextGen->next;
        nextGen->next = gen;
-} //AddEventGen
+}
 
 void RemoveEventGen(EventGenRec *gen)
 {
@@ -344,7 +344,7 @@ void RemoveEventGen(EventGenRec *gen)
                nextGen->next = gen->next;
                gen->next = NULL;
        }
-} //RemoveEventGen
+}
 
 MyEventType WaitMyEvent(MyEvent *event, int mask)
 { //poll
@@ -398,7 +398,7 @@ MyEventType WaitMyEvent(MyEvent *event, int mask)
                } while (gen != nextGen);
                retry = 1;
        }
-} //WaitMyEvent
+}
 
 /*
  * vi: ts=4 ai