aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-04 13:04:01 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-04 13:04:01 +0200
commit1491f1d9875fde2da7d078fd392ffb3ddbcb7536 (patch)
treea71caa78dcde270268d053e0224a859620420657 /FICS
parent5439ab24268bd92a2fae1cd4bea0616d60a369d8 (diff)
Reformatted functions
Diffstat (limited to 'FICS')
-rw-r--r--FICS/gamedb.c122
1 files changed, 64 insertions, 58 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index f46ad6d..0d7751c 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -590,71 +590,77 @@ PUBLIC char *movesToString(int g, int pgn)
return gameString;
}
-PUBLIC void game_disconnect(int g, int p)
+PUBLIC void
+game_disconnect(int g, int p)
{
- game_ended(g, (garray[g].white == p) ? WHITE : BLACK, END_LOSTCONNECTION);
+ game_ended(g, (garray[g].white == p) ? WHITE : BLACK,
+ END_LOSTCONNECTION);
}
-PUBLIC int CharToPiece(char c)
+PUBLIC int
+CharToPiece(char c)
{
- switch (c) {
- case 'P':return W_PAWN;
- case 'p':
- return B_PAWN;
- case 'N':
- return W_KNIGHT;
- case 'n':
- return B_KNIGHT;
- case 'B':
- return W_BISHOP;
- case 'b':
- return B_BISHOP;
- case 'R':
- return W_ROOK;
- case 'r':
- return B_ROOK;
- case 'Q':
- return W_QUEEN;
- case 'q':
- return B_QUEEN;
- case 'K':
- return W_KING;
- case 'k':
- return B_KING;
- default:
- return NOPIECE;
- }
+ switch (c) {
+ case 'P':
+ return W_PAWN;
+ case 'p':
+ return B_PAWN;
+ case 'N':
+ return W_KNIGHT;
+ case 'n':
+ return B_KNIGHT;
+ case 'B':
+ return W_BISHOP;
+ case 'b':
+ return B_BISHOP;
+ case 'R':
+ return W_ROOK;
+ case 'r':
+ return B_ROOK;
+ case 'Q':
+ return W_QUEEN;
+ case 'q':
+ return B_QUEEN;
+ case 'K':
+ return W_KING;
+ case 'k':
+ return B_KING;
+ default:
+ return NOPIECE;
+ }
}
-PUBLIC int PieceToChar(int piece)
+PUBLIC int
+PieceToChar(int piece)
{
- switch (piece) {
- case W_PAWN:return 'P';
- case B_PAWN:
- return 'p';
- case W_KNIGHT:
- return 'N';
- case B_KNIGHT:
- return 'n';
- case W_BISHOP:
- return 'B';
- case B_BISHOP:
- return 'b';
- case W_ROOK:
- return 'R';
- case B_ROOK:
- return 'r';
- case W_QUEEN:
- return 'Q';
- case B_QUEEN:
- return 'q';
- case W_KING:
- return 'K';
- case B_KING:
- return 'k';
- default:
- return ' ';
- }
+ switch (piece) {
+ case W_PAWN:
+ return 'P';
+ case B_PAWN:
+ return 'p';
+ case W_KNIGHT:
+ return 'N';
+ case B_KNIGHT:
+ return 'n';
+ case W_BISHOP:
+ return 'B';
+ case B_BISHOP:
+ return 'b';
+ case W_ROOK:
+ return 'R';
+ case B_ROOK:
+ return 'r';
+ case W_QUEEN:
+ return 'Q';
+ case B_QUEEN:
+ return 'q';
+ case W_KING:
+ return 'K';
+ case B_KING:
+ return 'k';
+ default:
+ return ' ';
+ }
}
/* One line has everything on it */