klawr icon indicating copy to clipboard operation
klawr copied to clipboard

Reduce use of void* in generated native wrapper functions

Open enlight opened this issue 10 years ago • 2 comments

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.

enlight avatar Oct 06 '14 15:10 enlight

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<UObject>' c:\github\unrealengine\engine\plugins\klawr\klawrruntimeplugin\intermediate\build\win64\ue4editor\inc\klawrruntimeplugin\KismetSystemLibrary.klawr.h 734 1 UE4

static_cast<TAssetSubclassOf<UObject>>(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.

Algorithman avatar Aug 31 '15 19:08 Algorithman

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

enlight avatar Sep 01 '15 02:09 enlight