Skip to content

Commit

Permalink
Merge pull request #41 from adishavit/master
Browse files Browse the repository at this point in the history
Removes variable name hiding by renaming variables with the same name in a nested scope.
  • Loading branch information
bingmann committed Aug 4, 2016
2 parents f3b5d5c + daecc22 commit 78dd7ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions lib/algo/async_schedule.cpp
Expand Up @@ -112,8 +112,8 @@ int_type simulate_async_write(
if (oldtime != cur.timestamp)
{
// clear disk_busy
for (int_type i = 0; i <= D; i++)
disk_busy[i] = false;
for (int_type j = 0; j <= D; j++)
disk_busy[j] = false;

oldtime = cur.timestamp;
}
Expand Down Expand Up @@ -157,8 +157,8 @@ int_type simulate_async_write(
}

assert(i == -1);
for (int_type i = 0; i <= D; i++)
assert(disk_queues[i].empty());
for (int_type j = 0; j <= D; j++)
assert(disk_queues[j].empty());

return (oldtime - 1);
}
Expand Down
12 changes: 6 additions & 6 deletions lib/io/iostats.cpp
Expand Up @@ -288,16 +288,16 @@ void stats::wait_finished(wait_op_type wait_op)
p_waits += (acc_waits--) ? diff : 0.0;

if (wait_op == WAIT_OP_READ) {
double diff = now - p_begin_wait_read;
t_wait_read += double(acc_wait_read) * diff;
double diff2 = now - p_begin_wait_read;
t_wait_read += double(acc_wait_read) * diff2;
p_begin_wait_read = now;
p_wait_read += (acc_wait_read--) ? diff : 0.0;
p_wait_read += (acc_wait_read--) ? diff2 : 0.0;
}
else /* if (wait_op == WAIT_OP_WRITE) */ {
double diff = now - p_begin_wait_write;
t_wait_write += double(acc_wait_write) * diff;
double diff2 = now - p_begin_wait_write;
t_wait_write += double(acc_wait_write) * diff2;
p_begin_wait_write = now;
p_wait_write += (acc_wait_write--) ? diff : 0.0;
p_wait_write += (acc_wait_write--) ? diff2 : 0.0;
}
#ifdef STXXL_WAIT_LOG_ENABLED
std::ofstream* waitlog = stxxl::logger::get_instance()->waitlog_stream();
Expand Down
6 changes: 3 additions & 3 deletions lib/io/wfs_file_base.cpp
Expand Up @@ -100,11 +100,11 @@ static HANDLE open_file_impl(const std::string& filename, int mode)

dwFlagsAndAttributes &= ~FILE_FLAG_NO_BUFFERING;

HANDLE file_des = ::CreateFileA(filename.c_str(), dwDesiredAccess, dwShareMode, NULL,
HANDLE file_des2 = ::CreateFileA(filename.c_str(), dwDesiredAccess, dwShareMode, NULL,
dwCreationDisposition, dwFlagsAndAttributes, NULL);

if (file_des != INVALID_HANDLE_VALUE)
return file_des;
if (file_des2 != INVALID_HANDLE_VALUE)
return file_des2;
}
#endif

Expand Down

0 comments on commit 78dd7ec

Please sign in to comment.