Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def MatchingFor(*versions):
[
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/ctb.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/ctb-data.cpp"),
Object(NonMatching, "JSystem/JStudio/JStudio/functionvalue.cpp"),
Object(Equivalent, "JSystem/JStudio/JStudio/functionvalue.cpp", extra_cflags=['-pragma "nosyminline off"']), # weak func order
Object(NonMatching, "JSystem/JStudio/JStudio/fvb.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/fvb-data.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/fvb-data-parse.cpp"),
Expand Down
23 changes: 15 additions & 8 deletions include/JSystem/JGadget/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ struct TExpandStride_<s32> {
//! Target: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d_RCPFdd_d
template <typename T>
inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& fallback) {
ASSERT(pValue != NULL);
return (idx >= count) ? fallback : pValue[idx];
JUT_ASSERT(200, pValue!=0);
u32 index = idx;
if (index >= count) {
return fallback;
} else {
return pValue[index];
}
}

template <typename Category, typename T, typename Distance, typename Pointer, typename Reference>
struct TIterator : public std::iterator<Category, T, Distance, Pointer, Reference> {
};

template <typename Iterator, typename T, typename Predicate>
inline Iterator findUpperBound_binary_all(Iterator first, Iterator last, const T& val, Predicate p) {
return upper_bound(first, last, val, p);
return std::upper_bound(first, last, val, p);
}

template <typename Iterator, typename T, typename Predicate>
Expand Down Expand Up @@ -104,15 +113,13 @@ inline Iterator findUpperBound_binary_end(Iterator first, Iterator last, const T
template <typename Iterator, typename T, typename Predicate>
Iterator findUpperBound_binary_current(Iterator first, Iterator last, Iterator current, const T& val, Predicate p) {
return current == last || p(val, *current) ?
findUpperBound_binary_end(first, current, val, p)
: findUpperBound_binary_begin(current, last, val, p);
findUpperBound_binary_end(first, current, val, p) :
findUpperBound_binary_begin(current, last, val, p);
}

// NONMATCHING stack alloc
template <typename Iterator, typename T>
Iterator findUpperBound_binary_current(Iterator first, Iterator last, Iterator current, const T& val) {
std::less<T> less;
return findUpperBound_binary_current(first, last, current, val, less);
return findUpperBound_binary_current(first, last, current, val, std::less<T>());
}

} // namespace JGadget
Expand Down
15 changes: 2 additions & 13 deletions include/JSystem/JGadget/vector.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#ifndef VECTOR_H
#define VECTOR_H

#include <dolphin/types.h>

extern u8 data_804511E0;
#include "JSystem/JGadget/std-memory.h"
#include "types.h"

namespace JGadget {

Expand All @@ -15,16 +14,6 @@ typedef u32 (*ExtendFunc)(u32, u32, u32);

} // namespace vector

template <typename T>
struct TAllocator {
static TAllocator get() {}
inline TAllocator(u8 param_0) { _0 = param_0; }
/* 0x0 */ u8 _0;
/* 0x4 */ u32 _4;
/* 0x8 */ u32 _8;
/* 0xc */ u32 _c;
};

template <typename T, template <class> class Allocator>
struct TVector {
TVector(Allocator<T> alloc) {
Expand Down
Loading