Cleaned up type-limits compiler warning
authorGeorge Nash <george.nash@intel.com>
Tue, 28 Jun 2016 00:09:36 +0000 (17:09 -0700)
committerJon A. Cruz <jon@joncruz.org>
Thu, 14 Jul 2016 20:53:07 +0000 (20:53 +0000)
pdu.c [-Wtype-limites] the comparison was always true due
to the range of data types.

Change-Id: If7981691218a3eece4da1941d5d5679266c401a9
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8977
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c

index c6efa8d..6a53b0b 100644 (file)
@@ -278,12 +278,10 @@ coap_transport_type coap_get_tcp_header_type_from_size(unsigned int size)
     {
         return coap_tcp_16bit;
     }
-    else if (size - COAP_TCP_LENGTH_FIELD_32_BIT < ULONG_MAX)
+    else //if (size - COAP_TCP_LENGTH_FIELD_32_BIT < ULONG_MAX) always true due to range of data types
     {
         return coap_tcp_32bit;
     }
-
-    return -1;
 }
 
 coap_transport_type coap_get_tcp_header_type_from_initbyte(unsigned int length)