1 From 32ecfa8e89306ace726f7ad14f2b09c2aa1b96c4 Mon Sep 17 00:00:00 2001
2 From: Michal Sekletar <msekleta@redhat.com>
3 Date: Tue, 9 Feb 2016 21:02:59 +0100
4 Subject: [PATCH] Use explicit cast and prevent compiler error
5
6 ---
7 streams/wvstream.cc | 13 ++++++++-----
8 1 file changed, 8 insertions(+), 5 deletions(-)
9
10 diff --git a/streams/wvstream.cc b/streams/wvstream.cc
11 index 4564f3c..76565b4 100644
12 --- a/streams/wvstream.cc
13 +++ b/streams/wvstream.cc
14 @@ -907,9 +907,9 @@ void WvStream::_build_selectinfo(SelectInfo &si, time_t msec_timeout,
15
16 if (forceable)
17 {
18 - si.wants.readable = readcb;
19 - si.wants.writable = writecb;
20 - si.wants.isexception = exceptcb;
21 + si.wants.readable = static_cast<bool>(readcb);
22 + si.wants.writable = static_cast<bool>(writecb);
23 + si.wants.isexception = static_cast<bool>(exceptcb);
24 }
25 else
26 {
27 @@ -1019,7 +1019,7 @@ bool WvStream::_select(time_t msec_timeout, bool readable, bool writable,
28
29 IWvStream::SelectRequest WvStream::get_select_request()
30 {
31 - return IWvStream::SelectRequest(readcb, writecb, exceptcb);
32 + return IWvStream::SelectRequest(static_cast<bool>(readcb), static_cast<bool>(writecb), static_cast<bool>(exceptcb));
33 }
34
35
36 @@ -1107,7 +1107,10 @@ bool WvStream::continue_select(time_t msec_timeout)
37 // inefficient, because if the alarm was expired then pre_select()
38 // returned true anyway and short-circuited the previous select().
39 TRACE("hello-%p\n", this);
40 - return !alarm_was_ticking || select(0, readcb, writecb, exceptcb);
41 + return !alarm_was_ticking || select(0,
42 + static_cast<bool>(readcb),
43 + static_cast<bool>(writecb),
44 + static_cast<bool>(exceptcb));
45 }
46
47
48 --
49 2.5.0
|