From: Mischa POSLAWSKY Date: Tue, 27 Feb 2007 11:30:06 +0000 (+0100) Subject: remove reference comments after functions X-Git-Url: http://git.shiar.net/netris.git/commitdiff_plain/647a237119ca10b9c3039c157594599e7ff50411 remove reference comments after functions --- diff --git a/board.c b/board.c index 7946d57..8f03ff3 100644 --- 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 @@ -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 diff --git a/curses.c b/curses.c index e7f18c4..6363d26 100644 --- a/curses.c +++ b/curses.c @@ -127,14 +127,14 @@ void InitScreens(void) for (i = 0; i= 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 430bd0e..e0a8cda 100644 --- 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 8f1f453..236a73e 100644 --- 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 diff --git a/server.c b/server.c index 11c42e3..bcf3f04 100644 --- 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 306c197..94a87f3 100644 --- a/util.c +++ b/util.c @@ -59,7 +59,7 @@ void Header(void) "NETRIS %s\t(c) 1994-1996,1999 Mark H. Weaver \n" " \t(c) 2002 Shiar \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