From 6ff13bdf40dcd58db8a24270cbd471a74743bce9 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Sun, 13 Sep 2020 16:06:43 +0100 Subject: [PATCH] Lose underscores in some macro names. [skip ci] --- ah.h | 6 +++--- cpack.h | 6 +++--- getservent.h | 6 +++--- ip6.h | 6 +++--- missing/getopt_long.h | 6 +++--- timeval-operations.h | 21 ++++++++------------- 6 files changed, 23 insertions(+), 28 deletions(-) diff --git a/ah.h b/ah.h index 90c56010..3a9dbd80 100644 --- a/ah.h +++ b/ah.h @@ -34,8 +34,8 @@ * RFC1826/2402 authentication header. */ -#ifndef _NETINET6_AH_H_ -#define _NETINET6_AH_H_ +#ifndef ND_AH_H_ +#define ND_AH_H_ struct ah { nd_uint8_t ah_nxt; /* Next Header */ @@ -54,4 +54,4 @@ struct newah { /* variable size, 32bit bound*/ /* Authentication data */ }; -#endif /*_NETINET6_AH_H_*/ +#endif /* ND_AH_H_ */ diff --git a/cpack.h b/cpack.h index 6e709778..71ab4f87 100644 --- a/cpack.h +++ b/cpack.h @@ -27,8 +27,8 @@ * OF SUCH DAMAGE. */ -#ifndef _CPACK_H -#define _CPACK_H +#ifndef ND_CPACK_H +#define ND_CPACK_H #include "netdissect.h" @@ -54,4 +54,4 @@ const uint8_t *cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize); extern int cpack_advance(struct cpack_state *, const size_t); -#endif /* _CPACK_H */ +#endif /* ND_CPACK_H */ diff --git a/getservent.h b/getservent.h index 83ef8649..6fa5f361 100644 --- a/getservent.h +++ b/getservent.h @@ -34,8 +34,8 @@ * SUCH DAMAGE. */ -#ifndef _GETSERVENT_H -#define _GETSERVENT_H +#ifndef ND_GETSERVENT_H +#define ND_GETSERVENT_H #ifdef _NETDB_H_ /* Just in case... */ @@ -64,4 +64,4 @@ void endservent (void); struct servent *getservent(void); void setservent (int f); -#endif /* !_GETSERVENT_H */ +#endif /* ! ND_GETSERVENT_H */ diff --git a/ip6.h b/ip6.h index 5de36af0..28725d05 100644 --- a/ip6.h +++ b/ip6.h @@ -65,8 +65,8 @@ * @(#)ip.h 8.1 (Berkeley) 6/10/93 */ -#ifndef _NETINET_IP6_H_ -#define _NETINET_IP6_H_ +#ifndef ND_IP6_H_ +#define ND_IP6_H_ /* * Definition for internet protocol version 6. @@ -209,4 +209,4 @@ struct ip6_frag { #define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ #define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ -#endif /* not _NETINET_IP6_H_ */ +#endif /* not ND_IP6_H_ */ diff --git a/missing/getopt_long.h b/missing/getopt_long.h index fbb94e6b..af97965e 100644 --- a/missing/getopt_long.h +++ b/missing/getopt_long.h @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _GETOPT_LONG_H_ -#define _GETOPT_LONG_H_ +#ifndef ND_GETOPT_LONG_H_ +#define ND_GETOPT_LONG_H_ /* * GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension. @@ -63,4 +63,4 @@ int getopt_long_only(int, char * const *, const char *, extern char *optarg; /* getopt(3) external variables */ extern int optind, opterr, optopt; -#endif /* !_GETOPT_LONG_H_ */ +#endif /* ! ND_GETOPT_LONG_H_ */ diff --git a/timeval-operations.h b/timeval-operations.h index 2848cdcf..177027db 100644 --- a/timeval-operations.h +++ b/timeval-operations.h @@ -30,13 +30,8 @@ /* Operations on timevals. */ -#ifndef _MICRO_PER_SEC -#define _MICRO_PER_SEC 1000000 -#endif - -#ifndef _NANO_PER_SEC -#define _NANO_PER_SEC 1000000000 -#endif +#define ND_MICRO_PER_SEC 1000000 +#define ND_NANO_PER_SEC 1000000000 #define netdissect_timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) @@ -52,14 +47,14 @@ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ if (nano_prec) { \ - if ((vvp)->tv_usec >= _NANO_PER_SEC) { \ + if ((vvp)->tv_usec >= ND_NANO_PER_SEC) { \ (vvp)->tv_sec++; \ - (vvp)->tv_usec -= _NANO_PER_SEC; \ + (vvp)->tv_usec -= ND_NANO_PER_SEC; \ } \ } else { \ - if ((vvp)->tv_usec >= _MICRO_PER_SEC) { \ + if ((vvp)->tv_usec >= ND_MICRO_PER_SEC) { \ (vvp)->tv_sec++; \ - (vvp)->tv_usec -= _MICRO_PER_SEC; \ + (vvp)->tv_usec -= ND_MICRO_PER_SEC; \ } \ } \ } while (0) @@ -70,8 +65,8 @@ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ if ((vvp)->tv_usec < 0) { \ (vvp)->tv_sec--; \ - (vvp)->tv_usec += (nano_prec ? _NANO_PER_SEC : \ - _MICRO_PER_SEC); \ + (vvp)->tv_usec += (nano_prec ? ND_NANO_PER_SEC : \ + ND_MICRO_PER_SEC); \ } \ } while (0)