Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Mar 14, 2024
1 parent f291602 commit 0438b13
Show file tree
Hide file tree
Showing 133 changed files with 437 additions and 464 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

exclude: '^3rdparty'
exclude: '^3rdparty|COPYING.*|src/jdns'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
Expand Down
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ questions:
goal:
support xmpp-core for tcp/httpbind
xmpp-core should be "just another protocol"

6 changes: 3 additions & 3 deletions cmake/modules/FindQJDns.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ endif ()
if ( UNIX AND NOT( APPLE OR CYGWIN ) )
find_package( PkgConfig QUIET )
pkg_check_modules( PC_QJDns QUIET jdns )
set ( QJDns_DEFINITIONS
set ( QJDns_DEFINITIONS
${PC_QJDns_CFLAGS}
${PC_QJDns_CFLAGS_OTHER}
)
endif ( UNIX AND NOT( APPLE OR CYGWIN ) )

set ( LIBINCS
set ( LIBINCS
qjdns.h
)

Expand All @@ -69,7 +69,7 @@ set(QJDns_NAMES
find_library(
QJDns_LIBRARY
NAMES ${QJDns_NAMES}
HINTS
HINTS
${PC_QJDns_LIBDIR}
${PC_QJDns_LIBRARY_DIRS}
${QJDNS_DIR}/lib
Expand Down
1 change: 0 additions & 1 deletion cmake/modules/policyRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ if(NOT POLICY_SET)
endif()
set(POLICY_SET ON)
endif()

6 changes: 3 additions & 3 deletions conf_win.pri.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ LIBS += -L$$WINLOCAL_PREFIX/lib

# zlib may have a different lib name depending on how it was compiled
win32-g++ {
LIBS += -lz
LIBS += -lz
}
else {
LIBS += -lzlib # static
#LIBS += -lzdll # dll
LIBS += -lzlib # static
#LIBS += -lzdll # dll
}
6 changes: 3 additions & 3 deletions confapp_win.pri.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ LIBS += -L$$WINLOCAL_PREFIX/lib

# zlib may have a different lib name depending on how it was compiled
win32-g++ {
LIBS += -lz
LIBS += -lz
}
else {
LIBS += -lzlib # static
#LIBS += -lzdll # dll
LIBS += -lzlib # static
#LIBS += -lzdll # dll
}
2 changes: 1 addition & 1 deletion qcm/extra.qcm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public:
}
if (universal) {
str += "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n"
" CONFIG += x86 ppc\n"
" CONFIG += x86 ppc\n"
"}\n";

if (!sdk.isEmpty())
Expand Down
2 changes: 1 addition & 1 deletion qcm/universal.qcm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public:
qc_universal_enabled = true;

QString str = "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n"
" CONFIG += x86 ppc\n"
" CONFIG += x86 ppc\n"
"}\n";

QString sdk = qc_getenv("QC_MAC_SDK");
Expand Down
14 changes: 7 additions & 7 deletions src/irisnet/appledns/appledns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ class AppleProvider : public XMPP::IrisNetProvider {
connect(&dns, SIGNAL(regResult(int, QDnsSd::RegResult)), SLOT(dns_regResult(int, QDnsSd::RegResult)));
}

virtual XMPP::NameProvider * createNameProviderInternet();
virtual XMPP::NameProvider * createNameProviderLocal();
virtual XMPP::NameProvider *createNameProviderInternet();
virtual XMPP::NameProvider *createNameProviderLocal();
virtual XMPP::ServiceProvider *createServiceProvider();

int query(QDnsSdDelegate *p, const QByteArray &name, int qType)
Expand Down Expand Up @@ -300,7 +300,7 @@ private slots:
class AppleBrowse : public QObject, public QDnsSdDelegate {
Q_OBJECT
public:
AppleProvider * global;
AppleProvider *global;
int browse_id;
QList<XMPP::ServiceInstance> instances;
QHash<int, QByteArray> pendingByQueryId; // waiting for TXT
Expand Down Expand Up @@ -421,7 +421,7 @@ class AppleBrowse : public QObject, public QDnsSdDelegate {
class AppleBrowseLookup : public QObject, public QDnsSdDelegate {
Q_OBJECT
public:
AppleProvider * global;
AppleProvider *global;
int resolve_id;
XMPP::NameResolver nameResolverAaaa;
XMPP::NameResolver nameResolverA;
Expand Down Expand Up @@ -614,7 +614,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate
public:
AppleServiceProvider *parent;
int id;
AppleBrowse * browse;
AppleBrowse *browse;

Browse(AppleServiceProvider *_parent) : parent(_parent), id(-1), browse(0) { }

Expand All @@ -629,7 +629,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate
public:
AppleServiceProvider *parent;
int id;
AppleBrowseLookup * resolve;
AppleBrowseLookup *resolve;

Resolve(AppleServiceProvider *_parent) : parent(_parent), id(-1), resolve(0) { }

Expand All @@ -640,7 +640,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate
}
};

AppleProvider * global;
AppleProvider *global;
QList<Browse *> browseList;
QList<Resolve *> resolveList;
IdManager idManager;
Expand Down
16 changes: 8 additions & 8 deletions src/irisnet/appledns/qdnssd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ class IdManager {
class QDnsSd::Private : public QObject {
Q_OBJECT
public:
QDnsSd * q;
QDnsSd *q;
IdManager idManager;

class SubRecord {
public:
Private * _self;
Private *_self;
int _id;
RecordRef *_sdref;

Expand All @@ -198,13 +198,13 @@ class QDnsSd::Private : public QObject {
public:
enum Type { Query, Browse, Resolve, Reg };

Private * _self;
Private *_self;
int _type;
int _id;
ServiceRef * _sdref;
ServiceRef *_sdref;
int _sockfd;
SafeSocketNotifier *_sn_read;
SafeTimer * _errorTrigger;
SafeTimer *_errorTrigger;

bool _doSignal;
LowLevelError _lowLevelError;
Expand Down Expand Up @@ -522,7 +522,7 @@ private slots:
void sn_activated()
{
SafeSocketNotifier *sn_read = static_cast<SafeSocketNotifier *>(sender());
Request * req = _requestsBySocket.value(sn_read);
Request *req = _requestsBySocket.value(sn_read);
if (!req)
return;

Expand Down Expand Up @@ -627,7 +627,7 @@ private slots:
void doError()
{
SafeTimer *t = static_cast<SafeTimer *>(sender());
Request * req = _requestsByTimer.value(t);
Request *req = _requestsByTimer.value(t);
if (!req)
return;

Expand Down Expand Up @@ -886,7 +886,7 @@ QList<QByteArray> QDnsSd::parseTxtRecord(const QByteArray &txtRecord)
for (int n = 0; n < count; ++n) {
QByteArray keyBuf(256, 0);
uint8_t valueLen;
const void * value;
const void *value;
DNSServiceErrorType err = TXTRecordGetItemAtIndex(txtRecord.size(), txtRecord.data(), n, keyBuf.size(),
keyBuf.data(), &valueLen, &value);
if (err != kDNSServiceErr_NoError)
Expand Down
2 changes: 1 addition & 1 deletion src/irisnet/appledns/sdtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class App : public QObject {
Q_OBJECT
public:
QList<Command> commands;
QDnsSd * dns;
QDnsSd *dns;

App()
{
Expand Down
4 changes: 2 additions & 2 deletions src/irisnet/corelib/addressresolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AddressResolver::Private : public QObject {
public:
enum State { AddressWait, AddressFirstCome };

AddressResolver * q;
AddressResolver *q;
ObjectSession sess;
State state;
NameResolver req6;
Expand All @@ -37,7 +37,7 @@ class AddressResolver::Private : public QObject {
bool done4;
QList<QHostAddress> addrs6;
QList<QHostAddress> addrs4;
QTimer * opTimer;
QTimer *opTimer;

Private(AddressResolver *_q) : QObject(_q), q(_q), sess(this), req6(this), req4(this)
{
Expand Down
2 changes: 1 addition & 1 deletion src/irisnet/corelib/irisnetglobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern IrisNetProvider *irisnet_createAppleProvider();
class PluginInstance {
private:
QPluginLoader *_loader = nullptr;
QObject * _instance = nullptr;
QObject *_instance = nullptr;
bool _ownInstance = false;

PluginInstance() { }
Expand Down
8 changes: 4 additions & 4 deletions src/irisnet/corelib/netinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private slots:

private:
// this are all protected by m
NetInterfaceProvider * c;
NetInterfaceProvider *c;
QMutex m;
QList<NetInterfaceProvider::Info> info;
};
Expand Down Expand Up @@ -172,11 +172,11 @@ class NetTrackerThread : public QThread {

private:
QWaitCondition startCond;
QMutex * startMutex = nullptr;
QMutex *startMutex = nullptr;
// these are all protected by global nettracker_mutex.
int refs = 0;
static NetTrackerThread *self;
NetTracker * nettracker = nullptr;
NetTracker *nettracker = nullptr;
};

NetTrackerThread *NetTrackerThread::self = nullptr;
Expand Down Expand Up @@ -250,7 +250,7 @@ class NetInterfaceManagerPrivate : public QObject {

QList<NetInterfaceProvider::Info> info;
QList<NetInterface *> listeners;
NetTrackerThread * tracker;
NetTrackerThread *tracker;

bool pending;

Expand Down
4 changes: 2 additions & 2 deletions src/irisnet/corelib/netinterface_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static QHostAddress linux_ipv6_to_qaddr(const QString &in)
quint8 raw[16];
for (int n = 0; n < 16; ++n) {
bool ok;
int x = QStringView{in}.mid(n * 2, 2).toInt(&ok, 16);
int x = QStringView { in }.mid(n * 2, 2).toInt(&ok, 16);
if (!ok)
return out;
raw[n] = (quint8)x;
Expand All @@ -92,7 +92,7 @@ static QHostAddress linux_ipv4_to_qaddr(const QString &in)
unsigned char *rawp = (unsigned char *)&raw;
for (int n = 0; n < 4; ++n) {
bool ok;
int x = QStringView{in}.mid(n * 2, 2).toInt(&ok, 16);
int x = QStringView { in }.mid(n * 2, 2).toInt(&ok, 16);
if (!ok)
return out;
rawp[n] = (unsigned char)x;
Expand Down
9 changes: 4 additions & 5 deletions src/irisnet/corelib/netnames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#endif
#include <limits>

//#define NETNAMES_DEBUG
// #define NETNAMES_DEBUG
#ifdef NETNAMES_DEBUG
#define NNDEBUG (qDebug() << this << "#" << __FUNCTION__ << ":")
#endif
Expand Down Expand Up @@ -308,8 +308,8 @@ QDebug operator<<(QDebug dbg, XMPP::NameRecord::Type type)

QDebug operator<<(QDebug dbg, const XMPP::NameRecord &record)
{
dbg.nospace() << "XMPP::NameRecord("
<< "owner=" << record.owner() << ", ttl=" << record.ttl() << ", type=" << record.type();
dbg.nospace() << "XMPP::NameRecord(" << "owner=" << record.owner() << ", ttl=" << record.ttl()
<< ", type=" << record.type();

switch (record.type()) {
case XMPP::NameRecord::A:
Expand Down Expand Up @@ -362,8 +362,7 @@ class ServiceInstance::Private : public QSharedData {
ServiceInstance::ServiceInstance() : d(new Private) { }

ServiceInstance::ServiceInstance(const QString &instance, const QString &type, const QString &domain,
const QMap<QString, QByteArray> &attribs) :
d(new Private)
const QMap<QString, QByteArray> &attribs) : d(new Private)
{
d->instance = instance;
d->type = type;
Expand Down
Loading

0 comments on commit 0438b13

Please sign in to comment.