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/query.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/query.c')
-rw-r--r-- | usr.sbin/nscd/query.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/nscd/query.c b/usr.sbin/nscd/query.c index fff6aff..c233e19 100644 --- a/usr.sbin/nscd/query.c +++ b/usr.sbin/nscd/query.c @@ -335,11 +335,11 @@ on_write_request_read1(struct query_state *qstate) return (-1); } - write_request->entry = (char *)calloc(1, + write_request->entry = calloc(1, write_request->entry_length + 1); assert(write_request->entry != NULL); - write_request->cache_key = (char *)calloc(1, + write_request->cache_key = calloc(1, write_request->cache_key_size + qstate->eid_str_length); assert(write_request->cache_key != NULL); @@ -347,7 +347,7 @@ on_write_request_read1(struct query_state *qstate) qstate->eid_str_length); if (write_request->data_size != 0) { - write_request->data = (char *)calloc(1, + write_request->data = calloc(1, write_request->data_size); assert(write_request->data != NULL); } @@ -608,11 +608,11 @@ on_read_request_read1(struct query_state *qstate) return (-1); } - read_request->entry = (char *)calloc(1, + read_request->entry = calloc(1, read_request->entry_length + 1); assert(read_request->entry != NULL); - read_request->cache_key = (char *)calloc(1, + read_request->cache_key = calloc(1, read_request->cache_key_size + qstate->eid_str_length); assert(read_request->cache_key != NULL); @@ -723,8 +723,8 @@ on_read_request_process(struct query_state *qstate) &read_response->data_size); if (read_response->error_code == -2) { - read_response->data = (char *)malloc( - read_response->data_size); + read_response->data = malloc( + read_response->data_size); assert(read_response != NULL); read_response->error_code = cache_read(c_entry, read_request->cache_key, @@ -930,7 +930,7 @@ on_transform_request_read1(struct query_state *qstate) return (-1); } - transform_request->entry = (char *)calloc(1, + transform_request->entry = calloc(1, transform_request->entry_length + 1); assert(transform_request->entry != NULL); @@ -1226,7 +1226,7 @@ init_query_state(int sockfd, size_t kevent_watermark, uid_t euid, gid_t egid) struct query_state *retval; TRACE_IN(init_query_state); - retval = (struct query_state *)calloc(1, sizeof(struct query_state)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->sockfd = sockfd; |