prim: remove auto from seadDelegate#271
Conversation
MonsterDruide1
left a comment
There was a problem hiding this comment.
@MonsterDruide1 reviewed 1 file and all commit messages, and made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on german77).
include/prim/seadDelegate.h line 362 at r1 (raw file):
explicit LambdaDelegate(Lambda l) : mLambda(std::move(l)) {} auto invoke() override { return mLambda(); } auto operator()() const { return mLambda(); }
Add actual type to these ones as well (void?)
Code quote:
auto invoke() override { return mLambda(); }
auto operator()() const { return mLambda(); }include/prim/seadDelegate.h line 388 at r1 (raw file):
explicit LambdaDelegate1(Lambda l) : mLambda(std::move(l)) {} auto invoke(A1 a1) override { return mLambda(a1); } auto operator()(A1 a1) const { return mLambda(a1); }
same here
Code quote:
auto invoke(A1 a1) override { return mLambda(a1); }
auto operator()(A1 a1) const { return mLambda(a1); }include/prim/seadDelegate.h line 417 at r1 (raw file):
explicit LambdaDelegate2(Lambda l) : mLambda(std::move(l)) {} auto invoke(A1 a1, A2 a2) override { return mLambda(a1, a2); } auto operator()(A1 a1, A2 a2) const { return mLambda(a1, a2); }
same here
Code quote:
auto invoke(A1 a1, A2 a2) override { return mLambda(a1, a2); }
auto operator()(A1 a1, A2 a2) const { return mLambda(a1, a2); }include/prim/seadDelegate.h line 431 at r1 (raw file):
R invoke(A1 a1, A2 a2) override { return mLambda(a1, a2); } R operator()(A1 a1, A2 a2) const { return mLambda(a1, a2); } LambdaDelegate2R clone(Heap* heap) const override { return new (heap) LambdaDelegate2R(*this); }
Suggestion:
LambdaDelegate2R* clone(Heap* heap) const override { return new (heap) LambdaDelegate2R(*this); }
german77
left a comment
There was a problem hiding this comment.
@german77 made 4 comments.
Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on MonsterDruide1).
include/prim/seadDelegate.h line 362 at r1 (raw file):
Previously, MonsterDruide1 wrote…
Add actual type to these ones as well (
void?)
Done. I wasn't really sure for these ones but is indeed void
include/prim/seadDelegate.h line 388 at r1 (raw file):
Previously, MonsterDruide1 wrote…
same here
Done.
include/prim/seadDelegate.h line 417 at r1 (raw file):
Previously, MonsterDruide1 wrote…
same here
Done.
include/prim/seadDelegate.h line 431 at r1 (raw file):
R invoke(A1 a1, A2 a2) override { return mLambda(a1, a2); } R operator()(A1 a1, A2 a2) const { return mLambda(a1, a2); } LambdaDelegate2R clone(Heap* heap) const override { return new (heap) LambdaDelegate2R(*this); }
Done.
|
To fully match the smo function I needed to add a default ctor to UnbindDummy and AnyDelegateR to avoid initializing the memory with zero. I didn't apply this to the other delegates due the dummy having a member with "1" as initial value. At this point I can't validate the other delegates. |
MonsterDruide1
left a comment
There was a problem hiding this comment.
@MonsterDruide1 reviewed 1 file and all commit messages, made 2 comments, and resolved 4 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on german77).
include/prim/seadDelegate.h line 583 at r3 (raw file):
{ public: UnbindDummy() {}
Suggestion:
UnbindDummy() = default;include/prim/seadDelegate.h line 592 at r3 (raw file):
}; AnyDelegateR() {}
Suggestion:
AnyDelegateR() = default;
german77
left a comment
There was a problem hiding this comment.
@german77 made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on MonsterDruide1).
include/prim/seadDelegate.h line 583 at r3 (raw file):
{ public: UnbindDummy() {}
default returns to previous behavior
include/prim/seadDelegate.h line 592 at r3 (raw file):
}; AnyDelegateR() {}
default returns to previous behavior
The compiler can't determine the correct type to use with auto. Return discrete types instead. Required by SMO SphinxRide::exeDemoStandbyStart https://decomp.me/scratch/FEAN1
This change is