Browse Source

PubSub: Remove excessive brackets

Julius Pfrommer 5 years ago
parent
commit
39d20427aa
1 changed files with 10 additions and 11 deletions
  1. 10 11
      src/pubsub/ua_pubsub.c

+ 10 - 11
src/pubsub/ua_pubsub.c

@@ -413,40 +413,39 @@ UA_Server_processNetworkMessage(UA_Server *server, UA_NetworkMessage *pMsg,
                         if(publisherIdAvailable && (tmpReader->config.publisherId.type != NULL)) {
                             switch (pMsg->publisherIdType) {
                                 case UA_PUBLISHERDATATYPE_BYTE:
-                                    if((tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_BYTE]) &&
-                                       (pMsg->publisherId.publisherIdByte == (*(UA_Byte*)tmpReader->config.publisherId.data))) {
-                                        UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetReader found with PublisherId");
+                                    if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_BYTE] &&
+                                       pMsg->publisherId.publisherIdByte == *(UA_Byte*)tmpReader->config.publisherId.data) {
                                         dataSetReaderErg = tmpReader;
                                     }
                                     break;
 
                                 case UA_PUBLISHERDATATYPE_UINT16:
-                                    if((tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT16]) &&
-                                        (pMsg->publisherId.publisherIdUInt16 == (*(UA_UInt16*)tmpReader->config.publisherId.data))) {
+                                    if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT16] &&
+                                       pMsg->publisherId.publisherIdUInt16 == *(UA_UInt16*)tmpReader->config.publisherId.data) {
                                          UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetReader found with PublisherId");
                                          dataSetReaderErg = tmpReader;
                                     }
                                     break;
 
                                 case UA_PUBLISHERDATATYPE_UINT32:
-                                    if((tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT32])&&
-                                        (pMsg->publisherId.publisherIdUInt32 == (*(UA_UInt32*)tmpReader->config.publisherId.data))) {
+                                    if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT32] &&
+                                       pMsg->publisherId.publisherIdUInt32 == *(UA_UInt32*)tmpReader->config.publisherId.data) {
                                         UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetReader found with PublisherId");
                                         dataSetReaderErg = tmpReader;
                                     }
                                     break;
 
                                 case UA_PUBLISHERDATATYPE_UINT64:
-                                    if((tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT64]) &&
-                                        (pMsg->publisherId.publisherIdUInt64 == (*(UA_UInt64*)tmpReader->config.publisherId.data))) {
+                                    if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT64] &&
+                                       pMsg->publisherId.publisherIdUInt64 == *(UA_UInt64*)tmpReader->config.publisherId.data) {
                                         UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetReader found with PublisherId");
                                         dataSetReaderErg = tmpReader;
                                     }
                                     break;
 
                                 case UA_PUBLISHERDATATYPE_STRING:
-                                     if((tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_STRING]) &&
-                                         (UA_String_equal(&pMsg->publisherId.publisherIdString, (UA_String*)tmpReader->config.publisherId.data))) {
+                                     if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_STRING] &&
+                                        UA_String_equal(&pMsg->publisherId.publisherIdString, (UA_String*)tmpReader->config.publisherId.data)) {
                                          UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetReader found with PublisherId");
                                          dataSetReaderErg = tmpReader;
                                      }