diff options
author | Brian Callahan <bcallah@cvs.openbsd.org> | 2015-03-19 21:48:06 +0000 |
---|---|---|
committer | Brian Callahan <bcallah@cvs.openbsd.org> | 2015-03-19 21:48:06 +0000 |
commit | 554718915fddf619b90d187a8407d6ba1e19a7cc (patch) | |
tree | 9ab90d86f59c32a653ac39f4dd9ed12be3eea628 /usr.bin | |
parent | 1fb5e81a161f71860b29d58d3c9bb9c453290e6c (diff) |
More unifdef cleanup:
-UDIRED_XMAPS and -UFUND_XMAPS: you can't build mg the other way.
-DTIOCGWINSZ: you have this if you have term.h
Remove a #define TERMCAP which isn't being used.
Remove defines for NDIRED_XMAPS, NFUND_XMAPS, and IMAPEXT. They are all
defined to be 0 and are only ever used in addition. We don't need to add 0.
Simply lines that were using those defines.
ok florian@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mg/buffer.c | 6 | ||||
-rw-r--r-- | usr.bin/mg/cmode.c | 10 | ||||
-rw-r--r-- | usr.bin/mg/dired.c | 19 | ||||
-rw-r--r-- | usr.bin/mg/grep.c | 6 | ||||
-rw-r--r-- | usr.bin/mg/kbd.h | 3 | ||||
-rw-r--r-- | usr.bin/mg/keymap.c | 59 | ||||
-rw-r--r-- | usr.bin/mg/theo.c | 6 | ||||
-rw-r--r-- | usr.bin/mg/tty.c | 4 | ||||
-rw-r--r-- | usr.bin/mg/ttydef.h | 3 |
9 files changed, 49 insertions, 67 deletions
diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c index 33e00d517e2..e9a130c2469 100644 --- a/usr.bin/mg/buffer.c +++ b/usr.bin/mg/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.96 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: buffer.c,v 1.97 2015/03/19 21:48:05 bcallah Exp $ */ /* This file is in the public domain. */ @@ -253,9 +253,9 @@ static PF listbuf_one[] = { }; -static struct KEYMAPE (2 + IMAPEXT) listbufmap = { +static struct KEYMAPE (2) listbufmap = { + 2, 2, - 2 + IMAPEXT, rescan, { { diff --git a/usr.bin/mg/cmode.c b/usr.bin/mg/cmode.c index 5f880eb4218..db69d7f3018 100644 --- a/usr.bin/mg/cmode.c +++ b/usr.bin/mg/cmode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmode.c,v 1.14 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: cmode.c,v 1.15 2015/03/19 21:48:05 bcallah Exp $ */ /* * This file is in the public domain. * @@ -66,18 +66,18 @@ static PF cmode_spec[] = { cc_char, /* : */ }; -static struct KEYMAPE (1 + IMAPEXT) cmode_cmap = { +static struct KEYMAPE (1) cmode_cmap = { + 1, 1, - 1 + IMAPEXT, rescan, { { 'P', 'P', cmode_cCP, NULL } } }; -static struct KEYMAPE (3 + IMAPEXT) cmodemap = { +static struct KEYMAPE (3) cmodemap = { + 3, 3, - 3 + IMAPEXT, rescan, { { CCHR('C'), CCHR('M'), cmode_cc, (KEYMAP *) &cmode_cmap }, diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c index 24d26ce61fa..40d43f53979 100644 --- a/usr.bin/mg/dired.c +++ b/usr.bin/mg/dired.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dired.c,v 1.70 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: dired.c,v 1.71 2015/03/19 21:48:05 bcallah Exp $ */ /* This file is in the public domain. */ @@ -139,13 +139,9 @@ static PF dirednull[] = { NULL }; -#ifndef DIRED_XMAPS -#define NDIRED_XMAPS 0 /* number of extra map sections */ -#endif /* DIRED_XMAPS */ - -static struct KEYMAPE (1 + IMAPEXT) d_backpagemap = { +static struct KEYMAPE (1) d_backpagemap = { + 1, 1, - 1 + IMAPEXT, rescan, { { @@ -154,9 +150,9 @@ static struct KEYMAPE (1 + IMAPEXT) d_backpagemap = { } }; -static struct KEYMAPE (7 + NDIRED_XMAPS + IMAPEXT) diredmap = { - 7 + NDIRED_XMAPS, - 7 + NDIRED_XMAPS + IMAPEXT, +static struct KEYMAPE (7) diredmap = { + 7, + 7, rescan, { { @@ -181,9 +177,6 @@ static struct KEYMAPE (7 + NDIRED_XMAPS + IMAPEXT) diredmap = { { CCHR('?'), CCHR('?'), direddl, NULL }, -#ifdef DIRED_XMAPS - DIRED_XMAPS, /* map sections for dired mode keys */ -#endif /* DIRED_XMAPS */ } }; diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c index cde858db38c..b18808f034b 100644 --- a/usr.bin/mg/grep.c +++ b/usr.bin/mg/grep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grep.c,v 1.43 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: grep.c,v 1.44 2015/03/19 21:48:05 bcallah Exp $ */ /* This file is in the public domain */ @@ -40,9 +40,9 @@ static PF compile_pf[] = { compile_goto_error }; -static struct KEYMAPE (1 + IMAPEXT) compilemap = { +static struct KEYMAPE (1) compilemap = { + 1, 1, - 1 + IMAPEXT, rescan, { { CCHR('M'), CCHR('M'), compile_pf, NULL } diff --git a/usr.bin/mg/kbd.h b/usr.bin/mg/kbd.h index 67b244c65f4..3523eac89e0 100644 --- a/usr.bin/mg/kbd.h +++ b/usr.bin/mg/kbd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kbd.h,v 1.18 2006/07/27 19:59:29 deraadt Exp $ */ +/* $OpenBSD: kbd.h,v 1.19 2015/03/19 21:48:05 bcallah Exp $ */ /* This file is in the public domain. */ @@ -30,7 +30,6 @@ struct map_element { typedef struct keymap_s KEYMAPE(1) KEYMAP; /* Number of map_elements to grow an overflowed keymap by */ -#define IMAPEXT 0 #define MAPGROW 3 #define MAPINIT (MAPGROW+1) diff --git a/usr.bin/mg/keymap.c b/usr.bin/mg/keymap.c index fae030244a3..7e985e12954 100644 --- a/usr.bin/mg/keymap.c +++ b/usr.bin/mg/keymap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keymap.c,v 1.54 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: keymap.c,v 1.55 2015/03/19 21:48:05 bcallah Exp $ */ /* This file is in the public domain. */ @@ -31,9 +31,9 @@ static PF cHa[] = { desckey /* c */ }; -struct KEYMAPE (2 + IMAPEXT) helpmap = { +struct KEYMAPE (2) helpmap = { + 2, 2, - 2 + IMAPEXT, rescan, { { @@ -66,9 +66,9 @@ static PF cCsc[] = { csfindtext /* t */ }; -static struct KEYMAPE (1 + IMAPEXT) cCsmap = { +static struct KEYMAPE (1) cCsmap = { + 1, 1, - 1 + IMAPEXT, rescan, { { @@ -81,9 +81,9 @@ static PF cCs[] = { NULL /* s */ }; -struct KEYMAPE (2 + IMAPEXT) ccmap = { +struct KEYMAPE (2) ccmap = { + 2, 2, - 2 + IMAPEXT, rescan, { { @@ -106,9 +106,9 @@ static PF cX4b[] = { rescan, /* e */ poptofile /* f */ }; -static struct KEYMAPE (2 + IMAPEXT) cX4map = { +static struct KEYMAPE (2) cX4map = { + 2, 2, - 2 + IMAPEXT, rescan, { { @@ -189,9 +189,9 @@ static PF cXcar[] = { undo /* u */ }; -struct KEYMAPE (6 + IMAPEXT) cXmap = { +struct KEYMAPE (6) cXmap = { + 6, 6, - 6 + IMAPEXT, rescan, { { @@ -301,9 +301,9 @@ static PF metatilde[] = { delbword /* DEL */ }; -struct KEYMAPE (1 + IMAPEXT) metasqlmap = { +struct KEYMAPE (1) metasqlmap = { + 1, 1, - 1 + IMAPEXT, rescan, { { @@ -312,9 +312,9 @@ struct KEYMAPE (1 + IMAPEXT) metasqlmap = { } }; -struct KEYMAPE (8 + IMAPEXT) metamap = { +struct KEYMAPE (8) metamap = { + 8, 8, - 8 + IMAPEXT, rescan, { { @@ -397,13 +397,9 @@ static PF fund_cb[] = { showmatch /* ) ] } */ }; -#ifndef FUND_XMAPS -#define NFUND_XMAPS 0 /* extra map sections after normal ones */ -#endif - -static struct KEYMAPE (8 + NFUND_XMAPS + IMAPEXT) fundmap = { - 8 + NFUND_XMAPS, - 8 + NFUND_XMAPS + IMAPEXT, +static struct KEYMAPE (8) fundmap = { + 8, + 8, selfinsert, { { @@ -430,9 +426,6 @@ static struct KEYMAPE (8 + NFUND_XMAPS + IMAPEXT) fundmap = { { CCHR('?'), CCHR('?'), fund_del, NULL }, -#ifdef FUND_XMAPS - FUND_XMAPS, -#endif /* FUND_XMAPS */ } }; @@ -440,9 +433,9 @@ static PF fill_sp[] = { fillword /* ' ' */ }; -static struct KEYMAPE (1 + IMAPEXT) fillmap = { +static struct KEYMAPE (1) fillmap = { + 1, 1, - 1 + IMAPEXT, rescan, { { ' ', ' ', fill_sp, NULL } @@ -456,9 +449,9 @@ static PF indent_lf[] = { lfindent /* ^M */ }; -static struct KEYMAPE (1 + IMAPEXT) indntmap = { +static struct KEYMAPE (1) indntmap = { + 1, 1, - 1 + IMAPEXT, rescan, { { @@ -472,9 +465,9 @@ static PF notab_tab[] = { space_to_tabstop /* ^I */ }; -static struct KEYMAPE (1 + IMAPEXT) notabmap = { +static struct KEYMAPE (1) notabmap = { + 1, 1, - 1 + IMAPEXT, rescan, { { @@ -484,9 +477,9 @@ static struct KEYMAPE (1 + IMAPEXT) notabmap = { }; #endif /* NOTAB */ -static struct KEYMAPE (1 + IMAPEXT) overwmap = { +static struct KEYMAPE (1) overwmap = { 0, - 1 + IMAPEXT, /* 1 to avoid 0 sized array */ + 1, /* 1 to avoid 0 sized array */ rescan, { /* unused dummy entry for VMS C */ diff --git a/usr.bin/mg/theo.c b/usr.bin/mg/theo.c index 7c59eb38568..7296420462d 100644 --- a/usr.bin/mg/theo.c +++ b/usr.bin/mg/theo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: theo.c,v 1.145 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: theo.c,v 1.146 2015/03/19 21:48:05 bcallah Exp $ */ /* * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -42,9 +42,9 @@ static PF theo_pf[] = { theo_analyze }; -static struct KEYMAPE (1 + IMAPEXT) theomap = { +static struct KEYMAPE (1) theomap = { + 1, 1, - 1 + IMAPEXT, rescan, { { CCHR('M'), CCHR('M'), theo_pf, NULL } diff --git a/usr.bin/mg/tty.c b/usr.bin/mg/tty.c index 666d44ce64d..e080c732620 100644 --- a/usr.bin/mg/tty.c +++ b/usr.bin/mg/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.34 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: tty.c,v 1.35 2015/03/19 21:48:05 bcallah Exp $ */ /* This file is in the public domain. */ @@ -408,14 +408,12 @@ ttresize(void) { int newrow = 0, newcol = 0; -#ifdef TIOCGWINSZ struct winsize winsize; if (ioctl(0, TIOCGWINSZ, &winsize) == 0) { newrow = winsize.ws_row; newcol = winsize.ws_col; } -#endif if ((newrow <= 0 || newcol <= 0) && ((newrow = lines) <= 0 || (newcol = columns) <= 0)) { newrow = 24; diff --git a/usr.bin/mg/ttydef.h b/usr.bin/mg/ttydef.h index b32b1c0cd9d..97fa3ea9f7d 100644 --- a/usr.bin/mg/ttydef.h +++ b/usr.bin/mg/ttydef.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ttydef.h,v 1.10 2005/11/20 03:53:45 deraadt Exp $ */ +/* $OpenBSD: ttydef.h,v 1.11 2015/03/19 21:48:05 bcallah Exp $ */ /* This file is in the public domain. */ @@ -11,7 +11,6 @@ */ #define STANDOUT_GLITCH /* possible standout glitch */ -#define TERMCAP /* for possible use in ttyio.c */ #ifdef undef #define MOVE_STANDOUT /* don't move in standout mode */ |