Skip to content

Commit

Permalink
Fix warnings in Bonjour code
Browse files Browse the repository at this point in the history
Mostly shadowing warnings and some unused functions.
  • Loading branch information
hacst committed Oct 26, 2015
1 parent 8ecc3d1 commit 99d37cf
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/bonjour/BonjourServiceBrowser.cpp
Expand Up @@ -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() {
Expand Down
4 changes: 0 additions & 4 deletions src/bonjour/BonjourServiceBrowser.h
Expand Up @@ -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);
Expand All @@ -65,7 +62,6 @@ class BonjourServiceBrowser : public QObject {
DNSServiceRef dnssref;
QSocketNotifier *bonjourSocket;
QList<BonjourRecord> bonjourRecords;
QString browsingType;
};

#endif
6 changes: 3 additions & 3 deletions src/bonjour/BonjourServiceRegister.cpp
Expand Up @@ -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() {
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/bonjour/BonjourServiceRegister.h
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/bonjour/BonjourServiceResolver.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion src/bonjour/BonjourServiceResolver.h
Expand Up @@ -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

0 comments on commit 99d37cf

Please sign in to comment.