218 lines
6.9 KiB
Diff
218 lines
6.9 KiB
Diff
|
diff -ru FreeWnn-1.1.1-a017.orig/Xsi/Wnn/jserver/de.c FreeWnn-1.1.1-a017/Xsi/Wnn/jserver/de.c
|
|||
|
--- FreeWnn-1.1.1-a017.orig/Xsi/Wnn/jserver/de.c 2000-03-20 17:31:43.000000000 +0100
|
|||
|
+++ FreeWnn-1.1.1-a017/Xsi/Wnn/jserver/de.c 2002-11-03 20:25:27.000000000 +0100
|
|||
|
@@ -158,11 +158,11 @@
|
|||
|
|
|||
|
int cur_clp; /** <20><><EFBFBD>ߤΥ<DFA4><CEA5>饤<EFBFBD><E9A5A4><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ֹ<EFBFBD> **/
|
|||
|
|
|||
|
-static int *all_socks; /** <20>ӥåȥѥ<C8A5><D1A5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
+static fd_set *all_socks; /** <20>ӥåȥѥ<C8A5><D1A5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
which jserver to select <20><><EFBFBD>ݻ<EFBFBD> **/
|
|||
|
-static int *ready_socks; /** <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>Ƥ<EFBFBD><C6A4>륽<EFBFBD><EBA5BD><EFBFBD>åȤ<C3A5>
|
|||
|
+static fd_set *ready_socks; /** <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>Ƥ<EFBFBD><C6A4>륽<EFBFBD><EBA5BD><EFBFBD>åȤ<C3A5>
|
|||
|
<20>ӥåȥѥ<C8A5><D1A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD> **/
|
|||
|
-static int *dummy1_socks, *dummy2_socks;
|
|||
|
+static fd_set *dummy1_socks, *dummy2_socks;
|
|||
|
|
|||
|
static int no_of_ready_socks;
|
|||
|
static int sel_bwidth, /** bit width of all_socks **/
|
|||
|
@@ -171,9 +171,14 @@
|
|||
|
static int nofile; /** No. of files **/
|
|||
|
|
|||
|
#define BINTSIZE (sizeof(int)*8)
|
|||
|
+/*
|
|||
|
#define sock_set(array,pos) (array[pos/BINTSIZE] |= (1<<(pos%BINTSIZE)))
|
|||
|
#define sock_clr(array,pos) (array[pos/BINTSIZE] &= ~(1<<(pos%BINTSIZE)))
|
|||
|
#define sock_tst(array,pos) (array[pos/BINTSIZE] & (1<<(pos%BINTSIZE)))
|
|||
|
+*/
|
|||
|
+#define sock_set(array,pos) FD_SET(pos,array)
|
|||
|
+#define sock_clr(array,pos) FD_CLR(pos,array)
|
|||
|
+#define sock_tst(array,pos) FD_ISSET(pos,array)
|
|||
|
|
|||
|
struct msg_cat *wnn_msg_cat;
|
|||
|
struct msg_cat *js_msg_cat;
|
|||
|
@@ -312,7 +317,7 @@
|
|||
|
for (;;)
|
|||
|
{
|
|||
|
#ifdef DEBUG
|
|||
|
- error1 ("main loop: ready_socks = %02X\n", ready_socks);
|
|||
|
+ error1 ("main loop: ready_socks = %02lX\n", ready_socks[0]);
|
|||
|
#endif
|
|||
|
if (get_client () == -1)
|
|||
|
break;
|
|||
|
@@ -341,11 +346,11 @@
|
|||
|
|
|||
|
nofile = NOFILE;
|
|||
|
sel_w = (nofile - 1) / BINTSIZE + 1;
|
|||
|
- all_socks = (int *) calloc (sel_w, (sizeof (int)));
|
|||
|
- ready_socks = (int *) malloc (sel_w * (sizeof (int)));
|
|||
|
- dummy1_socks = (int *) malloc (sel_w * (sizeof (int)));
|
|||
|
- dummy2_socks = (int *) malloc (sel_w * (sizeof (int)));
|
|||
|
- sel_width = sel_w * sizeof (int); /* byte width */
|
|||
|
+ all_socks = (fd_set *) calloc (sel_w, (sizeof (fd_set)));
|
|||
|
+ ready_socks = (fd_set *) malloc (sel_w * (sizeof (fd_set)));
|
|||
|
+ dummy1_socks = (fd_set *) malloc (sel_w * (sizeof (fd_set)));
|
|||
|
+ dummy2_socks = (fd_set *) malloc (sel_w * (sizeof (fd_set)));
|
|||
|
+ sel_width = sel_w * sizeof (fd_set); /* byte width */
|
|||
|
sel_bwidth = sel_width * 8; /* bit width */
|
|||
|
}
|
|||
|
|
|||
|
@@ -366,7 +371,7 @@
|
|||
|
xerror ("select error");
|
|||
|
}
|
|||
|
#ifdef DEBUG
|
|||
|
- error1 ("select OK, ready_socks[0]=%02X, n-r-s=%x\n", ready_socks[0], no_of_ready_socks);
|
|||
|
+ error1 ("select OK, ready_socks[0]=%02lX, n-r-s=%x\n", ready_socks[0], no_of_ready_socks);
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
diff -ru FreeWnn-1.1.1-a017.orig/Xsi/Wnn/uum/jhlp.c FreeWnn-1.1.1-a017/Xsi/Wnn/uum/jhlp.c
|
|||
|
--- FreeWnn-1.1.1-a017.orig/Xsi/Wnn/uum/jhlp.c 2000-02-23 17:08:49.000000000 +0100
|
|||
|
+++ FreeWnn-1.1.1-a017/Xsi/Wnn/uum/jhlp.c 2002-11-03 22:25:09.000000000 +0100
|
|||
|
@@ -134,7 +134,7 @@
|
|||
|
static void do_end (), open_pty (), open_ttyp (), do_main (), exec_cmd (), parse_options (), setsize (), get_rubout (), usage (), change_size (), default_usage ();
|
|||
|
|
|||
|
/** <20>ᥤ<EFBFBD><E1A5A4> */
|
|||
|
-void
|
|||
|
+int
|
|||
|
main (argc, argv)
|
|||
|
int argc;
|
|||
|
char **argv;
|
|||
|
@@ -923,7 +923,7 @@
|
|||
|
|
|||
|
/** <20>ᥤ<EFBFBD><E1A5A4><EFBFBD>롼<EFBFBD><EBA1BC> */
|
|||
|
|
|||
|
-int sel_ptn;
|
|||
|
+fd_set sel_ptn;
|
|||
|
int pty_bit;
|
|||
|
int tty_bit;
|
|||
|
int ptyfd;
|
|||
|
@@ -947,7 +947,8 @@
|
|||
|
|
|||
|
pty_bit = 1 << ptyfd;
|
|||
|
tty_bit = 1 << ttyfd;
|
|||
|
- sel_ptn = pty_bit | tty_bit;
|
|||
|
+ FD_SET (ptyfd, &sel_ptn);
|
|||
|
+ FD_SET (ttyfd, &sel_ptn);
|
|||
|
|
|||
|
if (henkan_off_flag == 0)
|
|||
|
{
|
|||
|
@@ -1020,8 +1021,9 @@
|
|||
|
static unsigned char *bufend = outbuf;
|
|||
|
static unsigned char *bufstart = outbuf;
|
|||
|
int n;
|
|||
|
- int rfds;
|
|||
|
- int i, j, mask;
|
|||
|
+ fd_set rfds;
|
|||
|
+ int i, j;
|
|||
|
+ fd_set mask;
|
|||
|
unsigned char *p;
|
|||
|
extern int henkan_off_flag;
|
|||
|
struct timeval time_out; /* If your OS's select was implemented as
|
|||
|
@@ -1063,9 +1065,9 @@
|
|||
|
time_out.tv_usec = 200 * 1000; /* 200 msec <20><><EFBFBD>ԤĤΤ<C4A4><CEA4><EFBFBD>! */
|
|||
|
for (rfds = sel_ptn;
|
|||
|
#ifdef linux
|
|||
|
- (sel_ret = select (20, &rfds, 0, 0, NULL)) < 0 && errno == EINTR;
|
|||
|
+ (sel_ret = select (20, &rfds, NULL, NULL, NULL)) < 0 && errno == EINTR;
|
|||
|
#else
|
|||
|
- (sel_ret = select (20, &rfds, 0, 0, &time_out)) < 0 && errno == EINTR;
|
|||
|
+ (sel_ret = select (20, &rfds, NULL, NULL, &time_out)) < 0 && errno == EINTR;
|
|||
|
#endif
|
|||
|
rfds = sel_ptn)
|
|||
|
;
|
|||
|
@@ -1084,7 +1086,7 @@
|
|||
|
*/
|
|||
|
}
|
|||
|
|
|||
|
- if (rfds & pty_bit)
|
|||
|
+ if (FD_ISSET(ptyfd, &rfds))
|
|||
|
{
|
|||
|
if ((n = read (ptyfd, buf, BUFSIZ)) <= 0)
|
|||
|
{
|
|||
|
@@ -1116,13 +1118,13 @@
|
|||
|
p += j;
|
|||
|
i -= j;
|
|||
|
}
|
|||
|
- mask = 1 << ttyfd;
|
|||
|
+ FD_SET(ttyfd, &mask);
|
|||
|
select (32, 0, &mask, 0, 0);
|
|||
|
}
|
|||
|
pop_cursor ();
|
|||
|
}
|
|||
|
}
|
|||
|
- if (rfds & tty_bit)
|
|||
|
+ if (FD_ISSET(ttyfd, &rfds))
|
|||
|
{
|
|||
|
if ((n = read (ttyfd, buf, BUFSIZ)) > 0)
|
|||
|
{
|
|||
|
@@ -1778,7 +1780,7 @@
|
|||
|
{
|
|||
|
static unsigned char buf[BUFSIZ];
|
|||
|
int n;
|
|||
|
- int rfds;
|
|||
|
+ fd_set rfds;
|
|||
|
|
|||
|
kk_restore_cursor ();
|
|||
|
clr_line_all ();
|
|||
|
@@ -1791,7 +1793,7 @@
|
|||
|
write (ptyfd, buf, n);
|
|||
|
}
|
|||
|
rfds = sel_ptn;
|
|||
|
- select (20, &rfds, 0, 0, NULL);
|
|||
|
+ select (20, &rfds, NULL, NULL, NULL);
|
|||
|
if (rfds & pty_bit)
|
|||
|
{
|
|||
|
if ((n = read (ptyfd, buf, BUFSIZ)) <= 0)
|
|||
|
diff -ru FreeWnn-1.1.1-a017.orig/Xsi/Xwnmo/xwnmo/do_socket.c FreeWnn-1.1.1-a017/Xsi/Xwnmo/xwnmo/do_socket.c
|
|||
|
--- FreeWnn-1.1.1-a017.orig/Xsi/Xwnmo/xwnmo/do_socket.c 2000-02-23 18:03:22.000000000 +0100
|
|||
|
+++ FreeWnn-1.1.1-a017/Xsi/Xwnmo/xwnmo/do_socket.c 2002-11-03 20:25:17.000000000 +0100
|
|||
|
@@ -90,9 +90,9 @@
|
|||
|
XIMCmblk *cblk;
|
|||
|
XIMCmblk *cur_cblk = NULL;
|
|||
|
|
|||
|
-int *all_socks;
|
|||
|
-int *ready_socks;
|
|||
|
-static int *dummy1_socks, *dummy2_socks;
|
|||
|
+fd_set *all_socks;
|
|||
|
+fd_set *ready_socks;
|
|||
|
+static fd_set *dummy1_socks, *dummy2_socks;
|
|||
|
static int sel_width;
|
|||
|
|
|||
|
static int nofile;
|
|||
|
@@ -114,9 +114,14 @@
|
|||
|
static int rc = 0;
|
|||
|
|
|||
|
#define BINTSIZE (sizeof(int)*8)
|
|||
|
+/*
|
|||
|
#define sock_set(array,pos) (array[pos/BINTSIZE] |= (1<<(pos%BINTSIZE)))
|
|||
|
#define sock_clr(array,pos) (array[pos/BINTSIZE] &= ~(1<<(pos%BINTSIZE)))
|
|||
|
-#define sock_tst(array,pos) (array[pos/BINTSIZE] & (1<<(pos%BINTSIZE)))
|
|||
|
+#define sock_tst(array,pos) (array[pos/BINTSIZE] & (1<<(pos%BINTSIZE)))
|
|||
|
+*/
|
|||
|
+#define sock_set(array,pos) FD_SET(pos,array)
|
|||
|
+#define sock_clr(array,pos) FD_CLR(pos,array)
|
|||
|
+#define sock_tst(array,pos) FD_ISSET(pos,array)
|
|||
|
|
|||
|
extern int read (), write ();
|
|||
|
|
|||
|
--- FreeWnn-1.1.1-a017/Xsi/Wnn/jserver/error.c 2002/11/05 14:57:21 1.1
|
|||
|
+++ FreeWnn-1.1.1-a017/Xsi/Wnn/jserver/error.c 2002/11/05 14:58:12
|
|||
|
@@ -47,7 +47,7 @@
|
|||
|
void
|
|||
|
error_exit1 (x, y1, y2, y3, y4, y5)
|
|||
|
char *x;
|
|||
|
- int y1, y2, y3, y4, y5;
|
|||
|
+ long y1, y2, y3, y4, y5;
|
|||
|
{
|
|||
|
char buf[512];
|
|||
|
|
|||
|
@@ -112,7 +112,7 @@
|
|||
|
void
|
|||
|
error1 (x, y1, y2, y3, y4, y5)
|
|||
|
register char *x;
|
|||
|
- int y1, y2, y3, y4, y5;
|
|||
|
+ long y1, y2, y3, y4, y5;
|
|||
|
{
|
|||
|
char buf[512];
|