summaryrefslogtreecommitdiff
path: root/print-ptp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-05-29 23:41:45 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-05-30 00:05:32 +0200
commitea4e272785eb3a1aab6ac148f178439c86aa68ae (patch)
tree80e130e11c05d79c569f2574f6c0fc530c13cb52 /print-ptp.c
parent0181656313fbe514928263f4061d42d338a5bb7c (diff)
downloadtcpdump-ea4e272785eb3a1aab6ac148f178439c86aa68ae.tar.gz
PTP: Declare 'static' some variables
Fix warnings given by '-Wmissing-variable-declarations': ./print-ptp.c:262:13: warning: no previous extern declaration for non-static variable 'p_porigin_ts' [-Wmissing-variable-declarations] const char *p_porigin_ts = "preciseOriginTimeStamp"; ^ ./print-ptp.c:262:7: note: declare 'static' if the variable is not intended to be used outside of this translation unit const char *p_porigin_ts = "preciseOriginTimeStamp"; ^ ./print-ptp.c:263:13: warning: no previous extern declaration for non-static variable 'p_origin_ts' [-Wmissing-variable-declarations] const char *p_origin_ts = "originTimeStamp"; ^ ./print-ptp.c:263:7: note: declare 'static' if the variable is not intended to be used outside of this translation unit const char *p_origin_ts = "originTimeStamp"; ^ ./print-ptp.c:264:13: warning: no previous extern declaration for non-static variable 'p_recv_ts' [-Wmissing-variable-declarations] const char *p_recv_ts = "receiveTimeStamp"; ^ ./print-ptp.c:264:7: note: declare 'static' if the variable is not intended to be used outside of this translation unit const char *p_recv_ts = "receiveTimeStamp"; Moreover: Put a function definition name at the beginning of the line.
Diffstat (limited to 'print-ptp.c')
-rw-r--r--print-ptp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/print-ptp.c b/print-ptp.c
index 36001c10..c6d8e544 100644
--- a/print-ptp.c
+++ b/print-ptp.c
@@ -259,9 +259,9 @@ static const struct tok ptp_flag_values[] = {
ND_PRINT("(%s)", tok2str(ptp_msg_type, "unknown", e)); \
}
-const char *p_porigin_ts = "preciseOriginTimeStamp";
-const char *p_origin_ts = "originTimeStamp";
-const char *p_recv_ts = "receiveTimeStamp";
+static const char *p_porigin_ts = "preciseOriginTimeStamp";
+static const char *p_origin_ts = "originTimeStamp";
+static const char *p_recv_ts = "receiveTimeStamp";
#define PTP_VER_1 0x1
#define PTP_VER_2 0x2
@@ -340,7 +340,8 @@ ptp_print_1(netdissect_options *ndo)
ND_PRINT(" (not implemented)");
}
-static void ptp_print_2(netdissect_options *ndo, const u_char *bp, u_int length)
+static void
+ptp_print_2(netdissect_options *ndo, const u_char *bp, u_int length)
{
u_int len = length;
uint16_t msg_len, flags, port_id, seq_id;