From 6a9b2bf7f413ee145d87319686692ae7b7440287 Mon Sep 17 00:00:00 2001 From: Jaroslaw Pelczar Date: Wed, 28 Aug 2019 17:07:15 +0200 Subject: [PATCH] 3dfx: fix invalid type casts Signed-off-by: Jaroslaw Pelczar Change-Id: I3afb2ff4441524be62287c460ef82e82cedfcc2a Reviewed-on: https://review.haiku-os.org/c/haiku/+/1771 Reviewed-by: waddlesplash --- src/add-ons/accelerants/3dfx/overlay.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/add-ons/accelerants/3dfx/overlay.cpp b/src/add-ons/accelerants/3dfx/overlay.cpp index ca5d711cd4..206c50d150 100644 --- a/src/add-ons/accelerants/3dfx/overlay.cpp +++ b/src/add-ons/accelerants/3dfx/overlay.cpp @@ -95,7 +95,7 @@ AllocateOverlayBuffer(color_space colorSpace, uint16 width, uint16 height) // If no buffers have been allocated, prevBuffAddr calculated here will be // the address where the buffer area will start. - uint32 prevBuffAddr = si.videoMemAddr + si.frameBufferOffset + addr_t prevBuffAddr = si.videoMemAddr + si.frameBufferOffset + si.maxFrameBufferSize; while (ovBuff != NULL) { @@ -103,11 +103,11 @@ AllocateOverlayBuffer(color_space colorSpace, uint16 width, uint16 height) // buffer and the start of the previous buffer to allocate the new // buffer. - uint32 currentBuffEndAddr = (addr_t)ovBuff->buffer + ovBuff->size; + addr_t currentBuffEndAddr = (addr_t)ovBuff->buffer + ovBuff->size; if ((prevBuffAddr - currentBuffEndAddr) >= buffSize) break; // sufficient space for the new buffer - prevBuffAddr = (uint32)ovBuff->buffer; + prevBuffAddr = (addr_t)ovBuff->buffer; prevOvBuff = ovBuff; ovBuff = ovBuff->nextBuffer; } @@ -121,7 +121,7 @@ AllocateOverlayBuffer(color_space colorSpace, uint16 width, uint16 height) // ends so that it can be determined if there is sufficient space for // 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.bytesPerPixel * si.displayMode.virtual_height);