r15226@tombo: nickm | 2008-04-17 15:25:25 -0400

Fix a couple of gcc warnings on 64-bit platforms


svn:r719
This commit is contained in:
Nick Mathewson 2008-04-17 19:25:35 +00:00
parent 8863ff7625
commit 3eb21c0d33
2 changed files with 5 additions and 4 deletions

View File

@ -67,7 +67,7 @@ static struct event *events;
static void
read_cb(int fd, short which, void *arg)
{
int idx = (int) arg, widx = idx + 1;
long idx = (long) arg, widx = idx + 1;
u_char ch;
count += read(fd, &ch, sizeof(ch));
@ -83,7 +83,8 @@ read_cb(int fd, short which, void *arg)
static struct timeval *
run_once(void)
{
int *cp, i, space;
int *cp, space;
long i;
static struct timeval ts, te;
for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {

View File

@ -65,7 +65,7 @@ static void
read_cb(int fd, short which, void *arg)
{
char ch;
int idx = (int) arg;
long idx = (long) arg;
read(fd, &ch, sizeof(ch));
if (idx >= 0)
@ -95,7 +95,7 @@ run_once(int num_pipes)
}
for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
int fd = i < num_pipes - 1 ? cp[3] : -1;
long fd = i < num_pipes - 1 ? cp[3] : -1;
event_set(&events[i], cp[0], EV_READ, read_cb, (void *) fd);
event_add(&events[i], NULL);
}