Ticket #1269 (closed defect: duplicate)
Compile error in rev 1040, file src/rpc/xmlrpc.cc
| Reported by: | VesselinK | Owned by: | rakshasa |
|---|---|---|---|
| Priority: | normal | Component: | libtorrent |
| Version: | HEAD | Severity: | normal |
| Keywords: | Cc: |
Description
Method set_size_limitis is declared in src/rpc/xmlrpc.h as
static void set_size_limit(uint64_t size);
It is defined in src/rpc/xmlrpc.cc as:
XmlRpc::set_size_limit(int64_t size) {}
As a result I get the following compile error: g++ -DHAVE_CONFIG_H -I. -I../.. -I. -I./.. -I../.. -O2 -Wall -g -DDEBUG -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include -MT xmlrpc.o -MD -MP -MF .deps/xmlrpc.Tpo -c -o xmlrpc.o xmlrpc.cc xmlrpc.cc:540: prototype for `void rpc::XmlRpc::set_size_limit(long long int)'
does not match any in class `rpc::XmlRpc?'
xmlrpc.h:98: candidate is: static void rpc::XmlRpc::set_size_limit(long long
unsigned int)
make[3]: *** [xmlrpc.o] Error 1 make[3]: Leaving directory `/usr/src/rtorrent/src/rpc' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/rtorrent/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/rtorrent' make: *** [all] Error 2
I presume uint64_t is the correct type. The fix is trivial:
============================================= --- src/rpc/xmlrpc.cc (revision 1040) +++ src/rpc/xmlrpc.cc (working copy) @@ -537,7 +537,7 @@
bool XmlRpc::process(UNUSED const char* inBuffer, UNUSED uint32_t length, UNUSED slot_write slotWrite) { return false; }
int64_t XmlRpc::size_limit() { return 0; }
-void XmlRpc::set_size_limit(int64_t size) {} +void XmlRpc::set_size_limit(uint64_t size) {}
#endif

