ati: Fix invalid type casts

Signed-off-by: Jaroslaw Pelczar <[email protected]>
Change-Id: Ifc968ae6f8c485c1ea050430814ae6cfeecdbd44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1772
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Jaroslaw Pelczar
2019-08-30 14:10:18 +00:00
committed by waddlesplash
parent 6a9b2bf7f4
commit ca759905f8
+5 -5
View File
@@ -91,18 +91,18 @@ AllocateOverlayBuffer(color_space colorSpace, uint16 width, uint16 height)
// thus, if the overlay buffer overflows it will be less apt to affect the // thus, if the overlay buffer overflows it will be less apt to affect the
// cursor. // cursor.
uint32 prevBuffAddr = (si.videoMemAddr + si.cursorOffset - 0xfff) & ~0xfff; addr_t prevBuffAddr = (si.videoMemAddr + si.cursorOffset - 0xfff) & ~0xfff;
while (ovBuff != NULL) { while (ovBuff != NULL) {
// Test if there is sufficient space between the end of the current // Test if there is sufficient space between the end of the current
// buffer and the start of the previous buffer to allocate the new // buffer and the start of the previous buffer to allocate the new
// buffer. // buffer.
uint32 currentBuffEndAddr = (addr_t)ovBuff->buffer + ovBuff->size; addr_t currentBuffEndAddr = (addr_t)ovBuff->buffer + ovBuff->size;
if ((prevBuffAddr - currentBuffEndAddr) >= buffSize) if ((prevBuffAddr - currentBuffEndAddr) >= buffSize)
break; // sufficient space for the new buffer break; // sufficient space for the new buffer
prevBuffAddr = (uint32)ovBuff->buffer; prevBuffAddr = (addr_t)ovBuff->buffer;
prevOvBuff = ovBuff; prevOvBuff = ovBuff;
ovBuff = ovBuff->nextBuffer; ovBuff = ovBuff->nextBuffer;
} }
@@ -116,7 +116,7 @@ AllocateOverlayBuffer(color_space colorSpace, uint16 width, uint16 height)
// ends so that it can be determined if there is sufficient space for // ends so that it can be determined if there is sufficient space for
// the new buffer to be created. // the new buffer to be created.
uint32 fbEndAddr = si.videoMemAddr + si.frameBufferOffset addr_t fbEndAddr = si.videoMemAddr + si.frameBufferOffset
+ (si.displayMode.virtual_width + (si.displayMode.virtual_width
* ((si.displayMode.bitsPerPixel + 7) / 8) // bytes per pixel * ((si.displayMode.bitsPerPixel + 7) / 8) // bytes per pixel
* si.displayMode.virtual_height); * si.displayMode.virtual_height);
@@ -255,7 +255,7 @@ AllocateOverlay(void)
return NULL; return NULL;
} }
return (overlay_token)++si.overlayToken; return (overlay_token)(addr_t)++si.overlayToken;
} }