keybinding lint and formatting

This commit is contained in:
PatR
2016-10-07 13:14:54 -07:00
parent 2c9aac4f13
commit e81c58aa1d
2 changed files with 131 additions and 99 deletions
+4 -4
View File
@@ -185,7 +185,7 @@ E char NDECL(pgetchar);
E void FDECL(pushch, (CHAR_P)); E void FDECL(pushch, (CHAR_P));
E void FDECL(savech, (CHAR_P)); E void FDECL(savech, (CHAR_P));
E const char *FDECL(key2extcmddesc, (UCHAR_P)); E const char *FDECL(key2extcmddesc, (UCHAR_P));
E boolean FDECL(bind_specialkey, (UCHAR_P, char *)); E boolean FDECL(bind_specialkey, (UCHAR_P, const char *));
E char FDECL(txt2key, (char *)); E char FDECL(txt2key, (char *));
E void FDECL(parseautocomplete, (char *, BOOLEAN_P)); E void FDECL(parseautocomplete, (char *, BOOLEAN_P));
E void FDECL(reset_commands, (BOOLEAN_P)); E void FDECL(reset_commands, (BOOLEAN_P));
@@ -196,7 +196,7 @@ E int NDECL(enter_explore_mode);
E void FDECL(enlightenment, (int, int)); E void FDECL(enlightenment, (int, int));
E void FDECL(youhiding, (BOOLEAN_P, int)); E void FDECL(youhiding, (BOOLEAN_P, int));
E void FDECL(show_conduct, (int)); E void FDECL(show_conduct, (int));
E void FDECL(bind_key, (UCHAR_P, char *)); E void FDECL(bind_key, (UCHAR_P, const char *));
E void NDECL(dokeylist); E void NDECL(dokeylist);
E int FDECL(xytod, (SCHAR_P, SCHAR_P)); E int FDECL(xytod, (SCHAR_P, SCHAR_P));
E void FDECL(dtoxy, (coord *, int)); E void FDECL(dtoxy, (coord *, int));
@@ -379,7 +379,7 @@ E void NDECL(heal_legs);
/* ### do_name.c ### */ /* ### do_name.c ### */
E char *FDECL(coord_desc, (int, int, char *, CHAR_P)); E char *FDECL(coord_desc, (int, int, char *, CHAR_P));
E boolean FDECL(getpos_menu, (coord *, boolean)); E boolean FDECL(getpos_menu, (coord *, BOOLEAN_P));
E int FDECL(getpos, (coord *, BOOLEAN_P, const char *)); E int FDECL(getpos, (coord *, BOOLEAN_P, const char *));
E void FDECL(getpos_sethilite, (void (*f)(int))); E void FDECL(getpos_sethilite, (void (*f)(int)));
E void FDECL(new_mname, (struct monst *, int)); E void FDECL(new_mname, (struct monst *, int));
@@ -1673,7 +1673,7 @@ E void FDECL(parsebindings, (char *));
E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P)); E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P));
E char FDECL(get_menu_cmd_key, (CHAR_P)); E char FDECL(get_menu_cmd_key, (CHAR_P));
E char FDECL(map_menu_cmd, (CHAR_P)); E char FDECL(map_menu_cmd, (CHAR_P));
E void FDECL(show_menu_controls, (winid, boolean)); E void FDECL(show_menu_controls, (winid, BOOLEAN_P));
E void FDECL(assign_warnings, (uchar *)); E void FDECL(assign_warnings, (uchar *));
E char *FDECL(nh_getenv, (const char *)); E char *FDECL(nh_getenv, (const char *));
E void FDECL(set_duplicate_opt_detection, (int)); E void FDECL(set_duplicate_opt_detection, (int));
+127 -95
View File
@@ -356,7 +356,7 @@ doextlist(VOID_ARGS)
if (!wizard && (efp->flags & WIZMODECMD)) if (!wizard && (efp->flags & WIZMODECMD))
continue; continue;
Sprintf(buf, " %-15s %c %s.", Sprintf(buf, " %-15s %c %s.",
efp->ef_txt, efp->ef_txt,
(efp->flags & AUTOCOMPLETE) ? '*' : ' ', (efp->flags & AUTOCOMPLETE) ? '*' : ' ',
efp->ef_desc); efp->ef_desc);
putstr(datawin, 0, buf); putstr(datawin, 0, buf);
@@ -2829,30 +2829,32 @@ uchar key;
{ {
if (Cmd.commands[key] && Cmd.commands[key]->ef_txt) if (Cmd.commands[key] && Cmd.commands[key]->ef_txt)
return Cmd.commands[key]->ef_desc; return Cmd.commands[key]->ef_desc;
return NULL; return (char *) 0;
} }
void void
bind_key(key, command) bind_key(key, command)
uchar key; uchar key;
char* command; const char *command;
{ {
struct ext_func_tab * extcmd; struct ext_func_tab *extcmd;
/* special case: "nothing" is reserved for unbinding */ /* special case: "nothing" is reserved for unbinding */
if (!strcmp(command, "nothing")) { if (!strcmp(command, "nothing")) {
Cmd.commands[key] = NULL; Cmd.commands[key] = (struct ext_func_tab *) 0;
return; return;
} }
for(extcmd = extcmdlist; extcmd->ef_txt; extcmd++) { for (extcmd = extcmdlist; extcmd->ef_txt; extcmd++) {
if (strcmp(command, extcmd->ef_txt)) continue; if (strcmp(command, extcmd->ef_txt))
continue;
Cmd.commands[key] = extcmd; Cmd.commands[key] = extcmd;
return; return;
} }
pline("Bad command %s matched with key %c (ASCII %i). " pline(
"Ignoring command.\n", command, key, key); "Bad command %s matched with key %c (ASCII %i). Ignoring command.\n",
command, key, key);
} }
/* initialize all keyboard commands */ /* initialize all keyboard commands */
@@ -2872,7 +2874,7 @@ commands_init()
/* 'h', 'H' : go west */ /* 'h', 'H' : go west */
bind_key('h', "help"); /* if number_pad is set */ bind_key('h', "help"); /* if number_pad is set */
bind_key('j', "jump"); /* if number_pad is on */ bind_key('j', "jump"); /* if number_pad is on */
/* 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N' : move commands */ /* 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N' move commands */
bind_key('k', "kick"); /* if number_pad is on */ bind_key('k', "kick"); /* if number_pad is on */
bind_key('l', "loot"); /* if number_pad is on */ bind_key('l', "loot"); /* if number_pad is on */
bind_key(C('n'), "annotate"); /* if number_pad is on */ bind_key(C('n'), "annotate"); /* if number_pad is on */
@@ -2901,12 +2903,14 @@ boolean *keys_used; /* boolean keys_used[256] */
int count = 0; int count = 0;
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
const struct ext_func_tab * extcmd; const struct ext_func_tab *extcmd;
uchar key = (uchar)i; uchar key = (uchar) i;
if (keys_used[i]) continue; if (keys_used[i])
if (key == ' ' && !flags.rest_on_space) continue; continue;
if ((extcmd = Cmd.commands[i]) != NULL) { if (key == ' ' && !flags.rest_on_space)
continue;
if ((extcmd = Cmd.commands[i]) != (struct ext_func_tab *) 0) {
if ((cmdflags && !(extcmd->flags & cmdflags)) if ((cmdflags && !(extcmd->flags & cmdflags))
|| (exflags && (extcmd->flags & exflags))) || (exflags && (extcmd->flags & exflags)))
continue; continue;
@@ -2932,26 +2936,33 @@ dokeylist(VOID_ARGS)
uchar key; uchar key;
boolean keys_used[256] = {0}; boolean keys_used[256] = {0};
winid datawin; winid datawin;
int i; int i;
const struct { const struct {
int nhkf; int nhkf;
const char *desc; const char *desc;
boolean numpad; boolean numpad;
} misc_keys[] = { } misc_keys[] = {
{ NHKF_ESC, "escape from the current query/action" }, { NHKF_ESC, "escape from the current query/action", FALSE },
{ NHKF_RUSH, "Prefix: rush until something interesting is seen" }, { NHKF_RUSH,
{ NHKF_RUN, "Prefix: run until something extremely interesting is seen" }, "Prefix: rush until something interesting is seen", FALSE },
{ NHKF_RUN2, "Prefix: run until something extremely interesting is seen", TRUE }, { NHKF_RUN,
{ NHKF_FIGHT, "Prefix: force fight even if you don't see a monster" }, "Prefix: run until something extremely interesting is seen", FALSE },
{ NHKF_FIGHT2, "Prefix: force fight even if you don't see a monster", TRUE }, { NHKF_RUN2,
{ NHKF_NOPICKUP, "Prefix: move without picking up objects/fighting" }, "Prefix: run until something extremely interesting is seen", TRUE },
{ NHKF_RUN_NOPICKUP, "Prefix: run without picking up objects/fighting" }, { NHKF_FIGHT,
"Prefix: force fight even if you don't see a monster", FALSE },
{ NHKF_FIGHT2,
"Prefix: force fight even if you don't see a monster", TRUE },
{ NHKF_NOPICKUP,
"Prefix: move without picking up objects/fighting", FALSE },
{ NHKF_RUN_NOPICKUP,
"Prefix: run without picking up objects/fighting", FALSE },
{ NHKF_DOINV, "inventory (same as #inventory)", TRUE }, { NHKF_DOINV, "inventory (same as #inventory)", TRUE },
{ NHKF_REQMENU, "Prefix: request a menu" }, { NHKF_REQMENU, "Prefix: request a menu", FALSE },
#ifdef REDO #ifdef REDO
{ NHKF_DOAGAIN , "redo the previous command" }, { NHKF_DOAGAIN , "redo the previous command", FALSE },
#endif #endif
{ 0, NULL } { 0, (const char *) 0, FALSE }
}; };
datawin = create_nhwindow(NHW_TEXT); datawin = create_nhwindow(NHW_TEXT);
@@ -2963,34 +2974,35 @@ dokeylist(VOID_ARGS)
putstr(datawin, 0, "Directional keys:"); putstr(datawin, 0, "Directional keys:");
show_direction_keys(datawin, FALSE); show_direction_keys(datawin, FALSE);
keys_used[(uchar)Cmd.move_NW] = keys_used[(uchar)Cmd.move_N] keys_used[(uchar) Cmd.move_NW] = keys_used[(uchar) Cmd.move_N]
= keys_used[(uchar)Cmd.move_NE] = keys_used[(uchar)Cmd.move_W] = keys_used[(uchar) Cmd.move_NE] = keys_used[(uchar) Cmd.move_W]
= keys_used[(uchar)Cmd.move_E] = keys_used[(uchar)Cmd.move_SW] = keys_used[(uchar) Cmd.move_E] = keys_used[(uchar) Cmd.move_SW]
= keys_used[(uchar)Cmd.move_S] = keys_used[(uchar)Cmd.move_SE] = TRUE; = keys_used[(uchar) Cmd.move_S] = keys_used[(uchar) Cmd.move_SE]
= TRUE;
if (!iflags.num_pad) { if (!iflags.num_pad) {
keys_used[(uchar)highc(Cmd.move_NW)] keys_used[(uchar) highc(Cmd.move_NW)]
= keys_used[(uchar)highc(Cmd.move_N)] = keys_used[(uchar) highc(Cmd.move_N)]
= keys_used[(uchar)highc(Cmd.move_NE)] = keys_used[(uchar) highc(Cmd.move_NE)]
= keys_used[(uchar)highc(Cmd.move_W)] = keys_used[(uchar) highc(Cmd.move_W)]
= keys_used[(uchar)highc(Cmd.move_E)] = keys_used[(uchar) highc(Cmd.move_E)]
= keys_used[(uchar)highc(Cmd.move_SW)] = keys_used[(uchar) highc(Cmd.move_SW)]
= keys_used[(uchar)highc(Cmd.move_S)] = keys_used[(uchar) highc(Cmd.move_S)]
= keys_used[(uchar)highc(Cmd.move_SE)] = TRUE; = keys_used[(uchar) highc(Cmd.move_SE)] = TRUE;
keys_used[(uchar)C(Cmd.move_NW)] keys_used[(uchar) C(Cmd.move_NW)]
= keys_used[(uchar)C(Cmd.move_N)] = keys_used[(uchar) C(Cmd.move_N)]
= keys_used[(uchar)C(Cmd.move_NE)] = keys_used[(uchar) C(Cmd.move_NE)]
= keys_used[(uchar)C(Cmd.move_W)] = keys_used[(uchar) C(Cmd.move_W)]
= keys_used[(uchar)C(Cmd.move_E)] = keys_used[(uchar) C(Cmd.move_E)]
= keys_used[(uchar)C(Cmd.move_SW)] = keys_used[(uchar) C(Cmd.move_SW)]
= keys_used[(uchar)C(Cmd.move_S)] = keys_used[(uchar) C(Cmd.move_S)]
= keys_used[(uchar)C(Cmd.move_SE)] = TRUE; = keys_used[(uchar) C(Cmd.move_SE)] = TRUE;
putstr(datawin, 0, ""); putstr(datawin, 0, "");
putstr(datawin, 0, putstr(datawin, 0,
"Shift-<direction> will move in specified direction until you hit"); "Shift-<direction> will move in specified direction until you hit");
putstr(datawin, 0, " a wall or run into something."); putstr(datawin, 0, " a wall or run into something.");
putstr(datawin, 0, putstr(datawin, 0,
"Ctrl-<direction> will run in specified direction until something"); "Ctrl-<direction> will run in specified direction until something");
putstr(datawin, 0, " very interesting is seen."); putstr(datawin, 0, " very interesting is seen.");
} }
@@ -3000,35 +3012,37 @@ dokeylist(VOID_ARGS)
key = Cmd.spkeys[misc_keys[i].nhkf]; key = Cmd.spkeys[misc_keys[i].nhkf];
if (key && ((misc_keys[i].numpad && iflags.num_pad) if (key && ((misc_keys[i].numpad && iflags.num_pad)
|| !misc_keys[i].numpad)) { || !misc_keys[i].numpad)) {
keys_used[(uchar)key] = TRUE; keys_used[(uchar) key] = TRUE;
Sprintf(buf, "%-8s %s", key2txt(key, buf2), misc_keys[i].desc); Sprintf(buf, "%-8s %s", key2txt(key, buf2), misc_keys[i].desc);
putstr(datawin, 0, buf); putstr(datawin, 0, buf);
} }
} }
#ifndef NO_SIGNAL #ifndef NO_SIGNAL
putstr(datawin, 0, "^c break out of NetHack (SIGINT)"); putstr(datawin, 0, "^c break out of NetHack (SIGINT)");
keys_used[(uchar)C('c')] = TRUE; keys_used[(uchar) C('c')] = TRUE;
#endif #endif
putstr(datawin, 0, ""); putstr(datawin, 0, "");
show_menu_controls(datawin, TRUE); show_menu_controls(datawin, TRUE);
if (dokeylist_putcmds(datawin, TRUE, GENERALCMD, WIZMODECMD, &keys_used)) { if (dokeylist_putcmds(datawin, TRUE, GENERALCMD, WIZMODECMD, keys_used)) {
putstr(datawin, 0, ""); putstr(datawin, 0, "");
putstr(datawin, 0, "General commands:"); putstr(datawin, 0, "General commands:");
(void) dokeylist_putcmds(datawin, FALSE, GENERALCMD, WIZMODECMD, &keys_used); (void) dokeylist_putcmds(datawin, FALSE, GENERALCMD, WIZMODECMD,
keys_used);
} }
if (dokeylist_putcmds(datawin, TRUE, 0, WIZMODECMD, &keys_used)) { if (dokeylist_putcmds(datawin, TRUE, 0, WIZMODECMD, keys_used)) {
putstr(datawin, 0, ""); putstr(datawin, 0, "");
putstr(datawin, 0, "Game commands:"); putstr(datawin, 0, "Game commands:");
(void) dokeylist_putcmds(datawin, FALSE, 0, WIZMODECMD, &keys_used); (void) dokeylist_putcmds(datawin, FALSE, 0, WIZMODECMD, keys_used);
} }
if (wizard && dokeylist_putcmds(datawin, TRUE, WIZMODECMD, 0, &keys_used)) { if (wizard
&& dokeylist_putcmds(datawin, TRUE, WIZMODECMD, 0, keys_used)) {
putstr(datawin, 0, ""); putstr(datawin, 0, "");
putstr(datawin, 0, "Wizard-mode commands:"); putstr(datawin, 0, "Wizard-mode commands:");
(void) dokeylist_putcmds(datawin, FALSE, WIZMODECMD, 0, &keys_used); (void) dokeylist_putcmds(datawin, FALSE, WIZMODECMD, 0, keys_used);
} }
display_nhwindow(datawin, FALSE); display_nhwindow(datawin, FALSE);
@@ -3040,12 +3054,17 @@ cmd_from_func(fn)
int NDECL((*fn)); int NDECL((*fn));
{ {
int i; int i;
for (i = 0; i < 256; ++i) for (i = 0; i < 256; ++i)
if (Cmd.commands[i] && Cmd.commands[i]->ef_funct == fn) if (Cmd.commands[i] && Cmd.commands[i]->ef_funct == fn)
return (char)i; return (char) i;
return 0; return '\0';
} }
/*
* wizard mode sanity_check code
*/
static const char template[] = "%-27s %4ld %6ld"; static const char template[] = "%-27s %4ld %6ld";
static const char stats_hdr[] = " count bytes"; static const char stats_hdr[] = " count bytes";
static const char stats_sep[] = "--------------------------- ----- -------"; static const char stats_sep[] = "--------------------------- ----- -------";
@@ -3466,7 +3485,7 @@ struct {
char key; char key;
const char *name; const char *name;
} const spkeys_binds[] = { } const spkeys_binds[] = {
{ NHKF_ESC, '\033', NULL }, /* no binding */ { NHKF_ESC, '\033', (char *) 0 }, /* no binding */
{ NHKF_DOAGAIN, DOAGAIN, "repeat" }, { NHKF_DOAGAIN, DOAGAIN, "repeat" },
{ NHKF_REQMENU, 'm', "reqmenu" }, { NHKF_REQMENU, 'm', "reqmenu" },
{ NHKF_RUN, 'G', "run" }, { NHKF_RUN, 'G', "run" },
@@ -3477,8 +3496,8 @@ struct {
{ NHKF_NOPICKUP, 'm', "nopickup" }, { NHKF_NOPICKUP, 'm', "nopickup" },
{ NHKF_RUN_NOPICKUP, 'M', "run.nopickup" }, { NHKF_RUN_NOPICKUP, 'M', "run.nopickup" },
{ NHKF_DOINV, '0', "doinv" }, { NHKF_DOINV, '0', "doinv" },
{ NHKF_TRAVEL, CMD_TRAVEL, NULL }, /* no binding */ { NHKF_TRAVEL, CMD_TRAVEL, (char *) 0 }, /* no binding */
{ NHKF_CLICKLOOK, CMD_CLICKLOOK, NULL }, /* no binding */ { NHKF_CLICKLOOK, CMD_CLICKLOOK, (char *) 0 }, /* no binding */
{ NHKF_REDRAW, C('r'), "redraw" }, { NHKF_REDRAW, C('r'), "redraw" },
{ NHKF_REDRAW2, C('l'), "redraw.numpad" }, { NHKF_REDRAW2, C('l'), "redraw.numpad" },
{ NHKF_GETDIR_SELF, '.', "getdir.self" }, { NHKF_GETDIR_SELF, '.', "getdir.self" },
@@ -3508,7 +3527,7 @@ struct {
boolean boolean
bind_specialkey(key, command) bind_specialkey(key, command)
uchar key; uchar key;
char *command; const char *command;
{ {
int i; int i;
for (i = 0; i < SIZE(spkeys_binds); i++) { for (i = 0; i < SIZE(spkeys_binds); i++) {
@@ -3527,53 +3546,64 @@ txt2key(txt)
char *txt; char *txt;
{ {
txt = trimspaces(txt); txt = trimspaces(txt);
if (!*txt) return 0; if (!*txt)
return '\0';
/* simple character */ /* simple character */
if (!txt[1]) return txt[0]; if (!txt[1])
return txt[0];
/* a few special entries */ /* a few special entries */
if (!strcmp(txt, "<enter>")) return '\n'; if (!strcmp(txt, "<enter>"))
if (!strcmp(txt, "<space>")) return ' '; return '\n';
if (!strcmp(txt, "<esc>")) return '\033'; if (!strcmp(txt, "<space>"))
return ' ';
if (!strcmp(txt, "<esc>"))
return '\033';
/* control and meta keys */ /* control and meta keys */
switch (*txt) { switch (*txt) {
case 'm': /* can be mx, Mx, m-x, M-x */ case 'm': /* can be mx, Mx, m-x, M-x */
case 'M': case 'M':
txt++; txt++;
if(*txt == '-' && txt[1]) txt++; if (*txt == '-' && txt[1])
if (txt[1]) return 0; txt++;
return M( *txt ); if (txt[1])
return '\0';
return M(*txt);
case 'c': /* can be cx, Cx, ^x, c-x, C-x, ^-x */ case 'c': /* can be cx, Cx, ^x, c-x, C-x, ^-x */
case 'C': case 'C':
case '^': case '^':
txt++; txt++;
if(*txt == '-' && txt[1]) txt++; if (*txt == '-' && txt[1])
if (txt[1]) return 0; txt++;
return C( *txt ); if (txt[1])
return '\0';
return C(*txt);
} }
/* ascii codes: must be three-digit decimal */ /* ascii codes: must be three-digit decimal */
if (*txt >= '0' && *txt <= '9') { if (*txt >= '0' && *txt <= '9') {
uchar key = 0; uchar key = 0;
int i; int i;
for(i = 0; i < 3; i++) {
if(txt[i]<'0' || txt[i]>'9') return 0; for (i = 0; i < 3; i++) {
key = 10 * key + txt[i]-'0'; if (txt[i] < '0' || txt[i] > '9')
return '\0';
key = 10 * key + txt[i] - '0';
} }
return key; return key;
} }
return 0; return '\0';
} }
/* returns the text for a one-byte encoding /* returns the text for a one-byte encoding
* must be shorter than a tab for proper formatting */ * must be shorter than a tab for proper formatting */
char* char *
key2txt(c, txt) key2txt(c, txt)
uchar c; uchar c;
char* txt; /* sufficiently long buffer */ char *txt; /* sufficiently long buffer */
{ {
if (c == ' ') if (c == ' ')
Sprintf(txt, "<space>"); Sprintf(txt, "<space>");
@@ -3586,32 +3616,33 @@ char* txt; /* sufficiently long buffer */
else if (ISMETA(c)) else if (ISMETA(c))
Sprintf(txt, "M-%c", UNMETA(c)); Sprintf(txt, "M-%c", UNMETA(c));
else if (c >= 33 && c <= 126) else if (c >= 33 && c <= 126)
Sprintf(txt, "%c", c); /* regular keys: ! through ~ */ Sprintf(txt, "%c", c); /* regular keys: ! through ~ */
else else
Sprintf(txt, "A-%i", c); /* arbitrary ascii combinations */ Sprintf(txt, "A-%i", c); /* arbitrary ascii combinations */
return txt; return txt;
} }
void void
parseautocomplete(autocomplete,condition) parseautocomplete(autocomplete, condition)
char* autocomplete; char *autocomplete;
boolean condition; boolean condition;
{ {
struct ext_func_tab *efp; struct ext_func_tab *efp;
register char *autoc; register char *autoc;
/* break off first autocomplete from the rest; parse the rest */ /* break off first autocomplete from the rest; parse the rest */
if ((autoc = index(autocomplete, ',')) if ((autoc = index(autocomplete, ',')) != 0
|| (autoc = index(autocomplete, ':'))) { || (autoc = index(autocomplete, ':')) != 0) {
*autoc++ = 0; *autoc++ = '\0';
parseautocomplete(autoc, condition); parseautocomplete(autoc, condition);
} }
/* strip leading and trailing white space */ /* strip leading and trailing white space */
autocomplete = trimspaces(autocomplete); autocomplete = trimspaces(autocomplete);
if (!*autocomplete) return; if (!*autocomplete)
return;
/* take off negation */ /* take off negation */
if (*autocomplete == '!') { if (*autocomplete == '!') {
@@ -3634,7 +3665,8 @@ boolean condition;
} }
/* not a real extended command */ /* not a real extended command */
raw_printf("Bad autocomplete: invalid extended command '%s'.", autocomplete); raw_printf("Bad autocomplete: invalid extended command '%s'.",
autocomplete);
wait_synch(); wait_synch();
} }
@@ -3667,7 +3699,7 @@ boolean initial;
if (backed_dir_cmd) { if (backed_dir_cmd) {
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
Cmd.commands[(uchar)Cmd.dirchars[i]] = back_dir_cmd[i]; Cmd.commands[(uchar) Cmd.dirchars[i]] = back_dir_cmd[i];
} }
} }
@@ -3743,8 +3775,8 @@ boolean initial;
if (!initial) { if (!initial) {
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
back_dir_cmd[i] = back_dir_cmd[i] =
(struct ext_func_tab *)Cmd.commands[(uchar)Cmd.dirchars[i]]; (struct ext_func_tab *) Cmd.commands[(uchar) Cmd.dirchars[i]];
Cmd.commands[(uchar)Cmd.dirchars[i]] = NULL; Cmd.commands[(uchar) Cmd.dirchars[i]] = (struct ext_func_tab *) 0;
} }
backed_dir_cmd = TRUE; backed_dir_cmd = TRUE;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
@@ -4492,7 +4524,7 @@ parse()
if (!Cmd.num_pad || (foo = readchar()) == Cmd.spkeys[NHKF_COUNT]) { if (!Cmd.num_pad || (foo = readchar()) == Cmd.spkeys[NHKF_COUNT]) {
long tmpmulti = multi; long tmpmulti = multi;
foo = get_count(NULL, '\0', LARGEST_INT, &tmpmulti); foo = get_count((char *) 0, '\0', LARGEST_INT, &tmpmulti);
last_multi = multi = tmpmulti; last_multi = multi = tmpmulti;
} }
#ifdef ALTMETA #ifdef ALTMETA
@@ -4642,7 +4674,7 @@ readchar()
sym = '\033'; sym = '\033';
else if (sym != '\033') else if (sym != '\033')
sym |= 0200; /* force 8th bit on */ sym |= 0200; /* force 8th bit on */
#endif /*ALTMETA*/ #endif /*ALTMETA*/
} else if (sym == 0) { } else if (sym == 0) {
/* click event */ /* click event */
readchar_queue = click_to_cmd(x, y, mod); readchar_queue = click_to_cmd(x, y, mod);
@@ -4711,7 +4743,7 @@ wiz_port_debug()
{ "show keystroke handler information (tty only)", { "show keystroke handler information (tty only)",
win32con_handler_info }, win32con_handler_info },
#endif #endif
{ (char *) 0, (void NDECL((*) )) 0 } /* array terminator */ { (char *) 0, (void NDECL((*))) 0 } /* array terminator */
}; };
num_menu_selections = SIZE(menu_selections) - 1; num_menu_selections = SIZE(menu_selections) - 1;