Skip to content

Commit

Permalink
Clean up WT_UNUSED() macro uses, where we do use the variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbostic committed Nov 11, 2016
1 parent 8042eba commit 6028ca3
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 31 deletions.
1 change: 0 additions & 1 deletion src/block/block_ckpt.c
Expand Up @@ -53,7 +53,6 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block,
WT_DECL_RET;
uint8_t *endp;

WT_UNUSED(addr_size);
ci = NULL;

/*
Expand Down
2 changes: 0 additions & 2 deletions src/block/block_read.c
Expand Up @@ -24,8 +24,6 @@ __wt_bm_preload(
uint32_t checksum, size;
bool mapped;

WT_UNUSED(addr_size);

block = bm->block;

WT_STAT_CONN_INCR(session, block_preload);
Expand Down
1 change: 0 additions & 1 deletion src/block/block_slvg.c
Expand Up @@ -168,7 +168,6 @@ __wt_block_salvage_valid(WT_SESSION_IMPL *session,
wt_off_t offset;
uint32_t size, checksum;

WT_UNUSED(session);
WT_UNUSED(addr_size);

/*
Expand Down
2 changes: 0 additions & 2 deletions src/conn/conn_api.c
Expand Up @@ -239,8 +239,6 @@ __conn_add_compressor(WT_CONNECTION *wt_conn,
WT_NAMED_COMPRESSOR *ncomp;
WT_SESSION_IMPL *session;

WT_UNUSED(name);
WT_UNUSED(compressor);
ncomp = NULL;

conn = (WT_CONNECTION_IMPL *)wt_conn;
Expand Down
2 changes: 0 additions & 2 deletions src/cursor/cur_config.c
Expand Up @@ -49,8 +49,6 @@ __wt_curconfig_open(WT_SESSION_IMPL *session,

WT_STATIC_ASSERT(offsetof(WT_CURSOR_CONFIG, iface) == 0);

WT_UNUSED(uri);

WT_RET(__wt_calloc_one(session, &cconfig));

cursor = &cconfig->iface;
Expand Down
2 changes: 0 additions & 2 deletions src/log/log.c
Expand Up @@ -425,8 +425,6 @@ __wt_log_extract_lognum(
{
const char *p;

WT_UNUSED(session);

if (id == NULL || name == NULL)
return (WT_ERROR);
if ((p = strrchr(name, '.')) == NULL ||
Expand Down
2 changes: 0 additions & 2 deletions src/os_common/os_fs_inmemory.c
Expand Up @@ -515,8 +515,6 @@ __im_terminate(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session)
WT_FILE_SYSTEM_INMEM *im_fs;
WT_SESSION_IMPL *session;

WT_UNUSED(file_system);

session = (WT_SESSION_IMPL *)wt_session;
im_fs = (WT_FILE_SYSTEM_INMEM *)file_system;

Expand Down
2 changes: 0 additions & 2 deletions src/os_posix/os_dir.c
Expand Up @@ -28,8 +28,6 @@ __wt_posix_directory_list(WT_FILE_SYSTEM *file_system,
int tret;
char **entries;

WT_UNUSED(file_system);

session = (WT_SESSION_IMPL *)wt_session;

*dirlistp = NULL;
Expand Down
15 changes: 6 additions & 9 deletions src/os_posix/os_fallocate.c
Expand Up @@ -21,19 +21,18 @@ static int
__posix_std_fallocate(
WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset)
{
WT_UNUSED(wt_session);

#if defined(HAVE_FALLOCATE)
WT_DECL_RET;
WT_FILE_HANDLE_POSIX *pfh;

WT_UNUSED(wt_session);

pfh = (WT_FILE_HANDLE_POSIX *)file_handle;

WT_SYSCALL_RETRY(fallocate(pfh->fd, 0, (wt_off_t)0, offset), ret);
return (ret);
#else
WT_UNUSED(file_handle);
WT_UNUSED(wt_session);
WT_UNUSED(offset);
return (ENOTSUP);
#endif
Expand All @@ -47,12 +46,12 @@ static int
__posix_sys_fallocate(
WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset)
{
WT_UNUSED(wt_session);

#if defined(__linux__) && defined(SYS_fallocate)
WT_DECL_RET;
WT_FILE_HANDLE_POSIX *pfh;

WT_UNUSED(wt_session);

pfh = (WT_FILE_HANDLE_POSIX *)file_handle;

/*
Expand All @@ -66,7 +65,6 @@ __posix_sys_fallocate(
return (ret);
#else
WT_UNUSED(file_handle);
WT_UNUSED(wt_session);
WT_UNUSED(offset);
return (ENOTSUP);
#endif
Expand All @@ -80,19 +78,18 @@ static int
__posix_posix_fallocate(
WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset)
{
WT_UNUSED(wt_session);

#if defined(HAVE_POSIX_FALLOCATE)
WT_DECL_RET;
WT_FILE_HANDLE_POSIX *pfh;

WT_UNUSED(wt_session);

pfh = (WT_FILE_HANDLE_POSIX *)file_handle;

WT_SYSCALL_RETRY(posix_fallocate(pfh->fd, (wt_off_t)0, offset), ret);
return (ret);
#else
WT_UNUSED(file_handle);
WT_UNUSED(wt_session);
WT_UNUSED(offset);
return (ENOTSUP);
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/os_posix/os_fs.c
Expand Up @@ -746,8 +746,6 @@ __posix_terminate(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session)
{
WT_SESSION_IMPL *session;

WT_UNUSED(file_system);

session = (WT_SESSION_IMPL *)wt_session;

__wt_free(session, file_system);
Expand Down
2 changes: 0 additions & 2 deletions src/os_win/os_dir.c
Expand Up @@ -30,8 +30,6 @@ __wt_win_directory_list(WT_FILE_SYSTEM *file_system,
uint32_t count;
char *dir_copy, **entries;

WT_UNUSED(file_system);

session = (WT_SESSION_IMPL *)wt_session;

*dirlistp = NULL;
Expand Down
2 changes: 0 additions & 2 deletions src/txn/txn_ckpt.c
Expand Up @@ -242,8 +242,6 @@ __wt_checkpoint_get_handles(WT_SESSION_IMPL *session, const char *cfg[])
WT_DECL_RET;
const char *name;

WT_UNUSED(cfg);

/* Should not be called with anything other than a file object. */
WT_ASSERT(session, session->dhandle->checkpoint == NULL);
WT_ASSERT(session, WT_PREFIX_MATCH(session->dhandle->name, "file:"));
Expand Down
2 changes: 0 additions & 2 deletions src/txn/txn_recover.c
Expand Up @@ -248,8 +248,6 @@ static int
__txn_commit_apply(
WT_RECOVERY *r, WT_LSN *lsnp, const uint8_t **pp, const uint8_t *end)
{
WT_UNUSED(lsnp);

/* The logging subsystem zero-pads records. */
while (*pp < end && **pp)
WT_RET(__txn_op_apply(r, lsnp, pp, end));
Expand Down

0 comments on commit 6028ca3

Please sign in to comment.