tinydtls: fix some compile warnings
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 15 Jan 2016 23:03:07 +0000 (00:03 +0100)
committerRandeep Singh <randeep.s@samsung.com>
Wed, 28 Sep 2016 11:47:47 +0000 (11:47 +0000)
This fixes multiple compiler warnings.

Change-Id: I403fb09b6b8ffc4bc1ca2cc03c90605d9005f8d5
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4823
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
Reviewed-by: David Antler <david.a.antler@intel.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
extlibs/tinydtls/debug.h
extlibs/tinydtls/dtls.c

index 89af876..b5c8199 100644 (file)
@@ -60,8 +60,6 @@ INLINE_API void check_stack() {
 }
 #endif
 
-struct __session_t;
-
 /** Pre-defined log levels akin to what is used in \b syslog. */
 typedef enum { DTLS_LOG_EMERG=0, DTLS_LOG_ALERT, DTLS_LOG_CRIT, DTLS_LOG_WARN, 
        DTLS_LOG_NOTICE, DTLS_LOG_INFO, DTLS_LOG_DEBUG
@@ -124,7 +122,7 @@ dtls_dsrv_hexdump_log(log_t level, const char *name, const unsigned char *buf, s
 {}
 
 INLINE_API void
-dtls_dsrv_log_addr(log_t level, const char *name, const struct __session_t *addr)
+dtls_dsrv_log_addr(log_t level, const char *name, const session_t *addr)
 {}
 
 #endif /* NDEBUG */
index 3b593ce..5f2e400 100644 (file)
@@ -317,7 +317,8 @@ dtls_create_cookie(dtls_context_t *ctx,
                   uint8 *msg, size_t msglen,
                   uint8 *cookie, int *clen) {
   unsigned char buf[DTLS_HMAC_MAX];
-  size_t len, e;
+  int len;
+  size_t e;
 
   /* create cookie with HMAC-SHA256 over:
    * - SECRET
@@ -1082,7 +1083,8 @@ static int
 dtls_update_parameters(dtls_context_t *ctx, 
                       dtls_peer_t *peer,
                       uint8 *data, size_t data_length) {
-  int i, j;
+  int i;
+  unsigned int j;
   int ok;
   dtls_handshake_parameters_t *config = peer->handshake_params;
   dtls_security_parameters_t *security = dtls_security_params(peer);
@@ -3892,7 +3894,7 @@ handle_handshake_msg(dtls_context_t *ctx, dtls_peer_t *peer, session_t *session,
         }
       err = check_server_key_exchange_ecdhe_psk(ctx, peer, data, data_length);
     }
-#endif defined(DTLS_PSK) && defined(DTLS_ECC)
+#endif /* defined(DTLS_PSK) && defined(DTLS_ECC) */
 
 #ifdef DTLS_PSK
     if (is_tls_psk_with_aes_128_ccm_8(peer->handshake_params->cipher)) {