summaryrefslogtreecommitdiff
path: root/textproc/aspell/patches/patch-ac
blob: c92d59f849203152800c2d110bffbd183d7bf580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
$NetBSD: patch-ac,v 1.6 2006/10/01 08:52:01 schwarz Exp $

--- prog/check_funs.cpp.orig	2005-06-19 14:25:01.000000000 +0200
+++ prog/check_funs.cpp	2006-09-18 21:46:40.000000000 +0200
@@ -28,6 +28,12 @@
 
 #include <signal.h>
 
+#ifdef HAVE_OLD_SIGNAL
+#define SIGNALARG2 (void (*)(...))
+#else
+#define SIGNALARG2 /* empty, no change */
+#endif
+
 #include "asc_ctype.hpp"
 #include "check_funs.hpp"
 #include "convert.hpp"
@@ -174,8 +180,8 @@
   
 static void continue_handler(int) {
   restore_state();
-  signal(SIGTSTP, suspend_handler);
-  signal(SIGCONT,  continue_handler),
+  signal(SIGTSTP, SIGNALARG2 suspend_handler);
+  signal(SIGCONT, SIGNALARG2 continue_handler),
     last_signal = 0;
 }
 
@@ -191,7 +197,7 @@
 
 static void suspend() {
   save_state();
-  signal(SIGTSTP, SIG_DFL);
+  signal(SIGTSTP, SIGNALARG2 SIG_DFL);
   raise(SIGTSTP);
   last_signal = 0;
 }
@@ -200,7 +206,7 @@
   switch (last_signal) {
   case SIGWINCH:
     resize();
-    signal(SIGWINCH, resize_handler);
+    signal(SIGWINCH, SIGNALARG2 resize_handler);
     break;
   case SIGTSTP:
     suspend();
@@ -216,7 +222,8 @@
   choice_w = 0;
   nonl();
   noecho();
-  halfdelay(1);
+  cbreak();
+  timeout(100);
   keypad(stdscr, true);
   clear();
   int height, width;
@@ -272,9 +279,9 @@
     }
   }
   if (use_curses) {
-    signal(SIGWINCH, resize_handler);
-    signal(SIGTSTP,  suspend_handler);
-    signal(SIGCONT,  continue_handler);
+    signal(SIGWINCH, SIGNALARG2 resize_handler);
+    signal(SIGTSTP, SIGNALARG2 suspend_handler);
+    signal(SIGCONT, SIGNALARG2 continue_handler);
   }
 #endif
   if (use_curses) {