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

Add resetNashSolver() to the public API #3

Merged
merged 3 commits into from
Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions lrsnashlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,4 +1118,7 @@ void updateFwidth(game *g, int col, int pos, char *str) {
((gInfo *)g->aux)->fwidth[col][pos] = len;
}

// Definition of extern variable declared in the .h
long FirstTime;

/******************** end of lrsnashlib.c ***************************/
2 changes: 1 addition & 1 deletion lrsnashlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void initFwidth(game *g);
void updateFwidth(game *g, int col, int pos, char *str);


long FirstTime; /* set this to true for every new game to be solved */
extern long FirstTime; /* set this to true for every new game to be solved */

Choose a reason for hiding this comment

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

Why defining it here at all?

Copy link
Author

Choose a reason for hiding this comment

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

My reading of the standard is that every variable must be defined exactly once, and an extern declaration is not a definition.

Copy link

@giordano giordano Apr 20, 2021

Choose a reason for hiding this comment

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

So you can remove this line 🙂

Copy link
Author

Choose a reason for hiding this comment

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

then the variable would have internal linkage

static long Debug_flag;
static long Verbose_flag;