Remove unneeded parenthesis, add a comment

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32367 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2009-08-14 15:38:49 +00:00
parent b3f63c9f68
commit 984c8d3eaf
@@ -356,7 +356,13 @@ StarWindow::SwitchContext(direct_buffer_info *info)
row_bytes = info->bytes_per_row / (info->bits_per_pixel / 8);
// update the screen bases (only one of the 3 will be really used).
draw_ptr8 = (uint8*)info->bits + (info->bytes_per_row * info->window_bounds.top) + (info->window_bounds.left * (info->bits_per_pixel / 8));
draw_ptr8 = (uint8*)info->bits + info->bytes_per_row
* info->window_bounds.top + info->window_bounds.left
* (info->bits_per_pixel / 8);
// Note: parenthesis around "info->bits_per_pixel / 8"
// are needed to avoid an overflow when info->window_bounds.left
// becomes negative.
draw_ptr16 = (uint16*)draw_ptr8;
draw_ptr32 = (uint32*)draw_ptr8;