Skip to content

Commit 0438b13

Browse files
committed
reformat code
1 parent f291602 commit 0438b13

File tree

133 files changed

+437
-464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+437
-464
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33

4-
exclude: '^3rdparty'
4+
exclude: '^3rdparty|COPYING.*|src/jdns'
55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
77
rev: v2.5.0

TODO

-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@ questions:
4343
goal:
4444
support xmpp-core for tcp/httpbind
4545
xmpp-core should be "just another protocol"
46-

cmake/modules/FindQJDns.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ endif ()
3636
if ( UNIX AND NOT( APPLE OR CYGWIN ) )
3737
find_package( PkgConfig QUIET )
3838
pkg_check_modules( PC_QJDns QUIET jdns )
39-
set ( QJDns_DEFINITIONS
39+
set ( QJDns_DEFINITIONS
4040
${PC_QJDns_CFLAGS}
4141
${PC_QJDns_CFLAGS_OTHER}
4242
)
4343
endif ( UNIX AND NOT( APPLE OR CYGWIN ) )
4444

45-
set ( LIBINCS
45+
set ( LIBINCS
4646
qjdns.h
4747
)
4848

@@ -69,7 +69,7 @@ set(QJDns_NAMES
6969
find_library(
7070
QJDns_LIBRARY
7171
NAMES ${QJDns_NAMES}
72-
HINTS
72+
HINTS
7373
${PC_QJDns_LIBDIR}
7474
${PC_QJDns_LIBRARY_DIRS}
7575
${QJDNS_DIR}/lib

cmake/modules/policyRules.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ if(NOT POLICY_SET)
1111
endif()
1212
set(POLICY_SET ON)
1313
endif()
14-

conf_win.pri.example

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ LIBS += -L$$WINLOCAL_PREFIX/lib
99

1010
# zlib may have a different lib name depending on how it was compiled
1111
win32-g++ {
12-
LIBS += -lz
12+
LIBS += -lz
1313
}
1414
else {
15-
LIBS += -lzlib # static
16-
#LIBS += -lzdll # dll
15+
LIBS += -lzlib # static
16+
#LIBS += -lzdll # dll
1717
}

confapp_win.pri.example

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ LIBS += -L$$WINLOCAL_PREFIX/lib
99

1010
# zlib may have a different lib name depending on how it was compiled
1111
win32-g++ {
12-
LIBS += -lz
12+
LIBS += -lz
1313
}
1414
else {
15-
LIBS += -lzlib # static
16-
#LIBS += -lzdll # dll
15+
LIBS += -lzlib # static
16+
#LIBS += -lzdll # dll
1717
}

qcm/extra.qcm

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public:
5858
}
5959
if (universal) {
6060
str += "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n"
61-
" CONFIG += x86 ppc\n"
61+
" CONFIG += x86 ppc\n"
6262
"}\n";
6363

6464
if (!sdk.isEmpty())

qcm/universal.qcm

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public:
2828
qc_universal_enabled = true;
2929

3030
QString str = "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n"
31-
" CONFIG += x86 ppc\n"
31+
" CONFIG += x86 ppc\n"
3232
"}\n";
3333

3434
QString sdk = qc_getenv("QC_MAC_SDK");

src/irisnet/appledns/appledns.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ class AppleProvider : public XMPP::IrisNetProvider {
223223
connect(&dns, SIGNAL(regResult(int, QDnsSd::RegResult)), SLOT(dns_regResult(int, QDnsSd::RegResult)));
224224
}
225225

226-
virtual XMPP::NameProvider * createNameProviderInternet();
227-
virtual XMPP::NameProvider * createNameProviderLocal();
226+
virtual XMPP::NameProvider *createNameProviderInternet();
227+
virtual XMPP::NameProvider *createNameProviderLocal();
228228
virtual XMPP::ServiceProvider *createServiceProvider();
229229

230230
int query(QDnsSdDelegate *p, const QByteArray &name, int qType)
@@ -300,7 +300,7 @@ private slots:
300300
class AppleBrowse : public QObject, public QDnsSdDelegate {
301301
Q_OBJECT
302302
public:
303-
AppleProvider * global;
303+
AppleProvider *global;
304304
int browse_id;
305305
QList<XMPP::ServiceInstance> instances;
306306
QHash<int, QByteArray> pendingByQueryId; // waiting for TXT
@@ -421,7 +421,7 @@ class AppleBrowse : public QObject, public QDnsSdDelegate {
421421
class AppleBrowseLookup : public QObject, public QDnsSdDelegate {
422422
Q_OBJECT
423423
public:
424-
AppleProvider * global;
424+
AppleProvider *global;
425425
int resolve_id;
426426
XMPP::NameResolver nameResolverAaaa;
427427
XMPP::NameResolver nameResolverA;
@@ -614,7 +614,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate
614614
public:
615615
AppleServiceProvider *parent;
616616
int id;
617-
AppleBrowse * browse;
617+
AppleBrowse *browse;
618618

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

@@ -629,7 +629,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate
629629
public:
630630
AppleServiceProvider *parent;
631631
int id;
632-
AppleBrowseLookup * resolve;
632+
AppleBrowseLookup *resolve;
633633

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

@@ -640,7 +640,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate
640640
}
641641
};
642642

643-
AppleProvider * global;
643+
AppleProvider *global;
644644
QList<Browse *> browseList;
645645
QList<Resolve *> resolveList;
646646
IdManager idManager;

src/irisnet/appledns/qdnssd.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ class IdManager {
176176
class QDnsSd::Private : public QObject {
177177
Q_OBJECT
178178
public:
179-
QDnsSd * q;
179+
QDnsSd *q;
180180
IdManager idManager;
181181

182182
class SubRecord {
183183
public:
184-
Private * _self;
184+
Private *_self;
185185
int _id;
186186
RecordRef *_sdref;
187187

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

201-
Private * _self;
201+
Private *_self;
202202
int _type;
203203
int _id;
204-
ServiceRef * _sdref;
204+
ServiceRef *_sdref;
205205
int _sockfd;
206206
SafeSocketNotifier *_sn_read;
207-
SafeTimer * _errorTrigger;
207+
SafeTimer *_errorTrigger;
208208

209209
bool _doSignal;
210210
LowLevelError _lowLevelError;
@@ -522,7 +522,7 @@ private slots:
522522
void sn_activated()
523523
{
524524
SafeSocketNotifier *sn_read = static_cast<SafeSocketNotifier *>(sender());
525-
Request * req = _requestsBySocket.value(sn_read);
525+
Request *req = _requestsBySocket.value(sn_read);
526526
if (!req)
527527
return;
528528

@@ -627,7 +627,7 @@ private slots:
627627
void doError()
628628
{
629629
SafeTimer *t = static_cast<SafeTimer *>(sender());
630-
Request * req = _requestsByTimer.value(t);
630+
Request *req = _requestsByTimer.value(t);
631631
if (!req)
632632
return;
633633

@@ -886,7 +886,7 @@ QList<QByteArray> QDnsSd::parseTxtRecord(const QByteArray &txtRecord)
886886
for (int n = 0; n < count; ++n) {
887887
QByteArray keyBuf(256, 0);
888888
uint8_t valueLen;
889-
const void * value;
889+
const void *value;
890890
DNSServiceErrorType err = TXTRecordGetItemAtIndex(txtRecord.size(), txtRecord.data(), n, keyBuf.size(),
891891
keyBuf.data(), &valueLen, &value);
892892
if (err != kDNSServiceErr_NoError)

src/irisnet/appledns/sdtest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class App : public QObject {
105105
Q_OBJECT
106106
public:
107107
QList<Command> commands;
108-
QDnsSd * dns;
108+
QDnsSd *dns;
109109

110110
App()
111111
{

src/irisnet/corelib/addressresolver.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AddressResolver::Private : public QObject {
2828
public:
2929
enum State { AddressWait, AddressFirstCome };
3030

31-
AddressResolver * q;
31+
AddressResolver *q;
3232
ObjectSession sess;
3333
State state;
3434
NameResolver req6;
@@ -37,7 +37,7 @@ class AddressResolver::Private : public QObject {
3737
bool done4;
3838
QList<QHostAddress> addrs6;
3939
QList<QHostAddress> addrs4;
40-
QTimer * opTimer;
40+
QTimer *opTimer;
4141

4242
Private(AddressResolver *_q) : QObject(_q), q(_q), sess(this), req6(this), req4(this)
4343
{

src/irisnet/corelib/irisnetglobal.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern IrisNetProvider *irisnet_createAppleProvider();
4242
class PluginInstance {
4343
private:
4444
QPluginLoader *_loader = nullptr;
45-
QObject * _instance = nullptr;
45+
QObject *_instance = nullptr;
4646
bool _ownInstance = false;
4747

4848
PluginInstance() { }

src/irisnet/corelib/netinterface.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private slots:
8888

8989
private:
9090
// this are all protected by m
91-
NetInterfaceProvider * c;
91+
NetInterfaceProvider *c;
9292
QMutex m;
9393
QList<NetInterfaceProvider::Info> info;
9494
};
@@ -172,11 +172,11 @@ class NetTrackerThread : public QThread {
172172

173173
private:
174174
QWaitCondition startCond;
175-
QMutex * startMutex = nullptr;
175+
QMutex *startMutex = nullptr;
176176
// these are all protected by global nettracker_mutex.
177177
int refs = 0;
178178
static NetTrackerThread *self;
179-
NetTracker * nettracker = nullptr;
179+
NetTracker *nettracker = nullptr;
180180
};
181181

182182
NetTrackerThread *NetTrackerThread::self = nullptr;
@@ -250,7 +250,7 @@ class NetInterfaceManagerPrivate : public QObject {
250250

251251
QList<NetInterfaceProvider::Info> info;
252252
QList<NetInterface *> listeners;
253-
NetTrackerThread * tracker;
253+
NetTrackerThread *tracker;
254254

255255
bool pending;
256256

src/irisnet/corelib/netinterface_unix.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static QHostAddress linux_ipv6_to_qaddr(const QString &in)
7474
quint8 raw[16];
7575
for (int n = 0; n < 16; ++n) {
7676
bool ok;
77-
int x = QStringView{in}.mid(n * 2, 2).toInt(&ok, 16);
77+
int x = QStringView { in }.mid(n * 2, 2).toInt(&ok, 16);
7878
if (!ok)
7979
return out;
8080
raw[n] = (quint8)x;
@@ -92,7 +92,7 @@ static QHostAddress linux_ipv4_to_qaddr(const QString &in)
9292
unsigned char *rawp = (unsigned char *)&raw;
9393
for (int n = 0; n < 4; ++n) {
9494
bool ok;
95-
int x = QStringView{in}.mid(n * 2, 2).toInt(&ok, 16);
95+
int x = QStringView { in }.mid(n * 2, 2).toInt(&ok, 16);
9696
if (!ok)
9797
return out;
9898
rawp[n] = (unsigned char)x;

src/irisnet/corelib/netnames.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#endif
2929
#include <limits>
3030

31-
//#define NETNAMES_DEBUG
31+
// #define NETNAMES_DEBUG
3232
#ifdef NETNAMES_DEBUG
3333
#define NNDEBUG (qDebug() << this << "#" << __FUNCTION__ << ":")
3434
#endif
@@ -308,8 +308,8 @@ QDebug operator<<(QDebug dbg, XMPP::NameRecord::Type type)
308308

309309
QDebug operator<<(QDebug dbg, const XMPP::NameRecord &record)
310310
{
311-
dbg.nospace() << "XMPP::NameRecord("
312-
<< "owner=" << record.owner() << ", ttl=" << record.ttl() << ", type=" << record.type();
311+
dbg.nospace() << "XMPP::NameRecord(" << "owner=" << record.owner() << ", ttl=" << record.ttl()
312+
<< ", type=" << record.type();
313313

314314
switch (record.type()) {
315315
case XMPP::NameRecord::A:
@@ -362,8 +362,7 @@ class ServiceInstance::Private : public QSharedData {
362362
ServiceInstance::ServiceInstance() : d(new Private) { }
363363

364364
ServiceInstance::ServiceInstance(const QString &instance, const QString &type, const QString &domain,
365-
const QMap<QString, QByteArray> &attribs) :
366-
d(new Private)
365+
const QMap<QString, QByteArray> &attribs) : d(new Private)
367366
{
368367
d->instance = instance;
369368
d->type = type;

0 commit comments

Comments
 (0)