Skip to content

Commit

Permalink
Cast simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
jackburton79 committed Oct 30, 2024
1 parent ec6147e commit a900ba5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BSCApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,14 +1044,14 @@ BSCApp::ReadBitmap(BBitmap* bitmap, bool includeCursor, BRect bounds)
((uint32)bounds.top * rowBytes)) * bytesPerPixel;

const int32 height = bounds.IntegerHeight() + 1;
void* from = (void*)((uint8*)fDirectInfo.bits + offset);
void* to = bitmap->Bits();
uint8* from = reinterpret_cast<uint8*>(fDirectInfo.bits) + offset;
uint8* to = reinterpret_cast<uint8*>(bitmap->Bits());
const int32 bytesPerRow = bitmap->BytesPerRow();
const int32 areaSize = (bounds.IntegerWidth() + 1) * bytesPerPixel;
for (int32 y = 0; y < height; y++) {
::memcpy(to, from, areaSize);
to = (void*)((uint8*)to + bytesPerRow);
from = (void*)((uint8*)from + fDirectInfo.bytes_per_row);
to += bytesPerRow;
from += fDirectInfo.bytes_per_row;
}

return B_OK;
Expand Down

0 comments on commit a900ba5

Please sign in to comment.