Explorar o código

Remove 64bit switch

Signed-off-by: Martin Melik Merkumians <melik-merkumians@acin.tuwien.ac.at>
Martin Melik Merkumians %!s(int64=5) %!d(string=hai) anos
pai
achega
da5f736490

+ 0 - 8
source/CMakeLists.txt

@@ -70,14 +70,6 @@ set_property(CACHE OpENer_PLATFORM PROPERTY STRINGS ${OpENer_KNOWN_PLATFORMS} )
 #######################################
 INCLUDE( ${OpENer_BUILDSUPPORT_DIR}/OpENer_function_checks.cmake )
 
-#######################################
-# OpENer 64-bit data types            #
-#######################################
-set( OpENer_64_BIT_DATA_TYPES_ENABLED CACHE BOOL "Enable 64-bit data type support" )
-if( OpENer_64_BIT_DATA_TYPES_ENABLED )
-  add_definitions( -DOPENER_SUPPORT_64BIT_DATATYPES )
-endif( OpENer_64_BIT_DATA_TYPES_ENABLED )
-
 #######################################
 # OpENer tracer switches              #
 #######################################

+ 2 - 4
source/src/cip/cipcommon.c

@@ -216,7 +216,7 @@ CipClass *CreateCipClass(const CipUdint class_code,
   OPENER_TRACE_INFO("creating class '%s' with code: 0x%" PRIX32 "\n", name,
                     class_code);
 
-  OPENER_ASSERT(NULL == GetCipClass(class_code)); /* check if an class with the ClassID already exists */
+  OPENER_ASSERT(NULL == GetCipClass(class_code) ); /* check if an class with the ClassID already exists */
   /* should never try to redefine a class*/
 
   /* a metaClass is a class that holds the class attributes and services
@@ -225,7 +225,7 @@ CipClass *CreateCipClass(const CipUdint class_code,
      and contains a pointer to a metaclass
      CIP never explicitly addresses a metaclass*/
 
-  CipClass * const cip_class = (CipClass *) CipCalloc(1, sizeof(CipClass) );       /* create the class object*/
+  CipClass *const cip_class = (CipClass *) CipCalloc(1, sizeof(CipClass) );        /* create the class object*/
   CipClass *const meta_class = (CipClass *) CipCalloc(1, sizeof(CipClass) );       /* create the metaclass object*/
 
   /* initialize the class-specific fields of the Class struct*/
@@ -704,7 +704,6 @@ int DecodeData(const EipUint8 cip_data_type,
       number_of_decoded_bytes = 4;
       break;
 
-#ifdef OPENER_SUPPORT_64BIT_DATATYPES
     case (kCipLint):
     case (kCipUlint):
     case (kCipLword): {
@@ -712,7 +711,6 @@ int DecodeData(const EipUint8 cip_data_type,
       number_of_decoded_bytes = 8;
     }
     break;
-#endif
 
     case (kCipString): {
       CipString *string = (CipString *) cip_data;

+ 0 - 5
source/src/enet_encap/endianconv.c

@@ -138,8 +138,6 @@ void AddDintToMessage(const EipUint32 data,
   outgoing_message->used_message_length += 4;
 }
 
-#ifdef OPENER_SUPPORT_64BIT_DATATYPES
-
 /**
  *   @brief Reads EipUint64 from *pa_buf and converts little endian to host.
  *   @param pa_buf pointer where data should be reed.
@@ -186,9 +184,6 @@ void AddLintToMessage(const EipUint64 data,
   outgoing_message->used_message_length += 8;
 }
 
-#endif
-
-
 void EncapsulateIpAddress(EipUint16 port,
                           EipUint32 address,
                           ENIPMessage *const outgoing_message) {

+ 0 - 4
source/src/enet_encap/endianconv.h

@@ -83,8 +83,6 @@ void AddIntToMessage(const EipUint16 data,
 void AddDintToMessage(const EipUint32 data,
                       ENIPMessage *const outgoing_message);
 
-#ifdef OPENER_SUPPORT_64BIT_DATATYPES
-
 EipUint64 GetLintFromMessage(const EipUint8 **const buffer);
 
 /** @ingroup ENCAP
@@ -97,8 +95,6 @@ EipUint64 GetLintFromMessage(const EipUint8 **const buffer);
 void AddLintToMessage(const EipUint64 pa_unData,
                       ENIPMessage *const outgoing_message);
 
-#endif
-
 /** @brief Encapsulate the sockaddr information as necessary for the Common Packet Format data items
  *
  * Converts and adds the provided port and IP address into an common packet format message

+ 0 - 2
source/src/typedefs.h

@@ -54,14 +54,12 @@ typedef int32_t CipDint; /**< 32-bit signed integer */
 typedef float CipReal; /**< 32-bit IEEE 754 floating point */
 typedef double CipLreal; /**< 64-bit IEEE 754 floating point */
 
-#ifdef OPENER_SUPPORT_64BIT_DATATYPES
 typedef int64_t EipInt64; /**< 64-bit signed number */
 typedef uint64_t EipUint64; /**< 64-bit unsigned number */
 
 typedef int64_t CipLint; /**< 64-bit signed integer */
 typedef uint64_t CipUlint; /**< 64-bit unsigned integer */
 typedef uint64_t CipLword; /**< 64-bit bit string */
-#endif /* OPENER_SUPPORT_64BIT_DATATYPES */
 
 /** @brief Constant identifying if a socket descriptor is invalid
  */

+ 1 - 1
travis_scripts/linuxScript.sh

@@ -5,7 +5,7 @@ echo 'Linux main Script started...'
 set -e
 
 cd $TRAVIS_BUILD_DIR/source
-cmake -DOpENer_PLATFORM:STRING="POSIX" -DCMAKE_BUILD_TYPE:STRING="Debug" -DOpENer_64_BIT_DATA_TYPES_ENABLED:BOOL=ON \
+cmake -DOpENer_PLATFORM:STRING="POSIX" -DCMAKE_BUILD_TYPE:STRING="Debug" \
   -DOpENer_TESTS:BOOL=ON -DCPPUTEST_HOME:PATH=$TRAVIS_BUILD_DIR/source/dependencies/cpputest \
   -DCPPUTEST_LIBRARY:FILEPATH=$TRAVIS_BUILD_DIR/source/dependencies/cpputest/src/CppUTest/libCppUTest.a \
   -DCPPUTESTEXT_LIBRARY:FILEPATH=$TRAVIS_BUILD_DIR/source/dependencies/cpputest/src/CppUTestExt/libCppUTestExt.a .

+ 2 - 2
travis_scripts/windowsMinGWScript.sh

@@ -4,5 +4,5 @@ echo 'Windows MinGW main Script started...'
 set -e
 
 cd $TRAVIS_BUILD_DIR/source
-cmake -G "MinGW Makefiles" -DOpENer_PLATFORM:STRING="MINGW" -DCMAKE_BUILD_TYPE:STRING="Debug" -DOpENer_64_BIT_DATA_TYPES_ENABLED:BOOL=ON -DCMAKE_SH="CMAKE_SH-NOTFOUND" .
-mingw32-make
+cmake -G "MinGW Makefiles" -DOpENer_PLATFORM:STRING="MINGW" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_SH="CMAKE_SH-NOTFOUND" .
+mingw32-make

+ 2 - 2
travis_scripts/windowsScript.sh

@@ -5,5 +5,5 @@ echo 'Windows main Script started...'
 set -e
 
 cd $TRAVIS_BUILD_DIR/source
-cmake -DOpENer_PLATFORM:STRING="WIN32" -DCMAKE_BUILD_TYPE:STRING="Debug" -DOpENer_64_BIT_DATA_TYPES_ENABLED:BOOL=ON .
-"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" OpENer.sln //p:Configuration=Release //p:Platform="Win32"
+cmake -DOpENer_PLATFORM:STRING="WIN32" -DCMAKE_BUILD_TYPE:STRING="Debug" .
+"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" OpENer.sln //p:Configuration=Release //p:Platform="Win32"