summaryrefslogtreecommitdiff
path: root/wiretap/logcat.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-09-22 10:25:32 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2014-09-26 09:10:38 +0000
commit1275d05913e7ad40208fd34746748ff9ac3324b3 (patch)
treec32bce76f4fe6b87577273e8249ea64cf0434266 /wiretap/logcat.c
parente179870a12296cd39b19ce01422ba4296d22c9a1 (diff)
downloadwireshark-1275d05913e7ad40208fd34746748ff9ac3324b3.tar.gz
Reduce compilator warnings
warning: cast from 'const guint8 *' (aka 'const unsigned char *') to 'const guint16 *' (aka 'const unsigned short *') increases required alignment from 1 to 2 [-Wcast-align] warning: cast from 'const guint8 *' (aka 'const unsigned char *') to 'const struct logger_entry *' increases required alignment from 1 to 4 [-Wcast-align] Change-Id: I1ef8bfedb31c3f633166405689d8d788d45365db Reviewed-on: https://code.wireshark.org/review/4236 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Tested-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'wiretap/logcat.c')
-rw-r--r--wiretap/logcat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/logcat.c b/wiretap/logcat.c
index d71f583b9d..f50b118fe3 100644
--- a/wiretap/logcat.c
+++ b/wiretap/logcat.c
@@ -85,8 +85,8 @@ static gint detect_version(wtap *wth, int *err, gchar **err_info)
/* ensure buffer is large enough for all versions */
buffer = (guint8 *) g_malloc(sizeof(*log_entry_v2) + payload_length);
- log_entry_v2 = (struct logger_entry_v2 *) buffer;
- log_entry = (struct logger_entry *) buffer;
+ log_entry_v2 = (struct logger_entry_v2 *)(void *) buffer;
+ log_entry = (struct logger_entry *)(void *) buffer;
/* cannot rely on __pad being 0 for v1, use heuristics to find out what
* version is in use. First assume the smallest msg. */
@@ -143,14 +143,14 @@ gint logcat_exported_pdu_length(const guint8 *pd) {
const guint16 *tag_length;
gint length = 0;
- tag = (const guint16 *) pd;
+ tag = (const guint16 *)(const void *) pd;
while(GINT16_FROM_BE(*tag)) {
- tag_length = (const guint16 *) (pd + 2);
+ tag_length = (const guint16 *)(const void *) (pd + 2);
length += 2 + 2 + GINT16_FROM_BE(*tag_length);
pd += 2 + 2 + GINT16_FROM_BE(*tag_length);
- tag = (const guint16 *) pd;
+ tag = (const guint16 *)(const void *) pd;
}
length += 2 + 2;
@@ -187,7 +187,7 @@ static gboolean logcat_read_packet(struct logcat_phdr *logcat, FILE_T fh,
ws_buffer_assure_space(buf, packet_size);
pd = ws_buffer_start_ptr(buf);
- log_entry = (struct logger_entry *) pd;
+ log_entry = (struct logger_entry *)(void *) pd;
/* Copy the first two bytes of the packet. */
memcpy(pd, tmp, 2);