summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-11-28 14:32:20 +0100
committerAleksander Morgado <aleksandermj@chromium.org>2022-12-01 12:07:24 +0000
commit0515eb13d8d1034625f489e77077c42c8cc0acf7 (patch)
tree307974824bf915bf2bae9b4617043b660a984c37
parentd6b297b39045019d8b0555c886e041a452121ec5 (diff)
downloadlibmbim-0515eb13d8d1034625f489e77077c42c8cc0acf7.tar.gz
libmbim-glib,tlv: avoid cast alignment warning
../src/libmbim-glib/mbim-tlv.c:308:37: warning: cast from 'guint8 *' (aka 'unsigned char *') to 'const guint16 *' (aka 'const unsigned short *') increases required alignment from 1 to 2 [-Wcast-align] tmp = (guint16 *) g_memdup ((const guint16 *)MBIM_TLV_FIELD_DATA (self), size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_memdup() wants a pointer, so there is no need for the explicit cast to a different type. Fixes https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/issues/35
-rw-r--r--src/libmbim-glib/mbim-tlv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libmbim-glib/mbim-tlv.c b/src/libmbim-glib/mbim-tlv.c
index 8058836..18a3f65 100644
--- a/src/libmbim-glib/mbim-tlv.c
+++ b/src/libmbim-glib/mbim-tlv.c
@@ -305,7 +305,7 @@ mbim_tlv_guint16_array_get (const MbimTlv *self,
}
if (size) {
- tmp = (guint16 *) g_memdup ((const guint16 *)MBIM_TLV_FIELD_DATA (self), size);
+ tmp = (guint16 *) g_memdup ((gconstpointer) MBIM_TLV_FIELD_DATA (self), size);
/* For BE systems, convert from LE to BE */
if (G_BYTE_ORDER == G_BIG_ENDIAN) {