Fix warnings in Bonjour code

Mostly shadowing warnings and some unused functions.
This commit is contained in:
Stefan Hacker 2015-10-25 20:02:35 +01:00
parent 8ecc3d1e02
commit 99d37cffe8
6 changed files with 9 additions and 13 deletions

View File

@ -30,8 +30,8 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BonjourServiceBrowser.h"
BonjourServiceBrowser::BonjourServiceBrowser(QObject *parent)
: QObject(parent), dnssref(0), bonjourSocket(0) {
BonjourServiceBrowser::BonjourServiceBrowser(QObject *p)
: QObject(p), dnssref(0), bonjourSocket(0) {
}
BonjourServiceBrowser::~BonjourServiceBrowser() {

View File

@ -47,9 +47,6 @@ class BonjourServiceBrowser : public QObject {
inline QList<BonjourRecord> currentRecords() const {
return bonjourRecords;
}
inline QString serviceType() const {
return browsingType;
}
signals:
void currentBonjourRecordsChanged(const QList<BonjourRecord> &list);
@ -65,7 +62,6 @@ class BonjourServiceBrowser : public QObject {
DNSServiceRef dnssref;
QSocketNotifier *bonjourSocket;
QList<BonjourRecord> bonjourRecords;
QString browsingType;
};
#endif

View File

@ -31,8 +31,8 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BonjourServiceRegister.h"
BonjourServiceRegister::BonjourServiceRegister(QObject *parent)
: QObject(parent), dnssref(0), bonjourSocket(0) {
BonjourServiceRegister::BonjourServiceRegister(QObject *p)
: QObject(p), dnssref(0), bonjourSocket(0) {
}
BonjourServiceRegister::~BonjourServiceRegister() {
@ -50,7 +50,7 @@ void BonjourServiceRegister::registerService(const BonjourRecord &record, quint1
quint16 bigEndianPort = servicePort;
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
{
bigEndianPort = 0 | ((servicePort & 0x00ff) << 8) | ((servicePort & 0xff00) >> 8);
bigEndianPort = static_cast<quint16>(((servicePort & 0x00ff) << 8) | ((servicePort & 0xff00) >> 8));
}
#endif

View File

@ -41,7 +41,7 @@ class QSocketNotifier;
class BonjourServiceRegister : public QObject {
Q_OBJECT
public:
BonjourServiceRegister(QObject *parent = 0);
BonjourServiceRegister(QObject *p = 0);
~BonjourServiceRegister();
void registerService(const BonjourRecord &record, quint16 servicePort);

View File

@ -55,7 +55,7 @@ void BonjourServiceResolver::resolveBonjourRecord(const BonjourRecord &record) {
record.serviceName.toUtf8().constData(),
record.registeredType.toUtf8().constData(),
record.replyDomain.toUtf8().constData(),
(DNSServiceResolveReply)bonjourResolveReply, rr);
static_cast<DNSServiceResolveReply>(bonjourResolveReply), rr);
if (err == kDNSServiceErr_NoError) {
int sockfd = DNSServiceRefSockFD(rr->dnssref);
@ -89,7 +89,7 @@ void BonjourServiceResolver::bonjourSocketReadyRead(int sockfd) {
void BonjourServiceResolver::bonjourResolveReply(DNSServiceRef, DNSServiceFlags ,
quint32 , DNSServiceErrorType errorCode,
const char *, const char *hosttarget, quint16 port,
quint16 , const char *, void *context) {
quint16 , const unsigned char *, void *context) {
ResolveRecord *rr = static_cast<ResolveRecord *>(context);
rr->bsr->qmResolvers.remove(DNSServiceRefSockFD(rr->dnssref));

View File

@ -68,7 +68,7 @@ class BonjourServiceResolver : public QObject {
static void DNSSD_API bonjourResolveReply(DNSServiceRef sdRef, DNSServiceFlags flags,
quint32 interfaceIndex, DNSServiceErrorType errorCode,
const char *fullName, const char *hosttarget, quint16 port,
quint16 txtLen, const char *txtRecord, void *context);
quint16 txtLen, const unsigned char *txtRecord, void *context);
};
#endif