Fix typo lockum -> locknum

This commit is contained in:
Bart House
2018-12-25 09:40:30 -08:00
parent 16db7498d0
commit ab73df996f
4 changed files with 31 additions and 31 deletions

View File

@@ -241,7 +241,7 @@ char *argv[];
if (wizard) {
/* use character name rather than lock letter for file names */
g.lockum = 0;
g.locknum = 0;
} else {
/* suppress interrupts while processing lock file */
(void) signal(SIGQUIT, SIG_IGN);
@@ -266,14 +266,14 @@ attempt_restore:
/*
* getlock() complains and quits if there is already a game
* in progress for current character name (when g.lockum == 0)
* or if there are too many active games (when g.lockum > 0).
* in progress for current character name (when g.locknum == 0)
* or if there are too many active games (when g.locknum > 0).
* When proceeding, it creates an empty <lockname>.0 file to
* designate the current game.
* getlock() constructs <lockname> based on the character
* name (for !g.lockum) or on first available of alock, block,
* name (for !g.locknum) or on first available of alock, block,
* clock, &c not currently in use in the playground directory
* (for g.lockum > 0).
* (for g.locknum > 0).
*/
if (*g.plname) {
getlock();
@@ -327,7 +327,7 @@ attempt_restore:
if locking alphabetically, the existing lock file
can still be used; otherwise, discard current one
and create another for the new character name */
if (!g.lockum) {
if (!g.locknum) {
delete_levelfile(0); /* remove empty lock file */
getlock();
}
@@ -452,17 +452,17 @@ char *argv[];
#else
/* XXX This is deprecated in favor of SYSCF with MAXPLAYERS */
if (argc > 1)
g.lockum = atoi(argv[1]);
g.locknum = atoi(argv[1]);
#endif
#ifdef MAX_NR_OF_PLAYERS
/* limit to compile-time limit */
if (!g.lockum || g.lockum > MAX_NR_OF_PLAYERS)
g.lockum = MAX_NR_OF_PLAYERS;
if (!g.locknum || g.locknum > MAX_NR_OF_PLAYERS)
g.locknum = MAX_NR_OF_PLAYERS;
#endif
#ifdef SYSCF
/* let syscf override compile-time limit */
if (!g.lockum || (sysopt.maxplayers && g.lockum > sysopt.maxplayers))
g.lockum = sysopt.maxplayers;
if (!g.locknum || (sysopt.maxplayers && g.locknum > sysopt.maxplayers))
g.locknum = sysopt.maxplayers;
#endif
}

View File

@@ -119,15 +119,15 @@ getlock()
/* default value of lock[] is "1lock" where '1' gets changed to
'a','b',&c below; override the default and use <uid><charname>
if we aren't restricting the number of simultaneous games */
if (!g.lockum)
if (!g.locknum)
Sprintf(lock, "%u%s", (unsigned) getuid(), g.plname);
regularize(lock);
set_levelfile_name(lock, 0);
if (g.lockum) {
if (g.lockum > 25)
g.lockum = 25;
if (g.locknum) {
if (g.locknum > 25)
g.locknum = 25;
do {
lock[0] = 'a' + i++;
@@ -145,7 +145,7 @@ getlock()
if (veryold(fd) && eraseoldlocks())
goto gotlock;
(void) close(fd);
} while (i < g.lockum);
} while (i < g.locknum);
unlock_file(HLOCK);
error("Too many hacks running now.");

View File

@@ -141,7 +141,7 @@ char *argv[];
if (wizard) {
/* use character name rather than lock letter for file names */
g.lockum = 0;
g.locknum = 0;
} else {
/* suppress interrupts while processing lock file */
(void) signal(SIGQUIT, SIG_IGN);
@@ -149,14 +149,14 @@ char *argv[];
}
/*
* getlock() complains and quits if there is already a game
* in progress for current character name (when g.lockum == 0)
* or if there are too many active games (when g.lockum > 0).
* in progress for current character name (when g.locknum == 0)
* or if there are too many active games (when g.locknum > 0).
* When proceeding, it creates an empty <lockname>.0 file to
* designate the current game.
* getlock() constructs <lockname> based on the character
* name (for !g.lockum) or on first available of alock, block,
* name (for !g.locknum) or on first available of alock, block,
* clock, &c not currently in use in the playground directory
* (for g.lockum > 0).
* (for g.locknum > 0).
*/
getlock();
@@ -212,7 +212,7 @@ attempt_restore:
if locking alphabetically, the existing lock file
can still be used; otherwise, discard current one
and create another for the new character name */
if (!g.lockum) {
if (!g.locknum) {
delete_levelfile(0); /* remove empty lock file */
getlock();
}
@@ -315,10 +315,10 @@ char *argv[];
}
if (argc > 1)
g.lockum = atoi(argv[1]);
g.locknum = atoi(argv[1]);
#ifdef MAX_NR_OF_PLAYERS
if (!g.lockum || g.lockum > MAX_NR_OF_PLAYERS)
g.lockum = MAX_NR_OF_PLAYERS;
if (!g.locknum || g.locknum > MAX_NR_OF_PLAYERS)
g.locknum = MAX_NR_OF_PLAYERS;
#endif
}

View File

@@ -109,16 +109,16 @@ getlock()
/* default value of lock[] is "1lock" where '1' gets changed to
'a','b',&c below; override the default and use <uid><charname>
if we aren't restricting the number of simultaneous games */
if (!g.lockum)
if (!g.locknum)
Sprintf(lock, "_%u%s", (unsigned) getuid(), plname);
regularize(lock);
set_levelfile_name(lock, 0);
if (g.lockum > 25)
g.lockum = 25;
if (g.locknum > 25)
g.locknum = 25;
do {
if (g.lockum)
if (g.locknum)
lock[0] = 'a' + i++;
if ((fd = open(lock, 0, 0)) == -1) {
@@ -132,10 +132,10 @@ getlock()
if (veryold(fd)) /* if true, this closes fd and unlinks lock */
goto gotlock;
(void) close(fd);
} while (i < g.lockum);
} while (i < g.locknum);
unlock_file(HLOCK);
error(g.lockum ? "Too many hacks running now."
error(g.locknum ? "Too many hacks running now."
: "There is a game in progress under your name.");
gotlock: