mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-10 02:27:40 +00:00
Migrate s32->int, u32->uint; fix dolphin/types.h
This commit is contained in:
@@ -10,8 +10,8 @@ namespace rstl {
|
||||
template < typename T, typename Alloc = rmemory_allocator >
|
||||
class vector {
|
||||
Alloc x0_allocator;
|
||||
s32 x4_count;
|
||||
s32 x8_capacity;
|
||||
int x4_count;
|
||||
int x8_capacity;
|
||||
T* xc_items;
|
||||
|
||||
public:
|
||||
@@ -23,14 +23,14 @@ public:
|
||||
inline iterator end() { return iterator(xc_items + x4_count); }
|
||||
inline const_iterator end() const { return const_iterator(xc_items + x4_count); }
|
||||
inline vector() : x4_count(0), x8_capacity(0), xc_items(NULL) {}
|
||||
inline vector(s32 count) : x4_count(0), x8_capacity(0), xc_items(0) { reserve(count); }
|
||||
inline vector(int count) : x4_count(0), x8_capacity(0), xc_items(0) { reserve(count); }
|
||||
vector(const vector& other) {
|
||||
x4_count = other.x4_count;
|
||||
x8_capacity = other.x8_capacity;
|
||||
if (other.x4_count == 0 && other.x8_capacity == 0) {
|
||||
xc_items = NULL;
|
||||
} else {
|
||||
s32 sz = x8_capacity * sizeof(T);
|
||||
int sz = x8_capacity * sizeof(T);
|
||||
if (sz == 0) {
|
||||
xc_items = NULL;
|
||||
} else {
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
x0_allocator.deallocate(xc_items);
|
||||
}
|
||||
|
||||
void reserve(s32 size);
|
||||
void reserve(int size);
|
||||
|
||||
void push_back(const T& in) {
|
||||
if (x4_count >= x8_capacity) {
|
||||
@@ -79,21 +79,21 @@ public:
|
||||
|
||||
inline T* data() { return xc_items; }
|
||||
inline const T* data() const { return xc_items; }
|
||||
inline s32 size() const { return x4_count; }
|
||||
inline s32 capacity() const { return x8_capacity; }
|
||||
inline int size() const { return x4_count; }
|
||||
inline int capacity() const { return x8_capacity; }
|
||||
inline T& front() { return xc_items[0]; }
|
||||
inline const T& front() const { return xc_items[0]; }
|
||||
inline T& back() { return xc_items[x4_count - 1]; }
|
||||
inline const T& back() const { return xc_items[x4_count - 1]; }
|
||||
inline T& operator[](s32 idx) { return xc_items[idx]; }
|
||||
inline const T& operator[](s32 idx) const { return xc_items[idx]; }
|
||||
inline T& operator[](int idx) { return xc_items[idx]; }
|
||||
inline const T& operator[](int idx) const { return xc_items[idx]; }
|
||||
};
|
||||
|
||||
template < typename T, typename Alloc >
|
||||
void vector< T, Alloc >::reserve(s32 size) {
|
||||
void vector< T, Alloc >::reserve(int size) {
|
||||
if (size <= x8_capacity)
|
||||
return;
|
||||
s32 sz = size * sizeof(T);
|
||||
int sz = size * sizeof(T);
|
||||
T* newData;
|
||||
if (sz == 0) {
|
||||
newData = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user