Просмотр исходного кода

Cleanup: Silence some unused variable compiler warnings

Get rid of the last "unused variable" compiler warnings I see here today.

Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
Stefan Mätje 6 лет назад
Родитель
Сommit
1a25f68243
2 измененных файлов с 8 добавлено и 2 удалено
  1. 3 1
      source/src/cip/cipconnectionobject.c
  2. 5 1
      source/src/cip/cipioconnection.c

+ 3 - 1
source/src/cip/cipconnectionobject.c

@@ -107,7 +107,7 @@ void ConnectionObjectInitializeEmpty(
 }
 
 CipConnectionObject *CipConnectionObjectCreate(const CipOctet *message) {
-  assert(false); /* NOT IMLEMENTED */
+  assert(false); /* NOT IMPLEMENTED */
   return NULL;
 }
 
@@ -117,6 +117,8 @@ void ConnectionObjectInitializeFromMessage(
   /* For unconnected send - can be ignored by targets, and is ignored here */
   CipByte priority_timetick = GetSintFromMessage(message);
   CipUsint timeout_ticks = GetSintFromMessage(message);
+  (void)priority_timetick;  /* Silence unused variable compiler warning */
+  (void)timeout_ticks;
 
   /* O_to_T Conn ID */
   ConnectionObjectSetCipConsumedConnectionID(connection_object,

+ 5 - 1
source/src/cip/cipioconnection.c

@@ -134,7 +134,9 @@ EipUint16 SetupIoConnectionOriginatorToTargetConnectionPoint(
     CipAttributeStruct *attribute = GetCipAttribute(instance,
                                                     io_connection_object->consumed_path.attribute_id_or_connection_point);
     OPENER_ASSERT(attribute != NULL)
+#ifdef OPENER_CONSUMED_DATA_HAS_RUN_IDLE_HEADER
     bool is_heartbeat = ( ( (CipByteArray *) attribute->data )->length == 0 );
+#endif
     if ( kConnectionObjectTransportClassTriggerTransportClass1
          == ConnectionObjectGetTransportClassTriggerTransportClass(
            io_connection_object) ) {
@@ -234,7 +236,9 @@ EipUint16 SetupIoConnectionTargetToOriginatorConnectionPoint(
     CipAttributeStruct *attribute = GetCipAttribute(instance,
                                                     io_connection_object->produced_path.attribute_id_or_connection_point);
     OPENER_ASSERT(attribute != NULL)
+#ifdef OPENER_PRODUCED_DATA_HAS_RUN_IDLE_HEADER
     bool is_heartbeat = ( ( (CipByteArray *) attribute->data )->length == 0 );
+#endif
     if ( kConnectionObjectTransportClassTriggerTransportClass1 ==
          ConnectionObjectGetTransportClassTriggerTransportClass(
            io_connection_object) ) {
@@ -827,7 +831,7 @@ EipStatus SendConnectedData(CipConnectionObject *connection_object) {
   InitializeENIPMessage(&outgoing_message);
   EipUint16 reply_length = AssembleIOMessage(common_packet_format_data,
                                              &outgoing_message);
-
+  (void) reply_length;  /* Silence unused variable compiler warning */
 
   outgoing_message.current_message_position -= 2;
   common_packet_format_data->data_item.length = producing_instance_attributes