aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorBalint Reczey <balint@balintreczey.hu>2016-10-18 22:41:55 +0200
committerAnders Broman <a.broman58@gmail.com>2016-10-19 04:02:06 +0000
commitbf96599f1916667cc8f1c19b58fe9cae4a1e3d66 (patch)
treed2106bfdf9eecd4f4470f15426efe0c3c05e26ee /plugins
parent739bdfb45f6e6f78a88e978de1eff088377e8330 (diff)
Drop redundant SIZEOF() macro
Change-Id: I6db2033746f5f22dd0229c96727bb352bdb1e866 Reviewed-on: https://code.wireshark.org/review/18298 Reviewed-by: Balint Reczey <balint@balintreczey.hu> Petri-Dish: Balint Reczey <balint@balintreczey.hu> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gryphon/packet-gryphon.c20
-rw-r--r--plugins/gryphon/packet-gryphon.h2
2 files changed, 10 insertions, 12 deletions
diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c
index b9a4e21ee6..9308771a58 100644
--- a/plugins/gryphon/packet-gryphon.c
+++ b/plugins/gryphon/packet-gryphon.c
@@ -917,19 +917,19 @@ decode_command(tvbuff_t *tvb, int offset, int dst, proto_tree *pt)
if (cmd > 0x3F)
cmd += dst * 256;
- for (i = 0; i < SIZEOF(cmds); i++) {
+ for (i = 0; i < array_length(cmds); i++) {
if (cmds[i].value == cmd)
break;
}
- if (i >= SIZEOF(cmds) && dst >= SD_KNOWN) {
+ if (i >= array_length(cmds) && dst >= SD_KNOWN) {
cmd = (cmd & 0xFF) + SD_CARD * 256;
- for (i = 0; i < SIZEOF(cmds); i++) {
+ for (i = 0; i < array_length(cmds); i++) {
if (cmds[i].value == cmd)
break;
}
}
- if (i >= SIZEOF(cmds))
- i = SIZEOF(cmds) - 1;
+ if (i >= array_length(cmds))
+ i = array_length(cmds) - 1;
proto_tree_add_string(pt, hf_gryphon_command, tvb, offset, 4, cmds[i].strptr);
offset += 4;
@@ -955,19 +955,19 @@ decode_response(tvbuff_t *tvb, int offset, int src, proto_tree *pt)
if (cmd > 0x3F)
cmd += src * 256;
- for (i = 0; i < SIZEOF(cmds); i++) {
+ for (i = 0; i < array_length(cmds); i++) {
if (cmds[i].value == cmd)
break;
}
- if (i >= SIZEOF(cmds) && src >= SD_KNOWN) {
+ if (i >= array_length(cmds) && src >= SD_KNOWN) {
cmd = (cmd & 0xFF) + SD_CARD * 256;
- for (i = 0; i < SIZEOF(cmds); i++) {
+ for (i = 0; i < array_length(cmds); i++) {
if (cmds[i].value == cmd)
break;
}
}
- if (i >= SIZEOF(cmds))
- i = SIZEOF(cmds) - 1;
+ if (i >= array_length(cmds))
+ i = array_length(cmds) - 1;
proto_tree_add_string(pt, hf_gryphon_command, tvb, offset, 4, cmds[i].strptr);
offset += 4;
msglen -= 4;
diff --git a/plugins/gryphon/packet-gryphon.h b/plugins/gryphon/packet-gryphon.h
index 75b7f22b21..3d7b9a5a3c 100644
--- a/plugins/gryphon/packet-gryphon.h
+++ b/plugins/gryphon/packet-gryphon.h
@@ -449,8 +449,6 @@
#define GLIN 0x0b /* LIN TYPE */
#define GDGLIN08 0x01 /* DG HC08 SUBTYPE */
-#define SIZEOF(x) (sizeof(x)/sizeof(x[0]))
-
#define MEMCPY(dest, src, size) \
memcpy (dest, src, size); \
*((dest)+size) = 0;