[前][次][番号順一覧][スレッド一覧]

ruby-changes:45696

From: nobu <ko1@a...>
Date: Sat, 4 Mar 2017 14:13:22 +0900 (JST)
Subject: [ruby-changes:45696] nobu:r57769 (trunk): readline.c: fix type

nobu	2017-03-04 14:13:18 +0900 (Sat, 04 Mar 2017)

  New Revision: 57769

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57769

  Log:
    readline.c: fix type
    
    * ext/readline/readline.c (getc_body): fix variable type, and
      extract _get_osfhandle.

  Modified files:
    trunk/ext/readline/readline.c
Index: ext/readline/readline.c
===================================================================
--- ext/readline/readline.c	(revision 57768)
+++ ext/readline/readline.c	(revision 57769)
@@ -164,23 +164,24 @@ getc_body(struct getc_struct *p) https://github.com/ruby/ruby/blob/trunk/ext/readline/readline.c#L164
 #if defined(_WIN32)
     {
         INPUT_RECORD ir;
-        int n;
+        DWORD n;
         static int prior_key = '0';
         for (;;) {
+            HANDLE h;
             if (prior_key > 0xff) {
                 prior_key = rl_getc(p->input);
                 return prior_key;
             }
-            if (PeekConsoleInput((HANDLE)_get_osfhandle(p->fd), &ir, 1, &n)) {
+            h = (HANDLE)_get_osfhandle(p->fd);
+            if (PeekConsoleInput(h, &ir, 1, &n)) {
                 if (n == 1) {
                     if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) {
                         prior_key = rl_getc(p->input);
                         return prior_key;
                     } else {
-                        ReadConsoleInput((HANDLE)_get_osfhandle(p->fd), &ir, 1, &n);
+                        ReadConsoleInput(h, &ir, 1, &n);
                     }
                 } else {
-                    HANDLE h = (HANDLE)_get_osfhandle(p->fd);
                     rb_w32_wait_events(&h, 1, INFINITE);
                 }
             } else {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]