2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

sizeof style

This commit is contained in:
Mark Andrews
2003-09-11 01:49:18 +00:00
parent 2f025ec6fe
commit cc083bb703
6 changed files with 31 additions and 31 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.22 2003/07/09 03:28:44 marka Exp $ */
/* $Id: socket.c,v 1.23 2003/09/11 01:49:17 marka Exp $ */
/* This code has been rewritten to take advantage of Windows Sockets
* I/O Completion Ports and Events. I/O Completion Ports is ONLY
@@ -1017,7 +1017,7 @@ socket_log(isc_socket_t *sock, isc_sockaddr_t *address,
msgcat, msgset, message,
"socket %p: %s", sock, msgbuf);
} else {
isc_sockaddr_format(address, peerbuf, sizeof peerbuf);
isc_sockaddr_format(address, peerbuf, sizeof(peerbuf));
isc_log_iwrite(isc_lctx, category, module, level,
msgcat, msgset, message,
"socket %p %s: %s", sock, peerbuf, msgbuf);
@@ -1098,7 +1098,7 @@ build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
size_t write_count;
size_t skip_count;
memset(msg, 0, sizeof (*msg));
memset(msg, 0, sizeof(*msg));
if (sock->type == isc_sockettype_udp) {
msg->msg_name = (void *)&dev->address.type.sa;
@@ -1184,7 +1184,7 @@ build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev,
isc_region_t available;
size_t read_count;
memset(msg, 0, sizeof (struct msghdr));
memset(msg, 0, sizeof(struct msghdr));
if (sock->type == isc_sockettype_udp) {
memset(&dev->address, 0, sizeof(dev->address));
@@ -1270,7 +1270,7 @@ allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype,
ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx,
sock, eventtype,
action, arg,
sizeof (*ev));
sizeof(*ev));
if (ev == NULL)
return (NULL);
@@ -1680,7 +1680,7 @@ allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type,
isc_socket_t *sock;
isc_result_t ret;
sock = isc_mem_get(manager->mctx, sizeof *sock);
sock = isc_mem_get(manager->mctx, sizeof(*sock));
if (sock == NULL)
return (ISC_R_NOMEMORY);
@@ -1856,7 +1856,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
/* 2292bis */
if ((pf == AF_INET6)
&& (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
(void *)&on, sizeof (on)) < 0)) {
(void *)&on, sizeof(on)) < 0)) {
isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_RECVPKTINFO) "
@@ -1871,7 +1871,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
/* 2292 */
if ((pf == AF_INET6)
&& (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO,
(void *)&on, sizeof (on)) < 0)) {
(void *)&on, sizeof(on)) < 0)) {
isc__strerror(WSAGetLaastError(), strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_PKTINFO) %s: %s",
@@ -1888,7 +1888,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
if (pf == AF_INET6) {
(void)setsockopt(sock->fd, IPPROTO_IPV6,
IPV6_USE_MIN_MTU,
(void *)&on, sizeof (on));
(void *)&on, sizeof(on));
}
#endif
#endif /* ISC_PLATFORM_HAVEIPV6 */
@@ -2069,7 +2069,7 @@ internal_accept(isc_socket_t *sock, int accept_errno) {
* EAGAIN or EINTR, the event wait will be notified again since
* the event will be reset on return to caller.
*/
addrlen = sizeof dev->newsocket->address.type;
addrlen = sizeof(dev->newsocket->address.type);
memset(&dev->newsocket->address.type.sa, 0, addrlen);
fd = accept(sock->fd, &dev->newsocket->address.type.sa,
(void *)&addrlen);
@@ -2630,7 +2630,7 @@ isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) {
}
if (isc_condition_init(&manager->shutdown_ok) != ISC_R_SUCCESS) {
DESTROYLOCK(&manager->lock);
isc_mem_put(mctx, manager, sizeof (*manager));
isc_mem_put(mctx, manager, sizeof(*manager));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_condition_init() %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
@@ -2747,7 +2747,7 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
DESTROYLOCK(&manager->lock);
manager->magic = 0;
mctx= manager->mctx;
isc_mem_put(mctx, manager, sizeof *manager);
isc_mem_put(mctx, manager, sizeof(*manager));
isc_mem_detach(&mctx);
@@ -3105,7 +3105,7 @@ isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr) {
return (ISC_R_FAMILYMISMATCH);
}
if (setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on,
sizeof on) < 0) {
sizeof(on)) < 0) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d) %s", sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
@@ -3232,7 +3232,7 @@ isc_socket_accept(isc_socket_t *sock,
*/
dev = (isc_socket_newconnev_t *)
isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN,
action, arg, sizeof (*dev));
action, arg, sizeof(*dev));
if (dev == NULL) {
UNLOCK(&sock->lock);
return (ISC_R_NOMEMORY);
@@ -3295,7 +3295,7 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
dev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock,
ISC_SOCKEVENT_CONNECT,
action, arg,
sizeof (*dev));
sizeof(*dev));
if (dev == NULL) {
UNLOCK(&sock->lock);
return (ISC_R_NOMEMORY);
@@ -3429,7 +3429,7 @@ isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) {
ret = ISC_R_SUCCESS;
len = sizeof addressp->type;
len = sizeof(addressp->type);
if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) {
isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__, "getsockname: %s",