Skip to content

Commit 32baf54

Browse files
committed
Suppress warnings on Windows
About unused variables and a function.
1 parent ee648fa commit 32baf54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ext/io/console/console.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ ttymode_callback(VALUE args)
311311
return argp->func(argp->io, argp->farg);
312312
}
313313

314+
#if !defined _WIN32
314315
static VALUE
315316
ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter)(conmode *, void *), void *arg)
316317
{
@@ -320,6 +321,7 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
320321
cargs.farg = farg;
321322
return ttymode(io, ttymode_callback, (VALUE)&cargs, setter, arg);
322323
}
324+
#endif
323325

324326
/*
325327
* call-seq:
@@ -895,7 +897,7 @@ console_erase_line(VALUE io, VALUE val)
895897
HANDLE h;
896898
rb_console_size_t ws;
897899
COORD *pos = &ws.dwCursorPosition;
898-
DWORD written, w;
900+
DWORD w;
899901
int mode = mode_in_range(val, 2, "line erase");
900902

901903
GetOpenFile(io, fptr);
@@ -927,7 +929,7 @@ console_erase_screen(VALUE io, VALUE val)
927929
HANDLE h;
928930
rb_console_size_t ws;
929931
COORD *pos = &ws.dwCursorPosition;
930-
DWORD written, w;
932+
DWORD w;
931933
int mode = mode_in_range(val, 3, "screen erase");
932934

933935
GetOpenFile(io, fptr);
@@ -966,7 +968,6 @@ console_scroll(VALUE io, int line)
966968
rb_io_t *fptr;
967969
HANDLE h;
968970
rb_console_size_t ws;
969-
COORD *pos = &ws.dwCursorPosition;
970971

971972
GetOpenFile(io, fptr);
972973
h = (HANDLE)rb_w32_get_osfhandle(GetWriteFD(fptr));

0 commit comments

Comments
 (0)