use DIRECT_BUFFER_INFO_AREA_SIZE instead of B_PAGE_SIZE, even if they

are the same, but it's more correct. Also memset the buffer_info struct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32572 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2009-08-21 15:40:53 +00:00
parent 7d9dfe90a5
commit d3ae6ef65b

View File

@ -182,8 +182,10 @@ DirectWindowData::DirectWindowData()
fTransition(0)
{
fBufferArea = create_area("direct area", (void**)&buffer_info,
B_ANY_ADDRESS, B_PAGE_SIZE, B_NO_LOCK, B_READ_WRITE);
B_ANY_ADDRESS, DIRECT_BUFFER_INFO_AREA_SIZE,
B_NO_LOCK, B_READ_WRITE);
memset(buffer_info, 0, DIRECT_BUFFER_INFO_AREA_SIZE);
buffer_info->buffer_state = B_DIRECT_STOP;
fSem = create_sem(0, "direct sem");
fAcknowledgeSem = create_sem(0, "direct sem ack");
@ -282,8 +284,8 @@ DirectWindowData::_HandleStop(const direct_buffer_state& state)
bool
DirectWindowData::_HandleStart(const direct_buffer_state& state)
{
buffer_info->buffer_state
= (direct_buffer_state)(BufferState(buffer_info->buffer_state).Reason() | state);
buffer_info->buffer_state = (direct_buffer_state)
(BufferState(buffer_info->buffer_state).Reason() | state);
if (fTransition++ >= 0)
return true;