From 4955214eb1f342e14dbd581bcf5432ba954a2496 Mon Sep 17 00:00:00 2001 From: Emman Mensdorf Date: Thu, 8 Feb 2024 18:44:34 +0100 Subject: [PATCH] Bauernumwandlung.c warnings entfernt, Emman Mensdorf --- src/Bauernumwandlung.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Bauernumwandlung.c b/src/Bauernumwandlung.c index a93aa14..f06454e 100644 --- a/src/Bauernumwandlung.c +++ b/src/Bauernumwandlung.c @@ -40,26 +40,26 @@ char* bauer_umwandel_abfrage(char** Brett, int startX, int startY, int endX, int if(player == PLAYER_WHITE){ printf("Q for Queen, R for Rook, B for Bishop, or N for Knight"); //Figur = getUserInput(); - Figur = 'Q'; + Figur = "Q"; }else{ printf("q for Queen, r for Rook, b for Bishop, or n for Knight"); //Figur = getUserInput(); - Figur = 'q'; + Figur = "q"; } - if ((player == PLAYER_WHITE && (Figur == 'Q' || Figur == 'R' || Figur == 'B' || Figur == 'N')) || - (player == PLAYER_BLACK && (Figur == 'q' || Figur == 'r' || Figur == 'b' || Figur == 'n'))) { + if ((player == PLAYER_WHITE && (*Figur == 'Q' || *Figur == 'R' || *Figur == 'B' || *Figur == 'N')) || + (player == PLAYER_BLACK && (*Figur == 'q' || *Figur == 'r' || *Figur == 'b' || *Figur == 'n'))) { return Figur; } else { - return 'W'; // Undefiniertes Zeichen als Fehlerwert + return (char *)'W'; // Undefiniertes Zeichen als Fehlerwert } } void bauer_umwandeln(char** Brett, int startX, int startY, int endX, int endY, Player player) { - char Figur = bauer_umwandel_abfrage(Brett, startX, startY, endX, endY, player); + char* Figur = bauer_umwandel_abfrage(Brett, startX, startY, endX, endY, player); - Brett[endY][endX] = Figur; + Brett[endY][endX] = *Figur; Brett[startY][startX] = ' '; } \ No newline at end of file