Commit cc083bb7 authored by Mark Andrews's avatar Mark Andrews
Browse files

sizeof style

parent 2f025ec6
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.c,v 1.217 2003/04/11 07:25:25 marka Exp $ */
/* $Id: message.c,v 1.218 2003/09/11 01:49:16 marka Exp $ */
/***
*** Imports
......@@ -3065,7 +3065,7 @@ dns_message_totext(dns_message_t *msg, const dns_master_style_t *style,
msg->counts[DNS_SECTION_AUTHORITY]);
ADD_STRING(target, buf);
ADD_STRING(target, ", ADDITIONAL: ");
snprintf(buf, sizeof buf, "%1u",
snprintf(buf, sizeof(buf), "%1u",
msg->counts[DNS_SECTION_ADDITIONAL]);
ADD_STRING(target, buf);
ADD_STRING(target, "\n");
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata.c,v 1.178 2003/07/30 00:54:26 marka Exp $ */
/* $Id: rdata.c,v 1.179 2003/09/11 01:49:16 marka Exp $ */
#include <config.h>
#include <ctype.h>
......@@ -1037,7 +1037,7 @@ dns_mnemonic_totext(unsigned int value, isc_buffer_t *target,
}
i++;
}
snprintf(buf, sizeof buf, "%u", value);
snprintf(buf, sizeof(buf), "%u", value);
return (str_totext(buf, target));
}
......@@ -1198,7 +1198,7 @@ dns_rdatatype_totext(dns_rdatatype_t type, isc_buffer_t *target) {
if (type < (sizeof(typeattr)/sizeof(typeattr[0])))
return (str_totext(typeattr[type].name, target));
snprintf(buf, sizeof buf, "TYPE%u", type);
snprintf(buf, sizeof(buf), "TYPE%u", type);
return (str_totext(buf, target));
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.396 2003/07/25 00:01:06 marka Exp $ */
/* $Id: zone.c,v 1.397 2003/09/11 01:49:16 marka Exp $ */
#include <config.h>
......@@ -1882,12 +1882,12 @@ dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
zone->notifycnt = 0;
}
if (count != 0) {
new = isc_mem_get(zone->mctx, count * sizeof *new);
new = isc_mem_get(zone->mctx, count * sizeof(*new));
if (new == NULL) {
UNLOCK_ZONE(zone);
return (ISC_R_NOMEMORY);
}
memcpy(new, notify, count * sizeof *new);
memcpy(new, notify, count * sizeof(*new));
zone->notify = new;
zone->notifycnt = count;
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: entropy.c,v 1.68 2002/06/20 01:19:51 marka Exp $ */
/* $Id: entropy.c,v 1.69 2003/09/11 01:49:17 marka Exp $ */
/*
* This is the system depenedent part of the ISC entropy API.
......@@ -515,14 +515,14 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
if (is_usocket) {
struct sockaddr_un sname;
memset(&sname, 0, sizeof sname);
memset(&sname, 0, sizeof(sname));
sname.sun_family = AF_UNIX;
strncpy(sname.sun_path, fname, sizeof sname.sun_path);
sname.sun_path[sizeof sname.sun_path-1] = '0';
strncpy(sname.sun_path, fname, sizeof(sname.sun_path));
sname.sun_path[sizeof(sname.sun_path)-1] = '0';
#ifdef ISC_PLATFORM_HAVESALEN
#if !defined(SUN_LEN)
#define SUN_LEN(su) \
(sizeof (*(su)) - sizeof ((su)->sun_path) + strlen((su)->sun_path))
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
#endif
sname.sun_len = SUN_LEN(&sname);
#endif
......
......@@ -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",
......
......@@ -51,7 +51,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
static const char rcsid[] =
"$Id: herror.c,v 1.11 2001/11/27 01:56:30 gson Exp $";
"$Id: herror.c,v 1.12 2003/09/11 01:49:18 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
......@@ -75,7 +75,7 @@ static const char *h_errlist[] = {
"No address associated with name", /* 4 NO_ADDRESS */
};
static int h_nerr = { sizeof(h_errlist) / sizeof (h_errlist[0]) };
static int h_nerr = { sizeof(h_errlist) / sizeof(h_errlist[0]) };
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment