fep - uses non-portable CTRL macro

Rob McMahon cudcv at warwick.ac.uk
Wed Dec 21 05:04:29 AEST 1988


Fep relies on the old macro for CTRL, (CTRL(c) -> ('c'&037)), which doesn't
work on all compilers, and won't work on any ANSI compiler.

-- 
RCS file: fep_com.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** /tmp/,RCSt1a03848	Tue Dec 20 18:58:15 1988
--- /tmp/,RCSt2a03848	Tue Dec 20 18:58:16 1988
***************
*** 15,20 ****
--- 15,22 ----
  #include "fep_defs.h"
  #include "fep_glob.h"
  #include "fep_funcs.h"
+ #undef CTRL
+ #define CTRL(x) ((x) & 037)
  
  int	tty_fix_bell = OFF;	/* ring bell if the tty mode is changed */
  
***************
*** 595,605 ****
  	    --sline;
  	    break;
  
! 	case 'd': case CTRL(D):
  	    sline /= 2;
  	    break;
  
! 	case 'q': case 'Q': case CTRL(C):
  	    DELMORE;
  	    return (0);
  
--- 597,607 ----
  	    --sline;
  	    break;
  
! 	case 'd': case CTRL('D'):
  	    sline /= 2;
  	    break;
  
! 	case 'q': case 'Q': case CTRL('C'):
  	    DELMORE;
  	    return (0);
  

-- 
RCS file: fep_vi.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** /tmp/,RCSt1a03856	Tue Dec 20 19:00:00 1988
--- /tmp/,RCSt2a03856	Tue Dec 20 19:00:03 1988
***************
*** 11,16 ****
--- 11,18 ----
  #include "fep_defs.h"
  #include "fep_glob.h"
  #include "fep_funcs.h"
+ #undef CTRL
+ #define CTRL(x) ((x) & 037)
  
  enum {INSERTMODE, COMMANDMODE} vi_mode = COMMANDMODE;
  int vi_count;
***************
*** 264,270 ****
  	    (void) backward_character ();
  	    break;
  
! 	case CTRL(U):
  	    (void) delete_line (c);
  	    (void) altenateEditmode ();
  	    break;
--- 266,272 ----
  	    (void) backward_character ();
  	    break;
  
! 	case CTRL('U'):
  	    (void) delete_line (c);
  	    (void) altenateEditmode ();
  	    break;
***************
*** 488,506 ****
  {
      switch (c) {
  
! 	case CTRL(H):
  	    (void) delete_previous_character (c);
  	    break;
  
! 	case CTRL(W):
  	    (void) delete_previous_word (c);
  	    break;
  
! 	case CTRL(U):
  	    (void) delete_line (c);
  	    break;
  
! 	case CTRL(V):
  	    (void) literal_next (c);
  	    break;
  
--- 490,508 ----
  {
      switch (c) {
  
! 	case CTRL('H'):
  	    (void) delete_previous_character (c);
  	    break;
  
! 	case CTRL('W'):
  	    (void) delete_previous_word (c);
  	    break;
  
! 	case CTRL('U'):
  	    (void) delete_line (c);
  	    break;
  
! 	case CTRL('V'):
  	    (void) literal_next (c);
  	    break;
  
-- 
Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv at uk.ac.warwick             ARPA:   cudcv at warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England



More information about the Comp.sources.bugs mailing list