Fixed suspicious implicit sign extension computing the frame buffer size

(CIDs 8056, 8057, 8058).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40078 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2011-01-02 23:14:10 +00:00
parent 447e61909f
commit 3872a2d2fc

View File

@ -461,10 +461,10 @@ vesa_init(vbe_info_block *info, video_mode **_standardMode)
modeInfo.num_banks)); modeInfo.num_banks));
TRACE((" mask: r: %d %d g: %d %d b: %d %d dcmi: %d\n", TRACE((" mask: r: %d %d g: %d %d b: %d %d dcmi: %d\n",
modeInfo.red_mask_size, modeInfo.red_field_position, modeInfo.red_mask_size, modeInfo.red_field_position,
modeInfo.green_mask_size, modeInfo.green_field_position, modeInfo.green_mask_size, modeInfo.green_field_position,
modeInfo.blue_mask_size, modeInfo.blue_field_position, modeInfo.blue_mask_size, modeInfo.blue_field_position,
modeInfo.direct_color_mode_info)); modeInfo.direct_color_mode_info));
const uint32 requiredAttributes = MODE_ATTR_AVAILABLE const uint32 requiredAttributes = MODE_ATTR_AVAILABLE
| MODE_ATTR_GRAPHICS_MODE | MODE_ATTR_COLOR_MODE | MODE_ATTR_GRAPHICS_MODE | MODE_ATTR_COLOR_MODE
| MODE_ATTR_LINEAR_BUFFER; | MODE_ATTR_LINEAR_BUFFER;
@ -808,8 +808,9 @@ platform_switch_to_logo(void)
gKernelArgs.frame_buffer.height = modeInfo.height; gKernelArgs.frame_buffer.height = modeInfo.height;
gKernelArgs.frame_buffer.bytes_per_row = modeInfo.bytes_per_row; gKernelArgs.frame_buffer.bytes_per_row = modeInfo.bytes_per_row;
gKernelArgs.frame_buffer.depth = modeInfo.bits_per_pixel; gKernelArgs.frame_buffer.depth = modeInfo.bits_per_pixel;
gKernelArgs.frame_buffer.physical_buffer.size = modeInfo.bytes_per_row gKernelArgs.frame_buffer.physical_buffer.size
* gKernelArgs.frame_buffer.height; = (phys_size_t)modeInfo.bytes_per_row
* (phys_size_t)gKernelArgs.frame_buffer.height;
gKernelArgs.frame_buffer.physical_buffer.start = modeInfo.physical_base; gKernelArgs.frame_buffer.physical_buffer.start = modeInfo.physical_base;
} else { } else {
fallback: fallback:
@ -821,8 +822,8 @@ fallback:
gKernelArgs.frame_buffer.bytes_per_row = 80; gKernelArgs.frame_buffer.bytes_per_row = 80;
gKernelArgs.frame_buffer.depth = 4; gKernelArgs.frame_buffer.depth = 4;
gKernelArgs.frame_buffer.physical_buffer.size gKernelArgs.frame_buffer.physical_buffer.size
= gKernelArgs.frame_buffer.width = (phys_size_t)gKernelArgs.frame_buffer.width
* gKernelArgs.frame_buffer.height / 2; * (phys_size_t)gKernelArgs.frame_buffer.height / 2;
gKernelArgs.frame_buffer.physical_buffer.start = 0xa0000; gKernelArgs.frame_buffer.physical_buffer.start = 0xa0000;
} }