Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1cee16b

Browse files
pennammaidnl
andcommitted
SDCardBlockDevice: avoid double cast
Co-authored-by: Daniele <34984733+maidnl@users.noreply.github.com>
1 parent c265d86 commit 1cee16b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎libraries/BlockDevices/SDCardBlockDevice.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ int SDCardBlockDevice::read(void *buffer, bd_addr_t add, bd_size_t _size) {
368368
uint32_t start_add_of_block = (add / read_block_size);
369369
rv = FSP_SUCCESS;
370370
for(uint32_t i = 0; i < num_of_blocks && rv == FSP_SUCCESS; i++) {
371-
rv = R_SDHI_Read (&ctrl, (uint8_t *)((uint8_t *)buffer + (i * read_block_size)), start_add_of_block + i, 1);
371+
uint8_t *buf = (uint8_t *)buffer;
372+
rv = R_SDHI_Read (&ctrl, buf + (i * read_block_size), start_add_of_block + i, 1);
372373
if(rv == FSP_SUCCESS) {
373374
rv = wait_for_completition();
374375
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /