Fix missing spaces after keywords 01/170701/2
authorZofia Grzelewska <z.abramowska@samsung.com>
Wed, 21 Feb 2018 13:26:34 +0000 (14:26 +0100)
committerZofia Grzelewska <z.abramowska@samsung.com>
Wed, 21 Feb 2018 14:48:35 +0000 (15:48 +0100)
Fix code style - missing spaces after 'switch','which'
and 'if' keywords.

Change-Id: I51449bdc574fa8f474974faeeb1f93d29b100c81

src/common/log/alog.h
src/common/socket/Socket.cpp
src/ipc/sock.cpp
src/ipc/test/main.cpp

index d4c6379..749919a 100644 (file)
@@ -63,7 +63,7 @@ namespace {
             __LOG_msg << MESSAGE << " : " << err_str; \
             __ALOG_FUN(LOG_ERR, __LOG_msg); \
         } \
-    } while(0)
+    } while (0)
 
 #define ALOGM(...)  __ALOG(LOG_EMERG, __VA_ARGS__)   /* system is unusable */
 #define ALOGA(...)  __ALOG(LOG_ALERT, __VA_ARGS__)   /* action must be taken immediately */
index bbae192..302ce58 100644 (file)
@@ -180,7 +180,7 @@ bool Socket::recvData(void *data, size_t len) {
 
 bool Socket::recv(std::string &msg) {
     int size;
-    if(!recv(size))
+    if (!recv(size))
         return false;
 
     std::vector<char> strData(size);
index 70c3dd5..34022e0 100644 (file)
@@ -68,7 +68,7 @@ Sock& Sock::operator=(Sock &&second) {
 
 
 int Sock::getUnixSockType() const {
-    switch(m_type) {
+    switch (m_type) {
     case SRV_DGRAM:
     case CLI_DGRAM:
         return SOCK_DGRAM;
@@ -110,7 +110,7 @@ int Sock::connect(const std::string &path) {
     bool policyListen  = true;
     bool policyConnect = true;
 
-    switch(m_type) {
+    switch (m_type) {
     case SRV_STREAM:
         policyConnect = false;
         break;
@@ -208,7 +208,7 @@ int Sock::send(const RawBuffer &buffer) {
         return -1;
     }
 
-    switch(m_type) {
+    switch (m_type) {
     default:
         ALOGE("Send was called for inappropriate socket type");
         return -1;
@@ -250,7 +250,7 @@ int Sock::recv(RawBuffer &output) {
         return -1;
     }
 
-    switch(m_type) {
+    switch (m_type) {
     default:
         ALOGE("Receive was called for inappropriate socket type");
         return -1;
index 826fb0e..5f42c4f 100644 (file)
@@ -76,7 +76,7 @@ void server(void) {
 
     pollfd fd[100];
 
-    while(1) {
+    while (1) {
         int last = 0;
         for (auto &e : m_sockets) {
             fd[last].fd = e.first;
@@ -131,7 +131,7 @@ void client() {
     char privilege[4096];
     pollfd fd[100];
 
-    while(1) {
+    while (1) {
         int last = 0;
         for (auto &e : m_sockets) {
             fd[last].fd = e.first;
@@ -186,7 +186,7 @@ int main(){
     }
 
     try {
-        switch(com) {
+        switch (com) {
         case 0:
             server();
             break;