Prechádzať zdrojové kódy

Fix cpplint issues

Signed-off-by: Martin Melik Merkumians <martin.melik@gmail.com>
Martin Melik Merkumians 2 mesiacov pred
rodič
commit
bba7230fc3

+ 3 - 1
source/buildsupport/OpENer.cmake

@@ -23,13 +23,15 @@ endmacro(opener_platform_support ARGS)
 #######################################
 macro(opener_common_includes)
   set( SRC_DIR "${OpENer_SOURCE_DIR}/src" )
+  set( API_SRC_DIR "${SRC_DIR}/api" )
+  set( CORE_SRC_DIR "${SRC_DIR}/core" )
   set( CIP_SRC_DIR "${SRC_DIR}/cip" )
   set( ENET_ENCAP_SRC_DIR "${SRC_DIR}/enet_encap" )
   set( PORTS_SRC_DIR "${SRC_DIR}/ports")
   set( NVDATA_SRC_DIR "${SRC_DIR}/ports/nvdata")
   set( UTILS_SRC_DIR "${SRC_DIR}/utils")
 
-  include_directories( ${PROJECT_SOURCE_DIR} ${SRC_DIR} ${CIP_SRC_DIR} ${CIP_CONNETION_MANAGER_SRC_DIR} ${ENET_ENCAP_SRC_DIR} ${PORTS_SRC_DIR} ${UTILS_SRC_DIR} ${OpENer_CIP_OBJECTS_DIR} ${NVDATA_SRC_DIR} )
+  include_directories( ${PROJECT_SOURCE_DIR} ${SRC_DIR} ${API_SRC_DIR} ${CORE_SRC_DIR} ${CIP_SRC_DIR} ${CIP_CONNETION_MANAGER_SRC_DIR} ${ENET_ENCAP_SRC_DIR} ${PORTS_SRC_DIR} ${UTILS_SRC_DIR} ${OpENer_CIP_OBJECTS_DIR} ${NVDATA_SRC_DIR} )
   include_directories( "${PROJECT_BINARY_DIR}/src/ports" )
 endmacro(opener_common_includes)
 

+ 5 - 5
source/src/cip/cipconnectionmanager.h

@@ -240,17 +240,17 @@ typedef enum {
  *  b
  *  @def SEQ_GT32(a, b) Checks if sequence number a is greater than b
  */
-#define SEQ_LEQ32(a, b) ((int32_fast_t)((a) - (b)) <= 0)
-#define SEQ_GEQ32(a, b) ((int32_fast_t)((a) - (b)) >= 0)
-#define SEQ_GT32(a, b) ((int32_fast_t)((a) - (b)) > 0)
+#define SEQ_LEQ32(a, b) ((int_fast32_t)((a) - (b)) <= 0)
+#define SEQ_GEQ32(a, b) ((int_fast32_t)((a) - (b)) >= 0)
+#define SEQ_GT32(a, b) ((int_fast32_t)((a) - (b)) > 0)
 
 /** @brief similar macros for comparing 16 bit sequence numbers
  * @def SEQ_LEQ16(a, b) Checks if sequence number a is less or equal than b
  * @def SEQ_GEQ16(a, b) Checks if sequence number a is greater or equal than
  *  b
  */
-#define SEQ_LEQ16(a, b) ((int16_fast_t)((a) - (b)) <= 0)
-#define SEQ_GEQ16(a, b) ((int16_fast_t)((a) - (b)) >= 0)
+#define SEQ_LEQ16(a, b) ((int_fast16_t)((a) - (b)) <= 0)
+#define SEQ_GEQ16(a, b) ((int_fast16_t)((a) - (b)) >= 0)
 
 /** @brief Connection Manager class code */
 static const CipUint kCipConnectionManagerClassCode = 0x06U;

+ 1 - 1
source/src/cip/cipmessagerouter.c

@@ -10,7 +10,7 @@
 #include "cip/ciperror.h"
 #include "core/trace.h"
 #include "enet_encap/endianconv.h"
-#include "enet_encap/enipmessage.h"
+#include "utils/enipmessage.h"
 
 CipMessageRouterRequest g_message_router_request;
 

+ 2 - 2
source/src/cip/ciptypes.h

@@ -6,10 +6,10 @@
 #ifndef CIP_CIPTYPES_H_
 #define CIP_CIPTYPES_H_
 
-#include "api/opener_user_conf.h"
 #include "core/typedefs.h"
-#include "enet_encap/enipmessage.h"
+#include "opener_user_conf.h"
 #include "ports/networkhandler.h"
+#include "utils/enipmessage.h"
 
 /** @brief Enum containing the encoding values for CIP data types for CIP
  * Messages */

+ 1 - 1
source/src/enet_encap/encap.c

@@ -695,7 +695,7 @@ EipStatus HandleReceivedSendRequestResponseDataCommand(
   // EipStatus return_value = kEipStatusOkSend;
   // TODO(MartinMelikMerkumians): Shouldn't this be kEipStatusOk cause we must
   // not send any response if data_length < 6?
-  EipStatus = kEipStatusOk;
+  EipStatus return_value = kEipStatusOk;
 
   if (receive_data->data_length >= 6) {
     // Command specific data UDINT .. Interface Handle, UINT .. Timeout, CPF