qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] exec: don't use void* in pointer arithmetic in headers
@ 2024-06-20 20:16 Roman Kiryanov
  2024-06-21  6:41 ` Philippe Mathieu-Daudé
  2024-06-21 16:32 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Roman Kiryanov @ 2024-06-20 20:16 UTC (permalink / raw)
  To: richard.henderson, peter.maydell, pbonzini, qemu-devel
  Cc: jansene, mett, jpcottin, alex.bennee, berrange, Roman Kiryanov

void* pointer arithmetic is a GCC extentension
which could not be available in other build
tools (e.g. C++). This changes removes this
assumption.

Google-Bug-Id: 331190993
Change-Id: I5a064853429f627c17a9213910811dea4ced6174
Signed-off-by: Roman Kiryanov <rkir@google.com>
---
v2: renamed from "use char* for pointer arithmetic"
    and removed all explicit extra cast with
    one typedef in memory.h.

 include/exec/memory.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index b1713f30b8..b616338f05 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -2795,8 +2795,10 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr,
 #define ARG1_DECL    AddressSpace *as
 #include "exec/memory_ldst_phys.h.inc"
 
+typedef uint8_t *MemoryRegionCachePtr;
+
 struct MemoryRegionCache {
-    void *ptr;
+    MemoryRegionCachePtr ptr;
     hwaddr xlat;
     hwaddr len;
     FlatView *fv;
-- 
2.45.2.741.gdbec12cfda-goog



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-26 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20 20:16 [PATCH v2] exec: don't use void* in pointer arithmetic in headers Roman Kiryanov
2024-06-21  6:41 ` Philippe Mathieu-Daudé
2024-06-26 21:41   ` Roman Kiryanov
2024-06-21 16:32 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).