mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Use void casts to suppress some "unchecked return value" warns
This commit is contained in:
parent
44b2491bcd
commit
7080d55c49
@ -76,7 +76,7 @@ read_cb(evutil_socket_t fd, short which, void *arg)
|
|||||||
if (writes) {
|
if (writes) {
|
||||||
if (widx >= num_pipes)
|
if (widx >= num_pipes)
|
||||||
widx -= num_pipes;
|
widx -= num_pipes;
|
||||||
send(pipes[2 * widx + 1], "e", 1, 0);
|
(void) send(pipes[2 * widx + 1], "e", 1, 0);
|
||||||
writes--;
|
writes--;
|
||||||
fired++;
|
fired++;
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ run_once(void)
|
|||||||
space = num_pipes / num_active;
|
space = num_pipes / num_active;
|
||||||
space = space * 2;
|
space = space * 2;
|
||||||
for (i = 0; i < num_active; i++, fired++)
|
for (i = 0; i < num_active; i++, fired++)
|
||||||
send(pipes[i * space + 1], "e", 1, 0);
|
(void) send(pipes[i * space + 1], "e", 1, 0);
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
writes = num_writes;
|
writes = num_writes;
|
||||||
|
@ -69,7 +69,7 @@ read_cb(evutil_socket_t fd, short which, void *arg)
|
|||||||
char ch;
|
char ch;
|
||||||
evutil_socket_t sock = (evutil_socket_t)(ev_intptr_t)arg;
|
evutil_socket_t sock = (evutil_socket_t)(ev_intptr_t)arg;
|
||||||
|
|
||||||
recv(fd, &ch, sizeof(ch), 0);
|
(void) recv(fd, &ch, sizeof(ch), 0);
|
||||||
if (sock >= 0) {
|
if (sock >= 0) {
|
||||||
if (send(sock, "e", 1, 0) < 0)
|
if (send(sock, "e", 1, 0) < 0)
|
||||||
perror("send");
|
perror("send");
|
||||||
|
@ -1573,7 +1573,7 @@ static void send_a_byte_cb(evutil_socket_t fd, short what, void *arg)
|
|||||||
{
|
{
|
||||||
evutil_socket_t *sockp = arg;
|
evutil_socket_t *sockp = arg;
|
||||||
(void) fd; (void) what;
|
(void) fd; (void) what;
|
||||||
write(*sockp, "A", 1);
|
(void) write(*sockp, "A", 1);
|
||||||
}
|
}
|
||||||
struct read_not_timeout_param
|
struct read_not_timeout_param
|
||||||
{
|
{
|
||||||
@ -1586,7 +1586,7 @@ static void read_not_timeout_cb(evutil_socket_t fd, short what, void *arg)
|
|||||||
struct read_not_timeout_param *rntp = arg;
|
struct read_not_timeout_param *rntp = arg;
|
||||||
char c;
|
char c;
|
||||||
(void) fd; (void) what;
|
(void) fd; (void) what;
|
||||||
read(fd, &c, 1);
|
(void) read(fd, &c, 1);
|
||||||
rntp->events |= what;
|
rntp->events |= what;
|
||||||
++rntp->count;
|
++rntp->count;
|
||||||
if(2 == rntp->count) event_del(rntp->ev[0]);
|
if(2 == rntp->count) event_del(rntp->ev[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user