Mercurial > repos > blastem
comparison backend.c @ 1952:42c12d141f6e
Remove usage of GCC pointer arithmetic on void * extension
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 30 Apr 2020 23:30:22 -0700 |
parents | 0c1491818f4b |
children | 9d35ce5012a6 |
comparison
equal
deleted
inserted
replaced
1951:8494fe8d6b65 | 1952:42c12d141f6e |
---|---|
81 uint8_t * base = memmap[chunk].flags & MMAP_PTR_IDX | 81 uint8_t * base = memmap[chunk].flags & MMAP_PTR_IDX |
82 ? mem_pointers[memmap[chunk].ptr_index] | 82 ? mem_pointers[memmap[chunk].ptr_index] |
83 : memmap[chunk].buffer; | 83 : memmap[chunk].buffer; |
84 if (!base) { | 84 if (!base) { |
85 if (memmap[chunk].flags & MMAP_AUX_BUFF) { | 85 if (memmap[chunk].flags & MMAP_AUX_BUFF) { |
86 return memmap[chunk].buffer + (address & memmap[chunk].aux_mask); | 86 return ((uint8_t *)memmap[chunk].buffer) + (address & memmap[chunk].aux_mask); |
87 } | 87 } |
88 return NULL; | 88 return NULL; |
89 } | 89 } |
90 return base + (address & memmap[chunk].mask); | 90 return base + (address & memmap[chunk].mask); |
91 } | 91 } |
106 uint8_t * base = memmap[chunk].flags & MMAP_PTR_IDX | 106 uint8_t * base = memmap[chunk].flags & MMAP_PTR_IDX |
107 ? mem_pointers[memmap[chunk].ptr_index] | 107 ? mem_pointers[memmap[chunk].ptr_index] |
108 : memmap[chunk].buffer; | 108 : memmap[chunk].buffer; |
109 if (!base) { | 109 if (!base) { |
110 if (memmap[chunk].flags & MMAP_AUX_BUFF) { | 110 if (memmap[chunk].flags & MMAP_AUX_BUFF) { |
111 return memmap[chunk].buffer + (address & memmap[chunk].aux_mask); | 111 return ((uint8_t *)memmap[chunk].buffer) + (address & memmap[chunk].aux_mask); |
112 } | 112 } |
113 return NULL; | 113 return NULL; |
114 } | 114 } |
115 return base + (address & memmap[chunk].mask); | 115 return base + (address & memmap[chunk].mask); |
116 } | 116 } |