summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-08 21:43:26 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-08 21:44:53 +0200
commit0d6f7fd6fd9dcaa62fb77a10d3a1ad8d0d74f980 (patch)
treedb39fd913f349a353a62ead250210aab49a8cc09 /lib
parent3c685e64ff0529cf5bf949dca0b63faf8b79ccb6 (diff)
*: Replace `sizeof something` to sizeof(something)
Satisfy checkpatch.pl requirements (check for sizeof without parenthesis) Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/agentx.c2
-rw-r--r--lib/buffer.c4
-rw-r--r--lib/md5.c4
-rw-r--r--lib/prefix.c2
-rw-r--r--lib/printf/printf-pos.c2
-rw-r--r--lib/sockopt.c2
-rw-r--r--lib/sockopt.h10
-rw-r--r--lib/sockunion.c10
-rw-r--r--lib/thread.c2
-rw-r--r--lib/zclient.c2
10 files changed, 20 insertions, 20 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index b479b5ea4c..d1b801fe8c 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -264,7 +264,7 @@ int smux_trap(struct variable *vp, size_t vp_len, const oid *ename,
uint8_t sptrap)
{
oid objid_snmptrap[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
- size_t objid_snmptrap_len = sizeof objid_snmptrap / sizeof(oid);
+ size_t objid_snmptrap_len = sizeof(objid_snmptrap) / sizeof(oid);
oid notification_oid[MAX_OID_LEN];
size_t notification_oid_len;
unsigned int i;
diff --git a/lib/buffer.c b/lib/buffer.c
index 766b9791a5..ff49bc83df 100644
--- a/lib/buffer.c
+++ b/lib/buffer.c
@@ -288,7 +288,7 @@ buffer_status_t buffer_flush_window(struct buffer *b, int fd, int width,
/* Previously print out is performed. */
if (erase_flag) {
iov[iov_index].iov_base = erase;
- iov[iov_index].iov_len = sizeof erase;
+ iov[iov_index].iov_len = sizeof(erase);
iov_index++;
}
@@ -341,7 +341,7 @@ buffer_status_t buffer_flush_window(struct buffer *b, int fd, int width,
/* In case of `more' display need. */
if (b->tail && (b->tail->sp < b->tail->cp) && !no_more_flag) {
iov[iov_index].iov_base = more;
- iov[iov_index].iov_len = sizeof more;
+ iov[iov_index].iov_len = sizeof(more);
iov_index++;
}
diff --git a/lib/md5.c b/lib/md5.c
index 5a3e7c8d1b..9c003a3af6 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -412,8 +412,8 @@ void hmac_md5(unsigned char *text, int text_len, unsigned char *key,
*/
/* start out by storing key in pads */
- bzero(k_ipad, sizeof k_ipad);
- bzero(k_opad, sizeof k_opad);
+ bzero(k_ipad, sizeof(k_ipad));
+ bzero(k_opad, sizeof(k_opad));
bcopy(key, k_ipad, key_len);
bcopy(key, k_opad, key_len);
diff --git a/lib/prefix.c b/lib/prefix.c
index 2b7727fd0a..80fe0f54a9 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -1082,7 +1082,7 @@ struct prefix *prefix_new(void)
{
struct prefix *p;
- p = XCALLOC(MTYPE_PREFIX, sizeof *p);
+ p = XCALLOC(MTYPE_PREFIX, sizeof(*p));
return p;
}
diff --git a/lib/printf/printf-pos.c b/lib/printf/printf-pos.c
index 20a58eacdc..cc03f7ef9a 100644
--- a/lib/printf/printf-pos.c
+++ b/lib/printf/printf-pos.c
@@ -686,7 +686,7 @@ build_arg_table(struct typetable *types, va_list ap, union arg **argtable)
if (types->tablemax >= STATIC_ARG_TBL_SIZE) {
*argtable = (union arg *)
- malloc (sizeof (union arg) * (types->tablemax + 1));
+ malloc (sizeof(union arg) * (types->tablemax + 1));
if (*argtable == NULL)
return;
}
diff --git a/lib/sockopt.c b/lib/sockopt.c
index 52b1f0356e..45d9008796 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -683,7 +683,7 @@ int sockopt_tcp_signature_ext(int sock, union sockunion *su, uint16_t prefixlen,
#endif /* GNU_LINUX */
if ((ret = setsockopt(sock, IPPROTO_TCP, optname, &md5sig,
- sizeof md5sig))
+ sizeof(md5sig)))
< 0) {
/* ENOENT is harmless. It is returned when we clear a password
for which
diff --git a/lib/sockopt.h b/lib/sockopt.h
index 59d8a65964..4081e6a45b 100644
--- a/lib/sockopt.h
+++ b/lib/sockopt.h
@@ -39,7 +39,7 @@ extern int setsockopt_ipv6_hoplimit(int, int);
extern int setsockopt_ipv6_multicast_loop(int, int);
extern int setsockopt_ipv6_tclass(int, int);
-#define SOPT_SIZE_CMSG_PKTINFO_IPV6() (sizeof (struct in6_pktinfo));
+#define SOPT_SIZE_CMSG_PKTINFO_IPV6() (sizeof(struct in6_pktinfo));
/*
* Size defines for control messages used to get ifindex. We define
@@ -49,7 +49,7 @@ extern int setsockopt_ipv6_tclass(int, int);
*/
#if defined(IP_PKTINFO)
/* Linux in_pktinfo. */
-#define SOPT_SIZE_CMSG_PKTINFO_IPV4() (CMSG_SPACE(sizeof (struct in_pktinfo)))
+#define SOPT_SIZE_CMSG_PKTINFO_IPV4() (CMSG_SPACE(sizeof(struct in_pktinfo)))
/* XXX This should perhaps be defined even if IP_PKTINFO is not. */
#define SOPT_SIZE_CMSG_PKTINFO(af) \
((af == AF_INET) ? SOPT_SIZE_CMSG_PKTINFO_IPV4() \
@@ -60,9 +60,9 @@ extern int setsockopt_ipv6_tclass(int, int);
/* BSD/Solaris */
#if defined(SUNOS_5)
-#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof (uint_t))
+#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof(uint_t))
#else
-#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof (struct sockaddr_dl))
+#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof(struct sockaddr_dl))
#endif /* SUNOS_5 */
#endif /* IP_RECVIF */
@@ -72,7 +72,7 @@ extern int setsockopt_ipv6_tclass(int, int);
#elif defined(SOPT_SIZE_CMSG_RECVIF_IPV4)
#define SOPT_SIZE_CMSG_IFINDEX_IPV4() SOPT_SIZE_CMSG_RECVIF_IPV4()
#else /* Nothing available */
-#define SOPT_SIZE_CMSG_IFINDEX_IPV4() (sizeof (char *))
+#define SOPT_SIZE_CMSG_IFINDEX_IPV4() (sizeof(char *))
#endif /* SOPT_SIZE_CMSG_IFINDEX_IPV4 */
#define SOPT_SIZE_CMSG_IFINDEX(af) \
diff --git a/lib/sockunion.c b/lib/sockunion.c
index e9c418fdf2..63d8a8c69b 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -214,7 +214,7 @@ enum connect_result sockunion_connect(int fd, const union sockunion *peersu,
if (errno != EINPROGRESS) {
char str[SU_ADDRSTRLEN];
zlog_info("can't connect to %s fd %d : %s",
- sockunion_log(&su, str, sizeof str), fd,
+ sockunion_log(&su, str, sizeof(str)), fd,
safe_strerror(errno));
return connect_error;
}
@@ -518,8 +518,8 @@ union sockunion *sockunion_getsockname(int fd)
} name;
union sockunion *su;
- memset(&name, 0, sizeof name);
- len = sizeof name;
+ memset(&name, 0, sizeof(name));
+ len = sizeof(name);
ret = getsockname(fd, (struct sockaddr *)&name, &len);
if (ret < 0) {
@@ -556,8 +556,8 @@ union sockunion *sockunion_getpeername(int fd)
} name;
union sockunion *su;
- memset(&name, 0, sizeof name);
- len = sizeof name;
+ memset(&name, 0, sizeof(name));
+ len = sizeof(name);
ret = getpeername(fd, (struct sockaddr *)&name, &len);
if (ret < 0) {
flog_err(EC_LIB_SOCKET, "Can't get remote address and port: %s",
diff --git a/lib/thread.c b/lib/thread.c
index 651d26dfb2..2217a60f0a 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -171,7 +171,7 @@ static void cpu_record_print(struct vty *vty, uint8_t filter)
struct thread_master *m;
struct listnode *ln;
- memset(&tmp, 0, sizeof tmp);
+ memset(&tmp, 0, sizeof(tmp));
tmp.funcname = "TOTAL";
tmp.types = filter;
diff --git a/lib/zclient.c b/lib/zclient.c
index ec193035f5..eac6c7081d 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1976,7 +1976,7 @@ struct connected *zebra_interface_address_read(int type, struct stream *s,
"warning: interface %s address %s with peer flag set, but no peer address!",
ifp->name,
prefix2str(ifc->address, buf,
- sizeof buf));
+ sizeof(buf)));
UNSET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
}
}