Skip to content

Commit

Permalink
Fix pointer truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Sep 9, 2015
1 parent 862a237 commit 943feea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spiffs/spiffs_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ s32_t spiffs_gc_find_candidate(
// align cand_scores on s32_t boundary
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
cand_scores = (s32_t*)(((u32_t)cand_scores + sizeof(s32_t) - 1) & ~(sizeof(s32_t) - 1));
cand_scores = (s32_t*)(((ptrdiff_t)cand_scores + sizeof(ptrdiff_t) - 1) & ~(sizeof(ptrdiff_t) - 1));
#pragma GCC diagnostic pop

*block_candidates = cand_blocks;
Expand Down

0 comments on commit 943feea

Please sign in to comment.