Skip to content

Commit

Permalink
Fix compile error when pointer size is larger than int
Browse files Browse the repository at this point in the history
  • Loading branch information
U-238 authored and HarpyWar committed Jul 2, 2013
1 parent 74f9e4f commit 1ea1164
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pvpgn/src/common/fdwatch_kqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "fdwatch_kqueue.h"

#include <cstring>
#include <stdint.h>

#include "common/eventlog.h"
#include "fdwatch.h"
Expand Down Expand Up @@ -140,9 +141,9 @@ FDWKqueueBackend::del(int idx)
nochanges--;
if (rridx[idx] < nochanges)
{
int oidx;
intptr_t oidx;

oidx = (int)(kqchanges[nochanges].udata);
oidx = (intptr_t)(kqchanges[nochanges].udata);
if (kqchanges[nochanges].filter == EVFILT_READ &&
rridx[oidx] == nochanges)
{
Expand All @@ -169,9 +170,9 @@ FDWKqueueBackend::del(int idx)
nochanges--;
if (wridx[idx] < nochanges)
{
int oidx;
intptr_t oidx;

oidx = (int)(kqchanges[nochanges].udata);
oidx = (intptr_t)(kqchanges[nochanges].udata);
if (kqchanges[nochanges].filter == EVFILT_READ &&
rridx[oidx] == nochanges)
{
Expand Down Expand Up @@ -216,7 +217,7 @@ FDWKqueueBackend::handle()
for (unsigned i = 0; i < sr; i++)
{
/* eventlog(eventlog_level_trace, __FUNCTION__, "checking %d ident: %d read: %d write: %d", i, kqevents[i].ident, kqevents[i].filter & EVFILT_READ, kqevents[i].filter & EVFILT_WRITE); */
t_fdwatch_fd *cfd = fdw_fds + (int)kqevents[i].udata;
t_fdwatch_fd *cfd = fdw_fds + (intptr_t)kqevents[i].udata;
if (fdw_rw(cfd) & fdwatch_type_read && kqevents[i].filter == EVFILT_READ)
if (fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_read) == -2)
continue;
Expand Down

0 comments on commit 1ea1164

Please sign in to comment.