libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
532 stars 304 forks source link

Get rid of casting a ptr to a 32 bit value #199

Closed dmaclach closed 1 year ago

dmaclach commented 2 years ago

This causes a warning if -Wbad-function-cast is enabled on a build.

Maybe I'm missing something because I can't see why the casts were there in the first place? This passes all the tests.

nikias commented 2 years ago

The casts are there because the original values are uint32_t which are casted like this when added to the array:

ptr_array_add(bplist->used_indexes, (void*)(uintptr_t)node_index);
nikias commented 1 year ago

Merged after rebase with e00615023c2108ba457a9089b900b14bbc9bb73b.