all repos — mgba @ 947ef7edea90b134c9dd06d70fa05adab3a4fb0f

mGBA Game Boy Advance Emulator

Util: Add Vector GetConstPointer
Jeffrey Pfau jeffrey@endrift.com
Fri, 19 Aug 2016 05:05:30 -0700
commit

947ef7edea90b134c9dd06d70fa05adab3a4fb0f

parent

2e55bd098ac97fcb203634f5c65651695de6eb38

2 files changed, 5 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -61,6 +61,7 @@ - GBA Savedata: Add realistic timing for EEPROM

- GBA Video: Optimize mode 0 rendering - Qt: Remove default autofire mappings - PSP2: Allow UTF-8 filenames + - Util: Add Vector GetConstPointer 0.4.1: (2016-07-11) Bugfixes:
M src/util/vector.hsrc/util/vector.h

@@ -17,6 +17,7 @@ }; \

void NAME ## Init(struct NAME* vector, size_t capacity); \ void NAME ## Deinit(struct NAME* vector); \ TYPE* NAME ## GetPointer(struct NAME* vector, size_t location); \ + TYPE const* NAME ## GetConstPointer(const struct NAME* vector, size_t location); \ TYPE* NAME ## Append(struct NAME* vector); \ void NAME ## Clear(struct NAME* vector); \ void NAME ## Resize(struct NAME* vector, ssize_t change); \

@@ -41,6 +42,9 @@ vector->vector = 0; \

vector->capacity = 0; \ } \ TYPE* NAME ## GetPointer(struct NAME* vector, size_t location) { \ + return &vector->vector[location]; \ + } \ + TYPE const* NAME ## GetConstPointer(const struct NAME* vector, size_t location) { \ return &vector->vector[location]; \ } \ TYPE* NAME ## Append(struct NAME* vector) { \