dtls: Fix some compiler warnings
authorSebastian Dröge <sebastian@centricular.com>
Mon, 16 Mar 2015 16:35:29 +0000 (17:35 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 16 Mar 2015 17:23:27 +0000 (18:23 +0100)
gstdtlsconnection.c:128:32: error: passing 'const char [30]' to parameter of type 'void *'
      discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
      SSL_get_ex_new_index (0, "gstdtlsagent connection index", NULL, NULL,
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openssl/ssl.h:1981:43: note: passing argument to parameter 'argp' here
int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
                                          ^
gstdtlsconnection.c:822:40: error: arithmetic on a pointer to void is a GNU extension
      [-Werror,-Wpointer-arith]
  memcpy (out_buffer, priv->bio_buffer + priv->bio_buffer_offset, copy_size);
                      ~~~~~~~~~~~~~~~~ ^

ext/dtls/gstdtlsconnection.c

index f5505c2aefccb47645bb29495eeb58f4bb8e30ca..39a3a0b89942e6260066f2595b0b9a8e4a41cba7 100644 (file)
@@ -125,8 +125,8 @@ er_dtls_connection_class_init (ErDtlsConnectionClass * klass)
   gobject_class->set_property = er_dtls_connection_set_property;
 
   connection_ex_index =
-      SSL_get_ex_new_index (0, "gstdtlsagent connection index", NULL, NULL,
-      NULL);
+      SSL_get_ex_new_index (0, (gpointer) "gstdtlsagent connection index", NULL,
+      NULL, NULL);
 
   signals[SIGNAL_ON_DECODER_KEY] =
       g_signal_new ("on-decoder-key", G_TYPE_FROM_CLASS (klass),
@@ -819,7 +819,8 @@ bio_method_read (BIO * bio, char *out_buffer, int size)
       "reading %d/%d bytes %d at offset %d, output buff size is %d", copy_size,
       priv->bio_buffer_len, internal_size, priv->bio_buffer_offset, size);
 
-  memcpy (out_buffer, priv->bio_buffer + priv->bio_buffer_offset, copy_size);
+  memcpy (out_buffer, (guint8 *) priv->bio_buffer + priv->bio_buffer_offset,
+      copy_size);
   priv->bio_buffer_offset += copy_size;
 
   if (priv->bio_buffer_len == priv->bio_buffer_offset) {