Skip to content

prim: remove auto from seadDelegate#271

Open
german77 wants to merge 3 commits into
open-ead:masterfrom
german77:delegate
Open

prim: remove auto from seadDelegate#271
german77 wants to merge 3 commits into
open-ead:masterfrom
german77:delegate

Conversation

@german77
Copy link
Copy Markdown
Contributor

@german77 german77 commented May 28, 2026

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 Reviewable

Copy link
Copy Markdown
Contributor

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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); }

Copy link
Copy Markdown
Contributor Author

@german77 german77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@german77
Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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;

Copy link
Copy Markdown
Contributor Author

@german77 german77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants