pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: net/rtorrent default option xmlrpc option fails



On Sat 07 Oct 2017 at 23:24:36 +0000, Chavdar Ivanov wrote:
> /usr/include/g++/bits/stl_algo.h:936:30:   required from '_FIter
> std::remove_if(_FIter, _FIter, _Predicate) [with _FIter = kevent*;
> _Predicate = rak::equal_t<torrent::Event*, rak::mem_ref_t<kevent, long int>
> >]'
> poll_kqueue.cc:316:83:   required from here
> ../../rak/functional.h:97:16: warning: ISO C++ forbids comparison between
> pointer and integer [-fpermissive]
>      return m_t == m_f(a);
>                 ^

This can be gotten around with the following patch:


$NetBSD$

--- src/torrent/poll_kqueue.cc.orig	2015-08-08 15:01:32.000000000 +0000
+++ src/torrent/poll_kqueue.cc
@@ -111,7 +111,7 @@ PollKQueue::modify(Event* event, unsigne
   struct kevent* itr = m_changes + (m_changedEvents++);
 
   assert(event == m_table[event->file_descriptor()].second);
-  EV_SET(itr, event->file_descriptor(), mask, op, 0, 0, event);
+  EV_SET(itr, event->file_descriptor(), mask, op, 0, 0, (intptr_t)event);
 }
 
 PollKQueue*
@@ -309,11 +309,11 @@ PollKQueue::close(Event* event) {
 
   // Shouldn't be needed anymore.
   for (struct kevent *itr = m_events, *last = m_events + m_waitingEvents; itr != last; ++itr)
-    if (itr->udata == event)
+    if (itr->udata == (intptr_t)event)
       itr->udata = NULL;
 
   m_changedEvents = std::remove_if(m_changes, m_changes + m_changedEvents,
-                                   rak::equal(event, rak::mem_ref(&kevent::udata))) - m_changes;
+                                   rak::equal((intptr_t)event, rak::mem_ref(&kevent::udata))) - m_changes;
 }
 
 void
@@ -335,11 +335,11 @@ PollKQueue::closed(Event* event) {
 
   // Shouldn't be needed anymore.
   for (struct kevent *itr = m_events, *last = m_events + m_waitingEvents; itr != last; ++itr)
-    if (itr->udata == event)
+    if (itr->udata == (intptr_t)event)
       itr->udata = NULL;
 
   m_changedEvents = std::remove_if(m_changes, m_changes + m_changedEvents,
-                                   rak::equal(event, rak::mem_ref(&kevent::udata))) - m_changes;
+                                   rak::equal((intptr_t)event, rak::mem_ref(&kevent::udata))) - m_changes;
 }
 
 // Use custom defines for EPOLL* to make the below code compile with


-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- Wayland: Those who don't understand X
\X/ rhialto/at/falu.nl      -- are condemned to reinvent it. Poorly.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index