From: Holger Schemel Date: Sat, 22 Oct 2022 10:57:27 +0000 (+0200) Subject: removed unused function parameters X-Git-Tag: 4.3.3.0~34 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=96f2e9a0b1306fa108f3f7e81ad8b8d323ca5517;p=rocksndiamonds.git removed unused function parameters This issue was found by using GCC with option "-Wextra". --- diff --git a/src/editor.c b/src/editor.c index 080c1761..671f6bf9 100644 --- a/src/editor.c +++ b/src/editor.c @@ -9492,7 +9492,7 @@ static void DrawMagicBallContentAreas(void) DrawText(x, y + 2 * tilesize, "active", font_nr); } -static void DrawAndroidElementArea(int element) +static void DrawAndroidElementArea(void) { int id = ED_DRAWING_ID_ANDROID_CONTENT; int num_elements = level.num_android_clone_elements; @@ -9520,7 +9520,7 @@ static void DrawAndroidElementArea(int element) MapDrawingArea(id); } -static void DrawGroupElementArea(int element) +static void DrawGroupElementArea(void) { int id = ED_DRAWING_ID_GROUP_CONTENT; int num_elements = group_element_info.num_elements; @@ -10059,7 +10059,7 @@ static void DrawPropertiesConfig(void) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_BALL_ACTIVE); } else if (properties_element == EL_EMC_ANDROID) - DrawAndroidElementArea(properties_element); + DrawAndroidElementArea(); } if (IS_PLAYER_ELEMENT(properties_element)) @@ -10314,7 +10314,7 @@ static void DrawPropertiesConfig(void) MapTextbuttonGadget(ED_TEXTBUTTON_ID_SAVE_AS_TEMPLATE_1); // draw drawing area gadgets - DrawGroupElementArea(properties_element); + DrawGroupElementArea(); // draw text input gadgets MapTextInputGadget(ED_TEXTINPUT_ID_ELEMENT_NAME); @@ -13313,11 +13313,11 @@ static void HandleCounterButtons(struct GadgetInfo *gi) break; case ED_COUNTER_ID_ANDROID_CONTENT: - DrawAndroidElementArea(properties_element); + DrawAndroidElementArea(); break; case ED_COUNTER_ID_GROUP_CONTENT: - DrawGroupElementArea(properties_element); + DrawGroupElementArea(); CopyGroupElementPropertiesToGame(properties_element); break; diff --git a/src/engines.h b/src/engines.h index fd9a12fe..65a9798f 100644 --- a/src/engines.h +++ b/src/engines.h @@ -36,7 +36,7 @@ int getScreenFieldSizeY(void); void PlayLevelSound_EM(int, int, int, int); void InitGraphicInfo_EM(void); -boolean CheckSingleStepMode_EM(byte[MAX_PLAYERS], int, boolean, boolean, boolean); +boolean CheckSingleStepMode_EM(int, boolean, boolean, boolean); void SetGfxAnimation_EM(struct GraphicInfo_EM *, int, int, int, int); void getGraphicSourceObjectExt_EM(struct GraphicInfo_EM *, int, int, int, int); @@ -49,7 +49,7 @@ void getGraphicSourcePlayerExt_EM(struct GraphicInfo_EM *, int, int, int); void CheckSingleStepMode_SP(boolean, boolean); -void getGraphicSource_SP(struct GraphicInfo_SP *, int, int, int, int); +void getGraphicSource_SP(struct GraphicInfo_SP *, int, int); int getGraphicInfo_Delay(int); boolean isNextAnimationFrame_SP(int, int); diff --git a/src/files.c b/src/files.c index 5d8f6479..5766af03 100644 --- a/src/files.c +++ b/src/files.c @@ -5678,8 +5678,7 @@ static int getMappedElement_DC(int element) return getMappedElement(element); } -static void LoadLevelFromFileStream_DC(File *file, struct LevelInfo *level, - int nr) +static void LoadLevelFromFileStream_DC(File *file, struct LevelInfo *level) { byte header[DC_LEVEL_HEADER_SIZE]; int envelope_size; @@ -5928,7 +5927,7 @@ static void LoadLevelFromFileInfo_DC(struct LevelInfo *level, } } - LoadLevelFromFileStream_DC(file, level, level_file_info->nr); + LoadLevelFromFileStream_DC(file, level); closeFile(file); } diff --git a/src/game.c b/src/game.c index ce032327..d3d7f513 100644 --- a/src/game.c +++ b/src/game.c @@ -5611,7 +5611,7 @@ static void setScreenCenteredToAllPlayers(int *sx, int *sy) *sy = (sy1 + sy2) / 2; } -static void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, +static void DrawRelocateScreen(int old_x, int old_y, int x, int y, boolean center_screen, boolean quick_relocation) { unsigned int frame_delay_value_old = GetVideoFrameDelay(); @@ -5782,7 +5782,7 @@ static void RelocatePlayer(int jx, int jy, int el_player_raw) } // only visually relocate centered player - DrawRelocateScreen(old_jx, old_jy, player->jx, player->jy, player->MovDir, + DrawRelocateScreen(old_jx, old_jy, player->jx, player->jy, FALSE, level.instant_relocation); TestIfPlayerTouchesBadThing(jx, jy); @@ -6421,7 +6421,7 @@ static void ToggleBeltSwitch(int x, int y) } } -static void ToggleSwitchgateSwitch(int x, int y) +static void ToggleSwitchgateSwitch(void) { int xx, yy; @@ -6901,7 +6901,7 @@ static void Impact(int x, int y) smashed == EL_DC_SWITCHGATE_SWITCH_UP || smashed == EL_DC_SWITCHGATE_SWITCH_DOWN) { - ToggleSwitchgateSwitch(x, y + 1); + ToggleSwitchgateSwitch(); } else if (smashed == EL_LIGHT_SWITCH || smashed == EL_LIGHT_SWITCH_ACTIVE) @@ -12083,7 +12083,7 @@ void GameActions_RND(void) game.centered_player_nr = game.centered_player_nr_next; game.set_centered_player = FALSE; - DrawRelocateScreen(0, 0, sx, sy, MV_NONE, TRUE, setup.quick_switch); + DrawRelocateScreen(0, 0, sx, sy, TRUE, setup.quick_switch); DrawGameDoorValues(); } @@ -14702,7 +14702,7 @@ static int DigField(struct PlayerInfo *player, element == EL_DC_SWITCHGATE_SWITCH_UP || element == EL_DC_SWITCHGATE_SWITCH_DOWN) { - ToggleSwitchgateSwitch(x, y); + ToggleSwitchgateSwitch(); } else if (element == EL_LIGHT_SWITCH || element == EL_LIGHT_SWITCH_ACTIVE) @@ -15836,7 +15836,7 @@ static ListNode *SaveEngineSnapshotBuffers(void) if (level.game_engine_type == GAME_ENGINE_TYPE_SP) SaveEngineSnapshotValues_SP(&buffers); if (level.game_engine_type == GAME_ENGINE_TYPE_MM) - SaveEngineSnapshotValues_MM(&buffers); + SaveEngineSnapshotValues_MM(); // save values stored in special snapshot structure diff --git a/src/game_em/game.c b/src/game_em/game.c index cb7a1cbf..a6a06800 100644 --- a/src/game_em/game.c +++ b/src/game_em/game.c @@ -109,7 +109,7 @@ void GameActions_EM(byte action[MAX_PLAYERS]) any_player_dropping = TRUE; boolean single_step_mode_paused = - CheckSingleStepMode_EM(action, frame, game_em.any_player_moving, + CheckSingleStepMode_EM(frame, game_em.any_player_moving, game_em.any_player_snapping, any_player_dropping); // draw wrapping around before going to single step pause mode diff --git a/src/game_mm/export.h b/src/game_mm/export.h index 3e51848e..bb9617a3 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -239,7 +239,7 @@ void BlitScreenToBitmap_MM(Bitmap *); void RedrawPlayfield_MM(void); void LoadEngineSnapshotValues_MM(void); -void SaveEngineSnapshotValues_MM(ListNode **); +void SaveEngineSnapshotValues_MM(void); int getButtonFromTouchPosition(int, int, int, int); diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 093e8373..d4838873 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -436,7 +436,7 @@ static void InitMovDir_MM(int x, int y) } } -static void InitField(int x, int y, boolean init_game) +static void InitField(int x, int y) { int element = Tile[x][y]; @@ -656,7 +656,7 @@ void InitGameEngine_MM(void) Frame[x][y] = 0; Stop[x][y] = FALSE; - InitField(x, y, TRUE); + InitField(x, y); } } @@ -945,7 +945,7 @@ void ScanLaser(void) if (element == EL_EMPTY) { - if (!HitOnlyAnEdge(element, hit_mask)) + if (!HitOnlyAnEdge(hit_mask)) break; } else if (element == EL_FUSE_ON) @@ -1315,7 +1315,7 @@ void DrawLaser_MM(void) boolean HitElement(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (IS_MOVING(ELX, ELY) || IS_BLOCKED(ELX, ELY)) @@ -1638,7 +1638,7 @@ boolean HitElement(int element, int hit_mask) return TRUE; } -boolean HitOnlyAnEdge(int element, int hit_mask) +boolean HitOnlyAnEdge(int hit_mask) { // check if the laser hit only the edge of an element and, if so, go on @@ -1697,7 +1697,7 @@ boolean HitOnlyAnEdge(int element, int hit_mask) boolean HitPolarizer(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (IS_DF_GRID(element)) @@ -1895,7 +1895,7 @@ boolean HitBlock(int element, int hit_mask) boolean HitLaserSource(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING); @@ -1907,7 +1907,7 @@ boolean HitLaserSource(int element, int hit_mask) boolean HitLaserDestination(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (element != EL_EXIT_OPEN && @@ -2143,7 +2143,7 @@ boolean HitReflectingWalls(int element, int hit_mask) } } - if (!HitOnlyAnEdge(element, hit_mask)) + if (!HitOnlyAnEdge(hit_mask)) { laser.overloaded = TRUE; @@ -2155,7 +2155,7 @@ boolean HitReflectingWalls(int element, int hit_mask) boolean HitAbsorbingWalls(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (ABS(XS) == 4 && @@ -2470,7 +2470,7 @@ static void Explode_MM(int x, int y, int phase, int mode) Store[x][y] = Store2[x][y] = 0; MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0; - InitField(x, y, FALSE); + InitField(x, y); DrawField_MM(x, y); } else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) @@ -3056,7 +3056,7 @@ void ColorCycling(void) } } -static void GameActions_MM_Ext(struct MouseActionInfo action) +static void GameActions_MM_Ext(void) { int element; int x, y, i; @@ -3678,7 +3678,7 @@ void GameActions_MM(struct MouseActionInfo action) boolean element_clicked = ClickElement(action.lx, action.ly, action.button); boolean button_released = (action.button == MB_RELEASED); - GameActions_MM_Ext(action); + GameActions_MM_Ext(); CheckSingleStepMode_MM(element_clicked, button_released); } @@ -3962,7 +3962,7 @@ void RaiseScoreElement_MM(int element) // Mirror Magic game engine snapshot handling functions // ---------------------------------------------------------------------------- -void SaveEngineSnapshotValues_MM(ListNode **buffers) +void SaveEngineSnapshotValues_MM(void) { int x, y; diff --git a/src/game_mm/mm_game.h b/src/game_mm/mm_game.h index b223c730..eef79de9 100644 --- a/src/game_mm/mm_game.h +++ b/src/game_mm/mm_game.h @@ -24,7 +24,7 @@ void AddDamagedField(int, int); void ScanLaser(void); void DrawLaser(int, int); boolean HitElement(int, int); -boolean HitOnlyAnEdge(int, int); +boolean HitOnlyAnEdge(int); boolean HitPolarizer(int, int); boolean HitBlock(int, int); boolean HitLaserSource(int, int); diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 9865b930..5d5fc38f 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -40,7 +40,7 @@ void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame) if (graphic < 0) return; - getGraphicSource_SP(&g, graphic, sync_frame, -1, -1); + getGraphicSource_SP(&g, graphic, sync_frame); Blt(pX, pY, g.bitmap, g.src_x, g.src_y); } diff --git a/src/tools.c b/src/tools.c index 627c77c6..9333f9f9 100644 --- a/src/tools.c +++ b/src/tools.c @@ -9308,7 +9308,7 @@ void InitGraphicInfo_EM(void) } } -static void CheckSaveEngineSnapshot_EM(byte action[MAX_PLAYERS], int frame, +static void CheckSaveEngineSnapshot_EM(int frame, boolean any_player_moving, boolean any_player_snapping, boolean any_player_dropping) @@ -9365,7 +9365,7 @@ static void CheckSaveEngineSnapshot_MM(boolean element_clicked, } } -boolean CheckSingleStepMode_EM(byte action[MAX_PLAYERS], int frame, +boolean CheckSingleStepMode_EM(int frame, boolean any_player_moving, boolean any_player_snapping, boolean any_player_dropping) @@ -9374,7 +9374,7 @@ boolean CheckSingleStepMode_EM(byte action[MAX_PLAYERS], int frame, if (frame == 7 && !any_player_dropping && FrameCounter > 6) TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); - CheckSaveEngineSnapshot_EM(action, frame, any_player_moving, + CheckSaveEngineSnapshot_EM(frame, any_player_moving, any_player_snapping, any_player_dropping); return tape.pausing; @@ -9408,7 +9408,7 @@ void CheckSingleStepMode_MM(boolean element_clicked, } void getGraphicSource_SP(struct GraphicInfo_SP *g_sp, - int graphic, int sync_frame, int x, int y) + int graphic, int sync_frame) { int frame = getGraphicAnimationFrame(graphic, sync_frame);