Fixing uninitialized members.

Wish VC++ warned about this line clang does...
This commit is contained in:
Ben Vanik 2013-10-13 11:14:46 -07:00
parent c6d779920d
commit f49e35636d
1 changed files with 12 additions and 5 deletions

View File

@ -23,6 +23,13 @@ RingBufferWorker::RingBufferWorker(xe_memory_ref memory) :
memory_(memory), driver_(0) {
write_ptr_index_event_ = CreateEvent(
NULL, TRUE, FALSE, NULL);
primary_buffer_ptr_ = 0;
primary_buffer_size_ = 0;
read_ptr_index_ = 0;
read_ptr_update_freq_ = 0;
read_ptr_writeback_ptr_ = 0;
write_ptr_index_ = 0;
}
RingBufferWorker::~RingBufferWorker() {
@ -78,7 +85,7 @@ void RingBufferWorker::Pump() {
// TODO(benvanik): handle wrapping around
// read_ptr_index_ = (read_ptr_index_ + 1) % (primary_buffer_size_ / 4);
XEASSERT(write_ptr_index_ >= read_ptr_index_);
XEASSERT(write_ptr_index_ > read_ptr_index_);
uint32_t length = write_ptr_index_ - read_ptr_index_;
if (length) {
ExecuteSegment(primary_buffer_ptr_ + read_ptr_index_ * 4, length);