diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-07-03 10:52:05 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-07-03 10:52:05 -0400 |
commit | 9b5b46e56eaa4cd8950abb01945740ffa84ba148 (patch) | |
tree | 9de2d6197b1ff518587f82291d9b495bcc2db3c9 /bench | |
parent | e34de1202237a126decbfb12f84d04f8511aca9e (diff) | |
download | mongo-9b5b46e56eaa4cd8950abb01945740ffa84ba148.tar.gz |
Don't cast the return from calloc, it's not necessary.
Diffstat (limited to 'bench')
-rw-r--r-- | bench/wtperf/config.c | 4 | ||||
-rw-r--r-- | bench/wtperf/wtperf.c | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c index 3e9584e8860..9250d91f593 100644 --- a/bench/wtperf/config.c +++ b/bench/wtperf/config.c @@ -61,7 +61,7 @@ config_assign(CONFIG *dest, const CONFIG *src) memcpy(dest, src, sizeof(CONFIG)); if (src->uris != NULL) { - dest->uris = (char **)calloc(src->table_count, sizeof(char *)); + dest->uris = calloc(src->table_count, sizeof(char *)); if (dest->uris == NULL) return (enomem(dest)); for (i = 0; i < src->table_count; i++) @@ -417,7 +417,7 @@ config_opt_file(CONFIG *cfg, const char *filename) goto err; } buf_size = (size_t)sb.st_size; - file_buf = (char *)calloc(buf_size + 2, 1); + file_buf = calloc(buf_size + 2, 1); if (file_buf == NULL) { ret = ENOMEM; goto err; diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c index c112259e176..3353a3d4721 100644 --- a/bench/wtperf/wtperf.c +++ b/bench/wtperf/wtperf.c @@ -424,8 +424,7 @@ worker(void *arg) lprintf(cfg, ret, 0, "worker: WT_CONNECTION.open_session"); goto err; } - cursors = (WT_CURSOR **)calloc( - cfg->table_count, sizeof(WT_CURSOR *)); + cursors = calloc(cfg->table_count, sizeof(WT_CURSOR *)); if (cursors == NULL) { lprintf(cfg, ENOMEM, 0, "worker: couldn't allocate cursor array"); @@ -767,8 +766,7 @@ populate_thread(void *arg) /* Do bulk loads if populate is single-threaded. */ cursor_config = cfg->populate_threads == 1 ? "bulk" : NULL; /* Create the cursors. */ - cursors = (WT_CURSOR **)calloc( - cfg->table_count, sizeof(WT_CURSOR *)); + cursors = calloc(cfg->table_count, sizeof(WT_CURSOR *)); if (cursors == NULL) { lprintf(cfg, ENOMEM, 0, "worker: couldn't allocate cursor array"); @@ -1578,13 +1576,13 @@ create_uris(CONFIG *cfg) ret = 0; base_uri_len = strlen(cfg->base_uri); - cfg->uris = (char **)calloc(cfg->table_count, sizeof(char *)); + cfg->uris = calloc(cfg->table_count, sizeof(char *)); if (cfg->uris == NULL) { ret = ENOMEM; goto err; } for (i = 0; i < cfg->table_count; i++) { - uri = cfg->uris[i] = (char *)calloc(base_uri_len + 3, 1); + uri = cfg->uris[i] = calloc(base_uri_len + 3, 1); if (uri == NULL) { ret = ENOMEM; goto err; |