diff options
author | des <des@FreeBSD.org> | 2009-06-13 13:07:56 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2009-06-13 13:07:56 +0000 |
commit | feee7c0482f0d8cc0f167db30f14db19552cfb66 (patch) | |
tree | 938166a168a8b3b655695f86589862545145f186 /usr.sbin/nscd/nscd.c | |
parent | 51194019fc09872f7a745dffc7f000c58a8de5d1 (diff) | |
download | FreeBSD-src-feee7c0482f0d8cc0f167db30f14db19552cfb66.zip FreeBSD-src-feee7c0482f0d8cc0f167db30f14db19552cfb66.tar.gz |
Remove casts from {c,m,re}alloc() and simplify sizeof().
MFC after: 1 week
Diffstat (limited to 'usr.sbin/nscd/nscd.c')
-rw-r--r-- | usr.sbin/nscd/nscd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/nscd/nscd.c b/usr.sbin/nscd/nscd.c index 59b3c12..6b5af94 100644 --- a/usr.sbin/nscd/nscd.c +++ b/usr.sbin/nscd/nscd.c @@ -164,7 +164,7 @@ init_runtime_env(struct configuration *config) struct runtime_env *retval; TRACE_IN(init_runtime_env); - retval = (struct runtime_env *)calloc(1, sizeof(struct runtime_env)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->sockfd = socket(PF_LOCAL, SOCK_STREAM, 0); @@ -408,7 +408,7 @@ process_socket_event(struct kevent *event_data, struct runtime_env *env, if (qstate->io_buffer != NULL) free(qstate->io_buffer); - qstate->io_buffer = (char *)calloc(1, + qstate->io_buffer = calloc(1, qstate->kevent_watermark); assert(qstate->io_buffer != NULL); @@ -828,11 +828,11 @@ main(int argc, char *argv[]) } if (s_configuration->threads_num > 1) { - threads = (pthread_t *)calloc(1, sizeof(pthread_t) * + threads = calloc(1, sizeof(*threads) * s_configuration->threads_num); for (i = 0; i < s_configuration->threads_num; ++i) { - thread_args = (struct processing_thread_args *)malloc( - sizeof(struct processing_thread_args)); + thread_args = malloc( + sizeof(*thread_args)); thread_args->the_cache = s_cache; thread_args->the_runtime_env = s_runtime_env; thread_args->the_configuration = s_configuration; |