Am 18.02.20 um 19:49 schrieb Peter Maydell: > I think that we should fix the inconsistency where these functions > all take "uint8_t* buf": > > - address_space_rw() > - address_space_read() > - address_space_write() > - address_space_write_rom() > - cpu_physical_memory_rw() > - cpu_memory_rw_debug() > > but these take void*: > - cpu_physical_memory_read() > - cpu_physical_memory_write() > - address_space_write_cached() > - address_space_read_cached_slow() > - address_space_write_cached_slow() > - pci_dma_read() > - pci_dma_write() > - pci_dma_rw() > - dma_memory_read() > - dma_memory_write() > - dma_memory_rw() > - dma_memory_rw_relaxed() > > Depending on which way we go we would either want to remove these > casts, or not. > > I guess that we have more cases of 'void*', and that would > certainly be the easier way to convert (otherwise we probably > need to add a bunch of new casts to uint8_t* in various callsites), > but I don't have a strong opinion. Paolo ? > > thanks > -- PMM
Indeed, fixing such inconsitencies would be good. Personally I like the way how the standard C library handles such pointers for functions like memcpy, fread, fwrite and others. Therefore I suggest to use `const void *` and `void *` and to avoid type casts. Regards Stefan