Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused function and missing prototype warnings #628

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/brogue/IO.c
Original file line number Diff line number Diff line change
Expand Up @@ -2237,6 +2237,7 @@ static void displayWaypoints() {
}
}
temporaryMessage("Waypoints:", REQUIRE_ACKNOWLEDGMENT);
displayLevel();
}

static void displayMachines() {
Expand Down Expand Up @@ -2270,14 +2271,14 @@ static void displayMachines() {
}
}
}
displayMoreSign();
temporaryMessage("Machines:", REQUIRE_ACKNOWLEDGMENT);
displayLevel();

restoreRNG;
}

#define CHOKEMAP_DISPLAY_CUTOFF 160
void displayChokeMap() {
static void displayChokeMap() {
short i, j;
color foreColor, backColor;
enum displayGlyph dchar;
Expand All @@ -2298,11 +2299,11 @@ void displayChokeMap() {
}
}
}
displayMoreSign();
temporaryMessage("Choke map:", REQUIRE_ACKNOWLEDGMENT);
displayLevel();
}

void displayLoops() {
static void displayLoops() {
short i, j;
color foreColor, backColor;
enum displayGlyph dchar;
Expand All @@ -2322,7 +2323,8 @@ void displayLoops() {
}
}
}
waitForAcknowledgment();
temporaryMessage("Loops:", REQUIRE_ACKNOWLEDGMENT);
displayLevel();
}

static void exploreKey(const boolean controlKey) {
Expand Down Expand Up @@ -2686,10 +2688,14 @@ void executeKeystroke(signed long keystroke, boolean controlKey, boolean shiftKe
copyDisplayBuffer(dbuf, displayBuffer);
funkyFade(dbuf, &white, 0, 100, mapToWindowX(player.loc.x), mapToWindowY(player.loc.y), false);
}*/
// DEBUG displayLoops();
// DEBUG displayChokeMap();
DEBUG displayLoops();
DEBUG displayChokeMap();
DEBUG displayMachines();
//DEBUG displayWaypoints();
DEBUG displayWaypoints();

#ifdef LOG_LIGHTS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation looks a little off here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the indentation on the logLights() line. Having no indentation for the preprocessor directives seems standard though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume @tmewett means he prefers the new indentation, rather than wanting no indentation?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that I agree it's typical for preprocessor directives to have no indentation - diff as-is looks good to me

logLights();
#endif
// DEBUG {displayGrid(safetyMap); displayMoreSign(); displayLevel();}
// parseFile();
// DEBUG spawnDungeonFeature(player.loc.x, player.loc.y, &dungeonFeatureCatalog[DF_METHANE_GAS_ARMAGEDDON], true, false);
Expand Down
2 changes: 1 addition & 1 deletion src/brogue/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -6831,7 +6831,7 @@ static void magicMapCell(short x, short y) {
}
}

boolean uncurse( item *theItem ) {
static boolean uncurse( item *theItem ) {
if (theItem->flags & ITEM_CURSED) {
theItem->flags &= ~ITEM_CURSED;
return true;
Expand Down
3 changes: 1 addition & 2 deletions src/brogue/Light.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include "GlobalsBase.h"
#include "Globals.h"

static void logLights() {

void logLights() {
short i, j;

printf(" ");
Expand Down
11 changes: 8 additions & 3 deletions src/brogue/Rogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
#define D_MESSAGE_ITEM_GENERATION (rogue.wizard && 0)
#define D_MESSAGE_MACHINE_GENERATION (rogue.wizard && 0)

// If enabled, runs a benchmark for the performance of repeatedly updating the screen at the start of the game.
// #define SCREEN_UPDATE_BENCHMARK

// If enabled, logs the light values when '~' is pressed.
// #define LOG_LIGHTS

// set to false to allow multiple loads from the same saved file:
#define DELETE_SAVE_FILE_AFTER_LOADING true

Expand Down Expand Up @@ -2870,7 +2876,7 @@ extern "C" {
boolean superpriority);
boolean spawnDungeonFeature(short x, short y, dungeonFeature *feat, boolean refreshCell, boolean abortIfBlocking);
void restoreMonster(creature *monst, short **mapToStairs, short **mapToPit);
void restoreItems();
void restoreItems(void);
void refreshWaypoint(short wpIndex);
void setUpWaypoints(void);
void zeroOutGrid(char grid[DCOLS][DROWS]);
Expand Down Expand Up @@ -2969,8 +2975,6 @@ extern "C" {
const char *promptSuffix,
short textEntryType,
boolean useDialogBox);
void displayChokeMap(void);
void displayLoops(void);
boolean pauseBrogue(short milliseconds);
boolean pauseAnimation(short milliseconds);
void nextBrogueEvent(rogueEvent *returnEvent, boolean textInput, boolean colorsDance, boolean realInputEvenInPlayback);
Expand Down Expand Up @@ -3337,6 +3341,7 @@ extern "C" {
void displayCombatText(void);
void flashMonster(creature *monst, const color *theColor, short strength);

void logLights(void);
boolean paintLight(const lightSource *theLight, short x, short y, boolean isMinersLight, boolean maintainShadows);
void backUpLighting(short lights[DCOLS][DROWS][3]);
void restoreLighting(short lights[DCOLS][DROWS][3]);
Expand Down
10 changes: 7 additions & 3 deletions src/brogue/RogueMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ boolean openFile(const char *path) {
return retval;
}

static void benchmark() {
#ifdef SCREEN_UPDATE_BENCHMARK
static void screen_update_benchmark() {
short i, j, k;
const color sparklesauce = {10, 0, 20, 60, 40, 100, 30, true};
enum displayGlyph theChar;
Expand All @@ -127,8 +128,9 @@ static void benchmark() {
}
pauseBrogue(1);
}
printf("\n\nBenchmark took a total of %lu seconds.", ((unsigned long) time(NULL)) - initialTime);
printf("\n\nBenchmark took a total of %lu seconds.\n", ((unsigned long) time(NULL)) - initialTime);
}
#endif

static void welcome() {
char buf[DCOLS*3], buf2[DCOLS*3];
Expand Down Expand Up @@ -206,7 +208,9 @@ void initializeRogue(uint64_t seed) {
previousGameSeed = rogue.seed;
}

//benchmark();
#ifdef SCREEN_UPDATE_BENCHMARK
screen_update_benchmark();
#endif

initRecording();

Expand Down