aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
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;