From 11cc6ba1c2df1bcb25b8cd6cfc86c0a33e306b42 Mon Sep 17 00:00:00 2001 From: Kuzma Shapran Date: Sun, 20 Jan 2013 10:05:50 +1300 Subject: [PATCH] Style follows the Coding Standard --- CMakeLists.txt | 38 +++++++++++++------------- basestat.cpp | 32 +++++++++++----------- basestat.hpp => basestat.h | 12 ++++---- basestat_p.hpp => basestat_p.h | 22 +++++++-------- cpustat.cpp | 28 +++++++++---------- cpustat.hpp => cpustat.h | 6 ++-- cpustat_p.hpp => cpustat_p.h | 24 ++++++++-------- memstat.cpp | 8 +++--- memstat.hpp => memstat.h | 2 +- memstat_p.hpp => memstat_p.h | 8 +++--- netstat.cpp | 10 +++---- netstat.hpp => netstat.h | 2 +- netstat_p.hpp => netstat_p.h | 10 +++---- sysstat_global.hpp => sysstat_global.h | 0 version.cpp | 10 +++---- version.hpp => version.h | 8 +++--- version_p.hpp => version_p.h | 0 17 files changed, 110 insertions(+), 110 deletions(-) rename basestat.hpp => basestat.h (89%) rename basestat_p.hpp => basestat_p.h (81%) rename cpustat.hpp => cpustat.h (95%) rename cpustat_p.hpp => cpustat_p.h (86%) rename memstat.hpp => memstat.h (97%) rename memstat_p.hpp => memstat_p.h (93%) rename netstat.hpp => netstat.h (97%) rename netstat_p.hpp => netstat_p.h (92%) rename sysstat_global.hpp => sysstat_global.h (100%) rename version.hpp => version.h (90%) rename version_p.hpp => version_p.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index beddf6e..0b4d6fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,20 +13,20 @@ find_package(Qt4 REQUIRED) set(SYSSTAT_PUBLIC_HDRS - version.hpp - sysstat_global.hpp - basestat.hpp - cpustat.hpp - memstat.hpp - netstat.hpp + version.h + sysstat_global.h + basestat.h + cpustat.h + memstat.h + netstat.h ) set(SYSSTAT_PRIVATE_HDRS - version_p.hpp - basestat_p.hpp - cpustat_p.hpp - memstat_p.hpp - netstat_p.hpp + version_p.h + basestat_p.h + cpustat_p.h + memstat_p.h + netstat_p.h ) set(SYSSTAT_SRCS @@ -38,14 +38,14 @@ set(SYSSTAT_SRCS ) set(SYSSTAT_MOCS - basestat.hpp - cpustat.hpp - memstat.hpp - netstat.hpp - basestat_p.hpp - cpustat_p.hpp - memstat_p.hpp - netstat_p.hpp + basestat.h + cpustat.h + memstat.h + netstat.h + basestat_p.h + cpustat_p.h + memstat_p.h + netstat_p.h ) diff --git a/basestat.cpp b/basestat.cpp index f6f0b8a..ba9c5d4 100644 --- a/basestat.cpp +++ b/basestat.cpp @@ -29,8 +29,8 @@ #include -#include "basestat.hpp" -#include "basestat_p.hpp" +#include "basestat.h" +#include "basestat_p.h" namespace SysStat { @@ -50,21 +50,21 @@ BaseStatPrivate::~BaseStatPrivate() { } -bool BaseStatPrivate::timerIsActive(void) const +bool BaseStatPrivate::timerIsActive() const { return mTimer->isActive(); } -int BaseStatPrivate::updateInterval(void) const +int BaseStatPrivate::updateInterval() const { return mTimer->interval(); } -void BaseStatPrivate::intervalChanged(void) +void BaseStatPrivate::intervalChanged() { } -void BaseStatPrivate::sourceChanged(void) +void BaseStatPrivate::sourceChanged() { } @@ -81,7 +81,7 @@ void BaseStatPrivate::setUpdateInterval(int msec) } } -void BaseStatPrivate::synchroTimeout(void) +void BaseStatPrivate::synchroTimeout() { QTime now(QTime::currentTime()); int synchro = ((now.minute() * 60 + now.second()) * 1000 + now.msec() ) / mTimer->interval(); @@ -93,12 +93,12 @@ void BaseStatPrivate::synchroTimeout(void) mLastSynchro = synchro; } -void BaseStatPrivate::stopUpdating(void) +void BaseStatPrivate::stopUpdating() { mTimer->stop(); } -QString BaseStatPrivate::monitoredSource(void) const +QString BaseStatPrivate::monitoredSource() const { return mSource; } @@ -109,7 +109,7 @@ void BaseStatPrivate::setMonitoredSource(const QString &Source) this->sourceChanged(); } -void BaseStatPrivate::monitorDefaultSource(void) +void BaseStatPrivate::monitorDefaultSource() { mSource = defaultSource(); } @@ -133,7 +133,7 @@ QString BaseStatPrivate::readAllFile(const char *filename) return result; } -QStringList BaseStatPrivate::sources(void) const +QStringList BaseStatPrivate::sources() const { return mSources; } @@ -147,12 +147,12 @@ BaseStat::~BaseStat() { } -QStringList BaseStat::sources(void) const +QStringList BaseStat::sources() const { return baseimpl->sources(); } -int BaseStat::updateInterval(void) const +int BaseStat::updateInterval() const { return baseimpl->updateInterval(); } @@ -166,7 +166,7 @@ void BaseStat::setUpdateInterval(int msec) } } -void BaseStat::stopUpdating(void) +void BaseStat::stopUpdating() { if (updateInterval() != 0) { @@ -175,7 +175,7 @@ void BaseStat::stopUpdating(void) } } -QString BaseStat::monitoredSource(void) const +QString BaseStat::monitoredSource() const { return baseimpl->monitoredSource(); } @@ -189,7 +189,7 @@ void BaseStat::setMonitoredSource(const QString &source) } } -void BaseStat::monitorDefaultSource(void) +void BaseStat::monitorDefaultSource() { QString oldSource = monitoredSource(); baseimpl->monitorDefaultSource(); diff --git a/basestat.hpp b/basestat.h similarity index 89% rename from basestat.hpp rename to basestat.h index 1378793..86e95e8 100644 --- a/basestat.hpp +++ b/basestat.h @@ -32,7 +32,7 @@ #include #include -#include +#include namespace SysStat { @@ -47,7 +47,7 @@ class SYSSTATSHARED_EXPORT BaseStat : public QObject BaseStat(QObject *parent = NULL); ~BaseStat(); - QStringList sources(void) const; + QStringList sources() const; signals: void updateIntervalChanged(int); @@ -58,13 +58,13 @@ class SYSSTATSHARED_EXPORT BaseStat : public QObject Q_PROPERTY(QString monitoredSource READ monitoredSource WRITE setMonitoredSource RESET monitorDefaultSource NOTIFY monitoredSourceChanged) public slots: - int updateInterval(void) const; + int updateInterval() const; void setUpdateInterval(int msec); - void stopUpdating(void); + void stopUpdating(); - QString monitoredSource(void) const; + QString monitoredSource() const; void setMonitoredSource(const QString &Source); - void monitorDefaultSource(void); + void monitorDefaultSource(); protected: BaseStatPrivate* baseimpl; diff --git a/basestat_p.hpp b/basestat_p.h similarity index 81% rename from basestat_p.hpp rename to basestat_p.h index 043a7d7..ec1afb1 100644 --- a/basestat_p.hpp +++ b/basestat_p.h @@ -34,7 +34,7 @@ #include #include -#include "cpustat.hpp" +#include "cpustat.h" namespace SysStat { @@ -47,22 +47,22 @@ class BaseStatPrivate : public QObject BaseStatPrivate(BaseStat *parent = NULL); ~BaseStatPrivate(); - QStringList sources(void) const; + QStringList sources() const; - bool timerIsActive(void) const; - int updateInterval(void) const; + bool timerIsActive() const; + int updateInterval() const; void setUpdateInterval(int msec); - void stopUpdating(void); + void stopUpdating(); - QString monitoredSource(void) const; + QString monitoredSource() const; void setMonitoredSource(const QString &Source); - void monitorDefaultSource(void); + void monitorDefaultSource(); private slots: - void synchroTimeout(void); + void synchroTimeout(); protected: - virtual QString defaultSource(void) = 0; + virtual QString defaultSource() = 0; QString readAllFile(const char *filename); @@ -73,8 +73,8 @@ private slots: int mLastSynchro; - virtual void intervalChanged(void); - virtual void sourceChanged(void); + virtual void intervalChanged(); + virtual void sourceChanged(); }; } diff --git a/cpustat.cpp b/cpustat.cpp index 4afbf2c..6017d6e 100644 --- a/cpustat.cpp +++ b/cpustat.cpp @@ -26,8 +26,8 @@ #include -#include "cpustat.hpp" -#include "cpustat_p.hpp" +#include "cpustat.h" +#include "cpustat_p.h" namespace SysStat { @@ -58,7 +58,7 @@ void CpuStatPrivate::addSource(const QString &source) } } -void CpuStatPrivate::updateSources(void) +void CpuStatPrivate::updateSources() { mSources.clear(); @@ -103,17 +103,17 @@ CpuStatPrivate::~CpuStatPrivate() { } -void CpuStatPrivate::intervalChanged(void) +void CpuStatPrivate::intervalChanged() { recalculateMinMax(); } -void CpuStatPrivate::sourceChanged(void) +void CpuStatPrivate::sourceChanged() { recalculateMinMax(); } -void CpuStatPrivate::recalculateMinMax(void) +void CpuStatPrivate::recalculateMinMax() { int cores = 1; if (mSource == "cpu") @@ -123,7 +123,7 @@ void CpuStatPrivate::recalculateMinMax(void) mIntervalMax = static_cast(mTimer->interval()) / 1000 * static_cast(mUserHz) * static_cast(cores) * 1.25; // +25% } -void CpuStatPrivate::timeout(void) +void CpuStatPrivate::timeout() { if ( (mMonitoring == CpuStat::LoadOnly) || (mMonitoring == CpuStat::LoadAndFrequency) ) @@ -260,12 +260,12 @@ void CpuStatPrivate::timeout(void) } } -QString CpuStatPrivate::defaultSource(void) +QString CpuStatPrivate::defaultSource() { return "cpu"; } -CpuStatPrivate::Values::Values(void) +CpuStatPrivate::Values::Values() : user(0) , nice(0) , system(0) @@ -275,17 +275,17 @@ CpuStatPrivate::Values::Values(void) { } -void CpuStatPrivate::Values::sum(void) +void CpuStatPrivate::Values::sum() { total = user + nice + system + idle + other; } -void CpuStatPrivate::Values::clear(void) +void CpuStatPrivate::Values::clear() { total = user = nice = system = idle = other = 0; } -CpuStat::Monitoring CpuStatPrivate::monitoring(void) const +CpuStat::Monitoring CpuStatPrivate::monitoring() const { return mMonitoring; } @@ -311,12 +311,12 @@ CpuStat::~CpuStat() { } -void CpuStat::updateSources(void) +void CpuStat::updateSources() { dynamic_cast(impl)->updateSources(); } -CpuStat::Monitoring CpuStat::monitoring(void) const +CpuStat::Monitoring CpuStat::monitoring() const { return impl->monitoring(); } diff --git a/cpustat.hpp b/cpustat.h similarity index 95% rename from cpustat.hpp rename to cpustat.h index a7ae561..f0e92a4 100644 --- a/cpustat.hpp +++ b/cpustat.h @@ -30,7 +30,7 @@ #include -#include +#include namespace SysStat { @@ -50,7 +50,7 @@ class SYSSTATSHARED_EXPORT CpuStat : public BaseStat CpuStat(QObject *parent = NULL); ~CpuStat(); - void updateSources(void); + void updateSources(); uint minFreq(const QString &source) const; uint maxFreq(const QString &source) const; @@ -66,7 +66,7 @@ class SYSSTATSHARED_EXPORT CpuStat : public BaseStat Q_PROPERTY(Monitoring monitoring READ monitoring WRITE setMonitoring NOTIFY monitoringChanged) public slots: - Monitoring monitoring(void) const; + Monitoring monitoring() const; void setMonitoring(Monitoring value); protected: diff --git a/cpustat_p.hpp b/cpustat_p.h similarity index 86% rename from cpustat_p.hpp rename to cpustat_p.h index 0bc132e..bedeb5a 100644 --- a/cpustat_p.hpp +++ b/cpustat_p.h @@ -33,8 +33,8 @@ #include #include -#include "basestat_p.hpp" -#include "cpustat.hpp" +#include "basestat_p.h" +#include "cpustat.h" namespace SysStat { @@ -47,9 +47,9 @@ class CpuStatPrivate : public BaseStatPrivate CpuStatPrivate(CpuStat *parent = NULL); ~CpuStatPrivate(); - void updateSources(void); + void updateSources(); - CpuStat::Monitoring monitoring(void) const; + CpuStat::Monitoring monitoring() const; void setMonitoring(CpuStat::Monitoring value); uint minFreq(const QString &source) const; @@ -61,18 +61,18 @@ class CpuStatPrivate : public BaseStatPrivate void update(float user, float nice, float system, float other, float frequencyRate, uint frequency); private slots: - void timeout(void); + void timeout(); protected: - void intervalChanged(void); - void sourceChanged(void); + void intervalChanged(); + void sourceChanged(); private: - QString defaultSource(void); + QString defaultSource(); typedef struct Values { - Values(void); + Values(); qulonglong user; qulonglong nice; @@ -81,9 +81,9 @@ private slots: qulonglong other; qulonglong total; - void sum(void); + void sum(); - void clear(void); + void clear(); } Values; Values mPrevious; @@ -99,7 +99,7 @@ private slots: float mIntervalMin; float mIntervalMax; - void recalculateMinMax(void); + void recalculateMinMax(); }; } diff --git a/memstat.cpp b/memstat.cpp index b9daa4a..da20117 100644 --- a/memstat.cpp +++ b/memstat.cpp @@ -24,8 +24,8 @@ ** END_COMMON_COPYRIGHT_HEADER */ -#include "memstat.hpp" -#include "memstat_p.hpp" +#include "memstat.h" +#include "memstat_p.h" namespace SysStat { @@ -44,7 +44,7 @@ MemStatPrivate::~MemStatPrivate() { } -void MemStatPrivate::timeout(void) +void MemStatPrivate::timeout() { qulonglong memTotal; qulonglong memFree; @@ -96,7 +96,7 @@ void MemStatPrivate::timeout(void) } } -QString MemStatPrivate::defaultSource(void) +QString MemStatPrivate::defaultSource() { return "memory"; } diff --git a/memstat.hpp b/memstat.h similarity index 97% rename from memstat.hpp rename to memstat.h index 39d1368..88947f2 100644 --- a/memstat.hpp +++ b/memstat.h @@ -30,7 +30,7 @@ #include -#include +#include namespace SysStat { diff --git a/memstat_p.hpp b/memstat_p.h similarity index 93% rename from memstat_p.hpp rename to memstat_p.h index fcd9918..a9c778f 100644 --- a/memstat_p.hpp +++ b/memstat_p.h @@ -31,8 +31,8 @@ #include #include -#include "basestat_p.hpp" -#include "memstat.hpp" +#include "basestat_p.h" +#include "memstat.h" namespace SysStat { @@ -50,10 +50,10 @@ class MemStatPrivate : public BaseStatPrivate void swapUpdate(float used); private slots: - void timeout(void); + void timeout(); private: - QString defaultSource(void); + QString defaultSource(); }; } diff --git a/netstat.cpp b/netstat.cpp index 2b3159c..e4450a1 100644 --- a/netstat.cpp +++ b/netstat.cpp @@ -24,8 +24,8 @@ ** END_COMMON_COPYRIGHT_HEADER */ -#include "netstat.hpp" -#include "netstat_p.hpp" +#include "netstat.h" +#include "netstat_p.h" namespace SysStat { @@ -56,7 +56,7 @@ NetStatPrivate::~NetStatPrivate() { } -void NetStatPrivate::timeout(void) +void NetStatPrivate::timeout() { QStringList rows(readAllFile("/proc/net/dev").split(QChar('\n'), QString::SkipEmptyParts)); @@ -101,12 +101,12 @@ void NetStatPrivate::timeout(void) } } -QString NetStatPrivate::defaultSource(void) +QString NetStatPrivate::defaultSource() { return "lo"; } -NetStatPrivate::Values::Values(void) +NetStatPrivate::Values::Values() : received(0) , transmitted(0) { diff --git a/netstat.hpp b/netstat.h similarity index 97% rename from netstat.hpp rename to netstat.h index bb02982..651676f 100644 --- a/netstat.hpp +++ b/netstat.h @@ -30,7 +30,7 @@ #include -#include +#include namespace SysStat { diff --git a/netstat_p.hpp b/netstat_p.h similarity index 92% rename from netstat_p.hpp rename to netstat_p.h index 9b36db9..d3b0b81 100644 --- a/netstat_p.hpp +++ b/netstat_p.h @@ -32,8 +32,8 @@ #include #include -#include "basestat_p.hpp" -#include "netstat.hpp" +#include "basestat_p.h" +#include "netstat.h" namespace SysStat { @@ -50,14 +50,14 @@ class NetStatPrivate : public BaseStatPrivate void update(unsigned received, unsigned transmitted); private slots: - void timeout(void); + void timeout(); private: - QString defaultSource(void); + QString defaultSource(); typedef struct Values { - Values(void); + Values(); qulonglong received; qulonglong transmitted; diff --git a/sysstat_global.hpp b/sysstat_global.h similarity index 100% rename from sysstat_global.hpp rename to sysstat_global.h diff --git a/version.cpp b/version.cpp index 2d9fcf3..5f09557 100644 --- a/version.cpp +++ b/version.cpp @@ -25,29 +25,29 @@ #include -#include "version_p.hpp" +#include "version_p.h" namespace SysStat { namespace version { -QString verbose(void) +QString verbose() { return QString("%1.%2.%3").arg(MAJOR_VERSION_STR).arg(MINOR_VERSION_STR).arg(PATCH_VERSION_STR); } -int major_number(void) +int majorNumber() { return MAJOR_VERSION; } -int minor_number(void) +int minorNumber() { return MINOR_VERSION; } -int patch_number(void) +int patchNumber() { return PATCH_VERSION; } diff --git a/version.hpp b/version.h similarity index 90% rename from version.hpp rename to version.h index b2c5072..aaf046d 100644 --- a/version.hpp +++ b/version.h @@ -31,10 +31,10 @@ namespace SysStat { namespace version { - QString verbose(void); - int major_number(void); - int minor_number(void); - int patch_number(void); + QString verbose(); + int majorNumber(); + int minorNumber(); + int patchNumber(); } } diff --git a/version_p.hpp b/version_p.h similarity index 100% rename from version_p.hpp rename to version_p.h