enlight / klawr

A set of Unreal Engine 4 plugins that enable the use of C# (and other CLI languages) in game projects targeting the Windows platform.
MIT License
83 stars 22 forks source link

Reduce use of void* in generated native wrapper functions #30

Open enlight opened 10 years ago

enlight commented 10 years ago

There's actually no real reason to use void* in native wrapper function return values and parameters. For example, the first argument to every native wrapper function is void* self, but there's no reason why this can't just be UObject* self, sizeof(void) == sizeof(UObject) anyway, which is all that matters. Likewise with any other pointer parameters or return values, getting rid of the void* means a few extra casts can be eliminated too.

Algorithman commented 9 years ago

And maybe they interfere with UE4.9.

Got an error in KismetSystemLibrary.klawr.h

Error 41 error C2440: 'static_cast' : cannot convert from 'void *' to 'TAssetSubclassOf' c:\github\unrealengine\engine\plugins\klawr\klawrruntimeplugin\intermediate\build\win64\ue4editor\inc\klawrruntimeplugin\KismetSystemLibrary.klawr.h 734 1 UE4

static_cast<TAssetSubclassOf>(Value),

(Error occured with the last commit on my develop/editorNode branch and 4.9 release source) Tried (but did not succeed) to find changes which affect the function in kismetsystemlibrary.cpp or the template in assetptr.h.

enlight commented 9 years ago

That sounds like a different issue altogether, could you create a new issue? I'll try updating to 4.9 tonight.