summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-03-11 23:01:45 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-03-12 18:51:02 +0000
commit1739548c5a29e65d567857c327d2dbb79c216ca6 (patch)
tree559afdf77ab390e6a670504e31c0d4cd1ae60bef
parente19945cdd347bf2aaef9f0552f6bea7a706030ad (diff)
downloadqtserialport-1739548c5a29e65d567857c327d2dbb79c216ca6.tar.gz
Remove space between "if/elif defined" macro and its bracket
It is the recommended coding-style which is used in the Qt core. Change-Id: Id2efc3b2276b2d86d75fe0b7240077dbb61286f0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r--src/serialport/qserialport.cpp6
-rw-r--r--src/serialport/qserialport.h4
-rw-r--r--src/serialport/qserialport_p.h16
-rw-r--r--src/serialport/qserialport_unix.cpp14
-rw-r--r--src/serialport/qserialportinfo_unix.cpp4
-rw-r--r--tests/auto/qserialportinfoprivate/tst_qserialportinfoprivate.cpp8
6 files changed, 26 insertions, 26 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp
index 99ad993..a7075e0 100644
--- a/src/serialport/qserialport.cpp
+++ b/src/serialport/qserialport.cpp
@@ -59,11 +59,11 @@ QSerialPortPrivate::QSerialPortPrivate()
, settingsRestoredOnClose(true)
#endif
, isBreakEnabled(false)
-#if defined (Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
, handle(INVALID_HANDLE_VALUE)
, parityErrorOccurred(false)
, eventNotifier(0)
-#elif defined (Q_OS_WIN32)
+#elif defined(Q_OS_WIN32)
, handle(INVALID_HANDLE_VALUE)
, parityErrorOccurred(false)
, readChunkBuffer(ReadChunkSize, 0)
@@ -75,7 +75,7 @@ QSerialPortPrivate::QSerialPortPrivate()
, originalEventMask(0)
, triggeredEventMask(0)
, actualBytesToWrite(0)
-#elif defined (Q_OS_UNIX)
+#elif defined(Q_OS_UNIX)
, descriptor(-1)
, readNotifier(0)
, writeNotifier(0)
diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h
index 0fc7139..3137ba1 100644
--- a/src/serialport/qserialport.h
+++ b/src/serialport/qserialport.h
@@ -142,7 +142,7 @@ public:
Q_DECLARE_FLAGS(PinoutSignals, PinoutSignal)
#if QT_DEPRECATED_SINCE(5, 2)
-#if defined _MSC_VER
+#if defined(_MSC_VER)
#pragma deprecated(UnknownBaud)
#pragma deprecated(UnknownDataBits)
#pragma deprecated(UnknownParity)
@@ -279,7 +279,7 @@ private:
Q_DISABLE_COPY(QSerialPort)
-#if defined (Q_OS_WIN32)
+#if defined(Q_OS_WIN32)
Q_PRIVATE_SLOT(d_func(), bool _q_startAsyncWrite())
Q_PRIVATE_SLOT(d_func(), void _q_notified(quint32, quint32, OVERLAPPED*))
#endif
diff --git a/src/serialport/qserialport_p.h b/src/serialport/qserialport_p.h
index e8226c5..81e0e94 100644
--- a/src/serialport/qserialport_p.h
+++ b/src/serialport/qserialport_p.h
@@ -52,12 +52,12 @@
#include <private/qringbuffer_p.h>
#include <private/qiodevice_p.h>
-#if defined (Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
# include <QtCore/qmutex.h>
# include <qt_windows.h>
-#elif defined (Q_OS_WIN32)
+#elif defined(Q_OS_WIN32)
# include <qt_windows.h>
-#elif defined (Q_OS_UNIX)
+#elif defined(Q_OS_UNIX)
# include <QtCore/qlockfile.h>
# include <QtCore/qscopedpointer.h>
# include <QtCore/qfileinfo.h>
@@ -88,7 +88,7 @@ struct serial_struct {
# define ASYNC_SPD_CUST 0x0030
# define ASYNC_SPD_MASK 0x1030
# define PORT_UNKNOWN 0
-# elif defined (Q_OS_LINUX)
+# elif defined(Q_OS_LINUX)
# include <linux/serial.h>
# endif
#else
@@ -102,7 +102,7 @@ class QWinOverlappedIoNotifier;
class QTimer;
class QSocketNotifier;
-#if defined (Q_OS_UNIX)
+#if defined(Q_OS_UNIX)
QString serialPortLockFilePath(const QString &portName);
#endif
@@ -173,7 +173,7 @@ public:
bool settingsRestoredOnClose;
bool isBreakEnabled;
-#if defined (Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
bool initialize(DWORD eventMask);
bool updateDcb();
@@ -197,7 +197,7 @@ public:
QThread *eventNotifier;
QMutex settingsChangeMutex;
-#elif defined (Q_OS_WIN32)
+#elif defined(Q_OS_WIN32)
bool initialize();
bool updateDcb();
@@ -237,7 +237,7 @@ public:
DWORD triggeredEventMask;
qint64 actualBytesToWrite;
-#elif defined (Q_OS_UNIX)
+#elif defined(Q_OS_UNIX)
bool initialize(QIODevice::OpenMode mode);
bool updateTermios();
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 7cf356b..30131ca 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/serialport/qserialport_unix.cpp
@@ -43,7 +43,7 @@
#include <unistd.h>
#ifdef Q_OS_MAC
-#if defined (MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
+#if defined(MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
#include <IOKit/serial/ioss.h>
#endif
#endif
@@ -271,14 +271,14 @@ QSerialPort::PinoutSignals QSerialPortPrivate::pinoutSignals()
#ifdef TIOCM_CAR
if (arg & TIOCM_CAR)
ret |= QSerialPort::DataCarrierDetectSignal;
-#elif defined TIOCM_CD
+#elif defined(TIOCM_CD)
if (arg & TIOCM_CD)
ret |= QSerialPort::DataCarrierDetectSignal;
#endif
#ifdef TIOCM_RNG
if (arg & TIOCM_RNG)
ret |= QSerialPort::RingIndicatorSignal;
-#elif defined TIOCM_RI
+#elif defined(TIOCM_RI)
if (arg & TIOCM_RI)
ret |= QSerialPort::RingIndicatorSignal;
#endif
@@ -503,7 +503,7 @@ QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions d
{
Q_UNUSED(directions);
-#if defined (MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
+#if defined(MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
if (::ioctl(descriptor, IOSSIOSPEED, &baudRate) == -1)
return decodeSystemError();
@@ -513,7 +513,7 @@ QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions d
return QSerialPort::UnsupportedOperationError;
}
-#elif defined (Q_OS_QNX)
+#elif defined(Q_OS_QNX)
QSerialPort::SerialPortError
QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions directions)
@@ -992,7 +992,7 @@ bool QSerialPortPrivate::waitForReadOrWrite(bool *selectForRead, bool *selectFor
qint64 QSerialPortPrivate::readFromPort(char *data, qint64 maxSize)
{
qint64 bytesRead = 0;
-#if defined (CMSPAR)
+#if defined(CMSPAR)
if (parity == QSerialPort::NoParity
|| policy != QSerialPort::StopReceivingPolicy) {
#else
@@ -1010,7 +1010,7 @@ qint64 QSerialPortPrivate::readFromPort(char *data, qint64 maxSize)
qint64 QSerialPortPrivate::writeToPort(const char *data, qint64 maxSize)
{
qint64 bytesWritten = 0;
-#if defined (CMSPAR)
+#if defined(CMSPAR)
bytesWritten = qt_safe_write(descriptor, data, maxSize);
#else
if (parity != QSerialPort::MarkParity
diff --git a/src/serialport/qserialportinfo_unix.cpp b/src/serialport/qserialportinfo_unix.cpp
index 312b99f..7da8f52 100644
--- a/src/serialport/qserialportinfo_unix.cpp
+++ b/src/serialport/qserialportinfo_unix.cpp
@@ -67,9 +67,9 @@ static QStringList filteredDeviceFilePaths()
<< QStringLiteral("ttyAMA*") // AMBA serial device for embedded platform on ARM (i.e. Raspberry Pi).
<< QStringLiteral("rfcomm*") // Bluetooth serial device.
<< QStringLiteral("ircomm*"); // IrDA serial device.
-#elif defined (Q_OS_FREEBSD)
+#elif defined(Q_OS_FREEBSD)
<< QStringLiteral("cu*");
-#elif defined (Q_OS_QNX)
+#elif defined(Q_OS_QNX)
<< QStringLiteral("ser*");
#else
;
diff --git a/tests/auto/qserialportinfoprivate/tst_qserialportinfoprivate.cpp b/tests/auto/qserialportinfoprivate/tst_qserialportinfoprivate.cpp
index 486699f..fa76a1a 100644
--- a/tests/auto/qserialportinfoprivate/tst_qserialportinfoprivate.cpp
+++ b/tests/auto/qserialportinfoprivate/tst_qserialportinfoprivate.cpp
@@ -56,14 +56,14 @@ void tst_QSerialPortInfoPrivate::canonical_data()
QTest::addColumn<QString>("name");
QTest::addColumn<QString>("location");
-#if defined (Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
QTest::newRow("Test1") << "COM1" << "COM1" << "COM1:";
QTest::newRow("Test2") << "COM1:" << "COM1" << "COM1:";
-#elif defined (Q_OS_WIN32)
+#elif defined(Q_OS_WIN32)
QTest::newRow("Test1") << "COM1" << "COM1" << "\\\\.\\COM1";
QTest::newRow("Test2") << "\\\\.\\COM1" << "COM1" << "\\\\.\\COM1";
QTest::newRow("Test3") << "//./COM1" << "COM1" << "//./COM1";
-#elif defined (Q_OS_OSX)
+#elif defined(Q_OS_OSX)
QTest::newRow("Test1") << "ttyS0" << "ttyS0" << "/dev/ttyS0";
QTest::newRow("Test2") << "cu.serial1" << "cu.serial1" << "/dev/cu.serial1";
QTest::newRow("Test3") << "tty.serial1" << "tty.serial1" << "/dev/tty.serial1";
@@ -76,7 +76,7 @@ void tst_QSerialPortInfoPrivate::canonical_data()
QTest::newRow("Test10") << "serial/ttyS0" << "serial/ttyS0" << "/dev/serial/ttyS0";
QTest::newRow("Test11") << "./ttyS0" << "./ttyS0" << "./ttyS0";
QTest::newRow("Test12") << "../ttyS0" << "../ttyS0" << "../ttyS0";
-#elif defined (Q_OS_UNIX)
+#elif defined(Q_OS_UNIX)
QTest::newRow("Test1") << "ttyS0" << "ttyS0" << "/dev/ttyS0";
QTest::newRow("Test2") << "/dev/ttyS0" << "ttyS0" << "/dev/ttyS0";
QTest::newRow("Test3") << "/dev/serial/ttyS0" << "serial/ttyS0" << "/dev/serial/ttyS0";