Hi again tech@ -- Some more unifdef fun with vi: 1. SA_INTERRUPT is a SunOS extension. I don't think we need to care if vi is portable there anymore. vi doesn't build if defined the other way. 2. There is a HISTORIC_PRACTICE and a HISTORICAL_PRACTICE define. We don't appear to be using either so get rid of them. 3. We have mvchgat via <curses.h> so don't need to check for it. The declarations within that #ifndef block weren't being used.
OK? ~Brian Index: cl/cl_funcs.c =================================================================== RCS file: /cvs/src/usr.bin/vi/cl/cl_funcs.c,v retrieving revision 1.17 diff -u -p -r1.17 cl_funcs.c --- cl/cl_funcs.c 12 Nov 2014 16:29:04 -0000 1.17 +++ cl/cl_funcs.c 28 Mar 2015 18:35:43 -0000 @@ -261,10 +261,6 @@ cl_cursor(SCR *sp, size_t *yp, size_t *x int cl_deleteln(SCR *sp) { -#ifndef mvchgat - CHAR_T ch; - size_t col, lno, spcnt; -#endif size_t oldy, oldx; /* Index: cl/cl_main.c =================================================================== RCS file: /cvs/src/usr.bin/vi/cl/cl_main.c,v retrieving revision 1.25 diff -u -p -r1.25 cl_main.c --- cl/cl_main.c 19 Nov 2014 03:42:40 -0000 1.25 +++ cl/cl_main.c 28 Mar 2015 18:35:43 -0000 @@ -319,21 +319,12 @@ setsig(int signo, struct sigaction *oact * Use sigaction(2), not signal(3), since we don't always want to * restart system calls. The example is when waiting for a command * mode keystroke and SIGWINCH arrives. Besides, you can't portably - * restart system calls (thanks, POSIX!). On the other hand, you - * can't portably NOT restart system calls (thanks, Sun!). SunOS - * used SA_INTERRUPT as their extension to NOT restart read calls. - * We sure hope nobody else used it for anything else. Mom told me - * there'd be days like this. She just never told me that there'd - * be so many. + * restart system calls (thanks, POSIX!). */ act.sa_handler = handler; sigemptyset(&act.sa_mask); -#ifdef SA_INTERRUPT - act.sa_flags = SA_INTERRUPT; -#else act.sa_flags = 0; -#endif return (sigaction(signo, &act, oactp)); } Index: ex/ex_z.c =================================================================== RCS file: /cvs/src/usr.bin/vi/ex/ex_z.c,v retrieving revision 1.7 diff -u -p -r1.7 ex_z.c --- ex/ex_z.c 12 Nov 2014 04:28:41 -0000 1.7 +++ ex/ex_z.c 28 Mar 2015 18:35:43 -0000 @@ -51,11 +51,7 @@ ex_z(SCR *sp, EXCMD *cmdp) if (FL_ISSET(cmdp->iflags, E_C_COUNT)) cnt = cmdp->count; else -#ifdef HISTORIC_PRACTICE - cnt = O_VAL(sp, O_SCROLL) * 2; -#else cnt = O_VAL(sp, O_WINDOW) - 1; -#endif equals = 0; eofcheck = 0; Index: vi/v_mark.c =================================================================== RCS file: /cvs/src/usr.bin/vi/vi/v_mark.c,v retrieving revision 1.9 diff -u -p -r1.9 v_mark.c --- vi/v_mark.c 12 Nov 2014 04:28:41 -0000 1.9 +++ vi/v_mark.c 28 Mar 2015 18:35:43 -0000 @@ -170,22 +170,7 @@ mark(SCR *sp, VICMD *vp, enum which cmd) * Delete cursor motion was always to the start of the text region, * regardless. Ignore other motion commands. */ -#ifdef HISTORICAL_PRACTICE - if (ISCMD(vp->rkp, 'y')) { - if ((cmd == BQMARK || - cmd == FQMARK && vp->m_start.lno != vp->m_stop.lno) && - (vp->m_start.lno > vp->m_stop.lno || - vp->m_start.lno == vp->m_stop.lno && - vp->m_start.cno > vp->m_stop.cno)) - vp->m_final = vp->m_stop; - } else if (ISCMD(vp->rkp, 'd')) - if (vp->m_start.lno > vp->m_stop.lno || - vp->m_start.lno == vp->m_stop.lno && - vp->m_start.cno > vp->m_stop.cno) - vp->m_final = vp->m_stop; -#else vp->m_final = vp->m_start; -#endif /* * Forward marks are always line oriented, and it's set in the