Whitespace cleanup in corelib/ mimetypes, plugin and thread
Done with selective application of clang-format Change-Id: Iee6bf2426de81356b6d480629ba972f980b6d93d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
3e09ac369d
commit
1be271713e
@ -174,7 +174,8 @@ bool QMimeTypeParserBase::parseNumber(QStringView n, int *target, QString *error
|
||||
}
|
||||
|
||||
#ifndef QT_NO_XMLSTREAMREADER
|
||||
struct CreateMagicMatchRuleResult {
|
||||
struct CreateMagicMatchRuleResult
|
||||
{
|
||||
QString errorMessage; // must be first
|
||||
QMimeMagicRule rule;
|
||||
|
||||
|
@ -45,7 +45,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
struct Q_CORE_EXPORT QFactoryInterface
|
||||
{
|
||||
virtual ~QFactoryInterface();
|
||||
|
@ -889,7 +889,6 @@ QLibrary::QLibrary(const QString& fileName, QObject *parent) : QObject(parent)
|
||||
setFileName(fileName);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Constructs a library object with the given \a parent that will
|
||||
load the library specified by \a fileName and major version number \a verNum.
|
||||
@ -935,7 +934,6 @@ QLibrary::~QLibrary()
|
||||
d->release();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\property QLibrary::fileName
|
||||
\brief the file name of the library
|
||||
|
@ -92,6 +92,7 @@ public:
|
||||
|
||||
void setLoadHints(LoadHints hints);
|
||||
LoadHints loadHints() const;
|
||||
|
||||
private:
|
||||
enum LoadStatusTag {
|
||||
NotLoaded,
|
||||
|
@ -211,7 +211,6 @@ bool QPluginLoader::load()
|
||||
return d->loadPlugin();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Unloads the plugin and returns \c true if the plugin could be
|
||||
unloaded; otherwise returns \c false.
|
||||
|
@ -118,7 +118,6 @@ HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirect
|
||||
return inst;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -213,7 +213,6 @@ public:
|
||||
return QUuid::createUuidV5(ns, baseData.toUtf8());
|
||||
}
|
||||
|
||||
|
||||
QUuid::Variant variant() const noexcept;
|
||||
QUuid::Version version() const noexcept;
|
||||
|
||||
|
@ -90,7 +90,8 @@ public:
|
||||
QAtomicInt refCount;
|
||||
int id;
|
||||
|
||||
bool ref() {
|
||||
bool ref()
|
||||
{
|
||||
Q_ASSERT(refCount.loadRelaxed() >= 0);
|
||||
int c;
|
||||
do {
|
||||
@ -101,7 +102,8 @@ public:
|
||||
Q_ASSERT(refCount.loadRelaxed() >= 0);
|
||||
return true;
|
||||
}
|
||||
void deref() {
|
||||
void deref()
|
||||
{
|
||||
Q_ASSERT(refCount.loadRelaxed() >= 0);
|
||||
if (!refCount.deref())
|
||||
release();
|
||||
|
@ -109,7 +109,8 @@ public:
|
||||
|
||||
inline QPostEventList() : QList<QPostEvent>(), recursion(0), startOffset(0), insertionOffset(0) { }
|
||||
|
||||
void addEvent(const QPostEvent &ev) {
|
||||
void addEvent(const QPostEvent &ev)
|
||||
{
|
||||
int priority = ev.priority;
|
||||
if (isEmpty() ||
|
||||
constLast().priority >= priority ||
|
||||
@ -125,6 +126,7 @@ public:
|
||||
insert(at, ev);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
//hides because they do not keep that list sorted. addEvent must be used
|
||||
using QList<QPostEvent>::append;
|
||||
|
@ -51,7 +51,6 @@ QT_REQUIRE_CONFIG(thread);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
class QThreadPoolPrivate;
|
||||
class Q_CORE_EXPORT QThreadPool : public QObject
|
||||
{
|
||||
|
@ -65,47 +65,44 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
class QDeadlineTimer;
|
||||
|
||||
class QueuePage {
|
||||
class QueuePage
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
MaxPageSize = 256
|
||||
};
|
||||
|
||||
QueuePage(QRunnable *runnable, int pri)
|
||||
: m_priority(pri)
|
||||
QueuePage(QRunnable *runnable, int pri) : m_priority(pri) { push(runnable); }
|
||||
|
||||
bool isFull() { return m_lastIndex >= MaxPageSize - 1; }
|
||||
|
||||
bool isFinished() { return m_firstIndex > m_lastIndex; }
|
||||
|
||||
void push(QRunnable *runnable)
|
||||
{
|
||||
push(runnable);
|
||||
}
|
||||
|
||||
bool isFull() {
|
||||
return m_lastIndex >= MaxPageSize - 1;
|
||||
}
|
||||
|
||||
bool isFinished() {
|
||||
return m_firstIndex > m_lastIndex;
|
||||
}
|
||||
|
||||
void push(QRunnable *runnable) {
|
||||
Q_ASSERT(runnable != nullptr);
|
||||
Q_ASSERT(!isFull());
|
||||
m_lastIndex += 1;
|
||||
m_entries[m_lastIndex] = runnable;
|
||||
}
|
||||
|
||||
void skipToNextOrEnd() {
|
||||
void skipToNextOrEnd()
|
||||
{
|
||||
while (!isFinished() && m_entries[m_firstIndex] == nullptr) {
|
||||
m_firstIndex += 1;
|
||||
}
|
||||
}
|
||||
|
||||
QRunnable *first() {
|
||||
QRunnable *first()
|
||||
{
|
||||
Q_ASSERT(!isFinished());
|
||||
QRunnable *runnable = m_entries[m_firstIndex];
|
||||
Q_ASSERT(runnable);
|
||||
return runnable;
|
||||
}
|
||||
|
||||
QRunnable *pop() {
|
||||
QRunnable *pop()
|
||||
{
|
||||
Q_ASSERT(!isFinished());
|
||||
QRunnable *runnable = first();
|
||||
Q_ASSERT(runnable);
|
||||
@ -120,7 +117,8 @@ public:
|
||||
return runnable;
|
||||
}
|
||||
|
||||
bool tryTake(QRunnable *runnable) {
|
||||
bool tryTake(QRunnable *runnable)
|
||||
{
|
||||
Q_ASSERT(!isFinished());
|
||||
for (int i = m_firstIndex; i <= m_lastIndex; i++) {
|
||||
if (m_entries[i] == runnable) {
|
||||
@ -135,9 +133,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
int priority() const {
|
||||
return m_priority;
|
||||
}
|
||||
int priority() const { return m_priority; }
|
||||
|
||||
private:
|
||||
int m_priority = 0;
|
||||
|
@ -60,8 +60,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtPrivate
|
||||
{
|
||||
namespace QtPrivate {
|
||||
|
||||
#if defined(Q_OS_INTEGRITY)
|
||||
|
||||
@ -70,6 +69,7 @@ class condition_variable;
|
||||
class mutex : private QMutex
|
||||
{
|
||||
friend class QtPrivate::condition_variable;
|
||||
|
||||
public:
|
||||
// all special member functions are ok!
|
||||
// do not expose the (QMutex::Recursive) ctor
|
||||
|
@ -114,7 +114,8 @@ void qt_abstime_for_timeout(timespec *ts, QDeadlineTimer deadline)
|
||||
#endif
|
||||
}
|
||||
|
||||
class QWaitConditionPrivate {
|
||||
class QWaitConditionPrivate
|
||||
{
|
||||
public:
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t cond;
|
||||
@ -169,7 +170,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
QWaitCondition::QWaitCondition()
|
||||
{
|
||||
d = new QWaitConditionPrivate;
|
||||
@ -178,7 +178,6 @@ QWaitCondition::QWaitCondition()
|
||||
d->waiters = d->wakeups = 0;
|
||||
}
|
||||
|
||||
|
||||
QWaitCondition::~QWaitCondition()
|
||||
{
|
||||
report_error(pthread_cond_destroy(&d->cond), "QWaitCondition", "cv destroy");
|
||||
|
@ -109,7 +109,8 @@ bool QWaitConditionPrivate::wait(QWaitConditionEvent *wce, unsigned long time)
|
||||
// wait for the event
|
||||
bool ret = false;
|
||||
switch (WaitForSingleObjectEx(wce->event, time, FALSE)) {
|
||||
default: break;
|
||||
default:
|
||||
break;
|
||||
|
||||
case WAIT_OBJECT_0:
|
||||
ret = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user