Skip to content

Conversation

@Headline
Copy link
Member

@Headline Headline commented May 9, 2018

Think this is one of the last Handle types without a method map, decided to piece together a small patch to change that.

Copy link
Member

@peace-maker peace-maker left a comment

Choose a reason for hiding this comment

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

This should apply to all similar new methodmaps.

* @param prof Profiling object.
* @error Invalid Handle.
*/
native void StartProfiling(Handle prof);
Copy link
Member

Choose a reason for hiding this comment

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

Thinking about changes like that - we don't have to change the tag here for old natives. This change will just make old code throw tag mismatch warnings if the profiler is just stored in a Handle variable.

Copy link
Member

Choose a reason for hiding this comment

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

Are you sure? I thought that was handled silently.

Copy link
Member

Choose a reason for hiding this comment

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

Just the other way around of expecting a Handle param but passing a methodmap X < Handle.

methodmap CoolNewThing < Handle {
};

native void DoStuff(CoolNewThing t);
native void DoMore(Handle t);

public void OnPluginStart()
{
	Handle thing;
	DoStuff(thing); // warning 213: tag mismatch
	
	CoolNewThing newThing;
	DoMore(newThing); // ok
}

@Headline
Copy link
Member Author

Headline commented May 9, 2018

My bad, thought those wouldn't throw mismatches. Hopefully all is well now.

Across sm we use `//` for methodmap docs, so lets just keep this consistent
@psychonic psychonic merged commit c09b320 into alliedmodders:master Jul 8, 2018
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.

4 participants