Skip to content

Commit

Permalink
Remove trivial function invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Sep 30, 2023
1 parent 0188777 commit a8260bb
Show file tree
Hide file tree
Showing 23 changed files with 325 additions and 337 deletions.
134 changes: 67 additions & 67 deletions modules/overrungl.glfw/src/main/java/overrungl/glfw/Handles.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,57 +133,57 @@ static void create() {
STR."\{GLFW.VERSION_MAJOR}.\{GLFW.VERSION_MINOR}.\{GLFW.VERSION_REVISION}");
glfwInit = downcall("glfwInit", I);
glfwTerminate = downcall("glfwTerminate", V);
glfwInitHint = downcallTrivial("glfwInitHint", IIV);
glfwInitHint = downcall("glfwInitHint", IIV);
glfwGetVersion = downcallTrivial("glfwGetVersion", PPPV);
glfwGetVersionString = downcallTrivial("glfwGetVersionString", p);
glfwGetError = downcallTrivial("glfwGetError", fd_PI);
glfwSetErrorCallback = downcall("glfwSetErrorCallback", PP);
glfwGetMonitors = downcallTrivial("glfwGetMonitors", Pp);
glfwGetPrimaryMonitor = downcallTrivial("glfwGetPrimaryMonitor", P);
glfwGetMonitorPos = downcallTrivial("glfwGetMonitorPos", PPPV);
glfwGetMonitorWorkarea = downcallTrivial("glfwGetMonitorWorkarea", PPPPPV);
glfwGetMonitorPhysicalSize = downcallTrivial("glfwGetMonitorPhysicalSize", PPPV);
glfwGetMonitorContentScale = downcallTrivial("glfwGetMonitorContentScale", PPPV);
glfwGetMonitorName = downcallTrivial("glfwGetMonitorName", Pp);
glfwGetMonitors = downcall("glfwGetMonitors", Pp);
glfwGetPrimaryMonitor = downcall("glfwGetPrimaryMonitor", P);
glfwGetMonitorPos = downcall("glfwGetMonitorPos", PPPV);
glfwGetMonitorWorkarea = downcall("glfwGetMonitorWorkarea", PPPPPV);
glfwGetMonitorPhysicalSize = downcall("glfwGetMonitorPhysicalSize", PPPV);
glfwGetMonitorContentScale = downcall("glfwGetMonitorContentScale", PPPV);
glfwGetMonitorName = downcall("glfwGetMonitorName", Pp);
glfwSetMonitorUserPointer = downcallTrivial("glfwSetMonitorUserPointer", PPV);
glfwGetMonitorUserPointer = downcallTrivial("glfwGetMonitorUserPointer", PP);
glfwSetMonitorCallback = downcall("glfwSetMonitorCallback", PP);
glfwGetVideoModes = downcallTrivial("glfwGetVideoModes", PPp);
glfwGetVideoMode = downcall("glfwGetVideoMode", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWVidMode.LAYOUT), ADDRESS), Linker.Option.isTrivial());
glfwSetGamma = downcallTrivial("glfwSetGamma", PFV);
glfwGetGammaRamp = downcall("glfwGetGammaRamp", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWGammaRamp.LAYOUT), ADDRESS), Linker.Option.isTrivial());
glfwSetGammaRamp = downcallTrivial("glfwSetGammaRamp", PPV);
glfwDefaultWindowHints = downcallTrivial("glfwDefaultWindowHints", V);
glfwWindowHint = downcallTrivial("glfwWindowHint", IIV);
glfwWindowHintString = downcallTrivial("glfwWindowHintString", IPV);
glfwGetVideoModes = downcall("glfwGetVideoModes", PPp);
glfwGetVideoMode = downcall("glfwGetVideoMode", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWVidMode.LAYOUT), ADDRESS));
glfwSetGamma = downcall("glfwSetGamma", PFV);
glfwGetGammaRamp = downcall("glfwGetGammaRamp", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWGammaRamp.LAYOUT), ADDRESS));
glfwSetGammaRamp = downcall("glfwSetGammaRamp", PPV);
glfwDefaultWindowHints = downcall("glfwDefaultWindowHints", V);
glfwWindowHint = downcall("glfwWindowHint", IIV);
glfwWindowHintString = downcall("glfwWindowHintString", IPV);
glfwCreateWindow = downcall("glfwCreateWindow", IIPPPP);
glfwDestroyWindow = downcall("glfwDestroyWindow", PV);
glfwWindowShouldClose = downcallTrivial("glfwWindowShouldClose", fd_PI);
glfwSetWindowShouldClose = downcallTrivial("glfwSetWindowShouldClose", PIV);
glfwSetWindowTitle = downcallTrivial("glfwSetWindowTitle", PPV);
glfwSetWindowIcon = downcallTrivial("glfwSetWindowIcon", PIPV);
glfwGetWindowPos = downcallTrivial("glfwGetWindowPos", PPPV);
glfwSetWindowPos = downcallTrivial("glfwSetWindowPos", PIIV);
glfwGetWindowSize = downcallTrivial("glfwGetWindowSize", PPPV);
glfwSetWindowSizeLimits = downcallTrivial("glfwSetWindowSizeLimits", PIIIIV);
glfwSetWindowAspectRatio = downcallTrivial("glfwSetWindowAspectRatio", PIIV);
glfwSetWindowSize = downcallTrivial("glfwSetWindowSize", PIIV);
glfwGetFramebufferSize = downcallTrivial("glfwGetFramebufferSize", PPPV);
glfwGetWindowFrameSize = downcallTrivial("glfwGetWindowFrameSize", PPPPPV);
glfwGetWindowContentScale = downcallTrivial("glfwGetWindowContentScale", PPPV);
glfwGetWindowOpacity = downcallTrivial("glfwGetWindowOpacity", PF);
glfwSetWindowOpacity = downcallTrivial("glfwSetWindowOpacity", PFV);
glfwIconifyWindow = downcallTrivial("glfwIconifyWindow", PV);
glfwRestoreWindow = downcallTrivial("glfwRestoreWindow", PV);
glfwMaximizeWindow = downcallTrivial("glfwMaximizeWindow", PV);
glfwShowWindow = downcallTrivial("glfwShowWindow", PV);
glfwHideWindow = downcallTrivial("glfwHideWindow", PV);
glfwFocusWindow = downcallTrivial("glfwFocusWindow", PV);
glfwRequestWindowAttention = downcallTrivial("glfwRequestWindowAttention", PV);
glfwGetWindowMonitor = downcallTrivial("glfwGetWindowMonitor", PP);
glfwSetWindowMonitor = downcallTrivial("glfwSetWindowMonitor", PPIIIIIV);
glfwGetWindowAttrib = downcallTrivial("glfwGetWindowAttrib", PII);
glfwSetWindowAttrib = downcallTrivial("glfwSetWindowAttrib", PIIV);
glfwSetWindowTitle = downcall("glfwSetWindowTitle", PPV);
glfwSetWindowIcon = downcall("glfwSetWindowIcon", PIPV);
glfwGetWindowPos = downcall("glfwGetWindowPos", PPPV);
glfwSetWindowPos = downcall("glfwSetWindowPos", PIIV);
glfwGetWindowSize = downcall("glfwGetWindowSize", PPPV);
glfwSetWindowSizeLimits = downcall("glfwSetWindowSizeLimits", PIIIIV);
glfwSetWindowAspectRatio = downcall("glfwSetWindowAspectRatio", PIIV);
glfwSetWindowSize = downcall("glfwSetWindowSize", PIIV);
glfwGetFramebufferSize = downcall("glfwGetFramebufferSize", PPPV);
glfwGetWindowFrameSize = downcall("glfwGetWindowFrameSize", PPPPPV);
glfwGetWindowContentScale = downcall("glfwGetWindowContentScale", PPPV);
glfwGetWindowOpacity = downcall("glfwGetWindowOpacity", PF);
glfwSetWindowOpacity = downcall("glfwSetWindowOpacity", PFV);
glfwIconifyWindow = downcall("glfwIconifyWindow", PV);
glfwRestoreWindow = downcall("glfwRestoreWindow", PV);
glfwMaximizeWindow = downcall("glfwMaximizeWindow", PV);
glfwShowWindow = downcall("glfwShowWindow", PV);
glfwHideWindow = downcall("glfwHideWindow", PV);
glfwFocusWindow = downcall("glfwFocusWindow", PV);
glfwRequestWindowAttention = downcall("glfwRequestWindowAttention", PV);
glfwGetWindowMonitor = downcall("glfwGetWindowMonitor", PP);
glfwSetWindowMonitor = downcall("glfwSetWindowMonitor", PPIIIIIV);
glfwGetWindowAttrib = downcall("glfwGetWindowAttrib", PII);
glfwSetWindowAttrib = downcall("glfwSetWindowAttrib", PIIV);
glfwSetWindowUserPointer = downcallTrivial("glfwSetWindowUserPointer", PPV);
glfwGetWindowUserPointer = downcallTrivial("glfwGetWindowUserPointer", PP);
glfwSetWindowPosCallback = downcall("glfwSetWindowPosCallback", PPP);
Expand All @@ -199,53 +199,53 @@ static void create() {
glfwWaitEvents = downcall("glfwWaitEvents", V);
glfwWaitEventsTimeout = downcall("glfwWaitEventsTimeout", DV);
glfwPostEmptyEvent = downcallTrivial("glfwPostEmptyEvent", V);
glfwGetInputMode = downcallTrivial("glfwGetInputMode", PII);
glfwSetInputMode = downcallTrivial("glfwSetInputMode", PIIV);
glfwRawMouseMotionSupported = downcallTrivial("glfwRawMouseMotionSupported", I);
glfwGetKeyName = downcallTrivial("glfwGetKeyName", IIp);
glfwGetInputMode = downcall("glfwGetInputMode", PII);
glfwSetInputMode = downcall("glfwSetInputMode", PIIV);
glfwRawMouseMotionSupported = downcall("glfwRawMouseMotionSupported", I);
glfwGetKeyName = downcall("glfwGetKeyName", IIp);
glfwGetKeyScancode = downcallTrivial("glfwGetKeyScancode", II);
glfwGetKey = downcallTrivial("glfwGetKey", PII);
glfwGetMouseButton = downcallTrivial("glfwGetMouseButton", PII);
glfwGetCursorPos = downcallTrivial("glfwGetCursorPos", PPPV);
glfwSetCursorPos = downcallTrivial("glfwSetCursorPos", PDDV);
glfwCreateCursor = downcallTrivial("glfwCreateCursor", PIIP);
glfwCreateStandardCursor = downcallTrivial("glfwCreateStandardCursor", IP);
glfwDestroyCursor = downcallTrivial("glfwDestroyCursor", PV);
glfwSetCursor = downcallTrivial("glfwSetCursor", PPV);
glfwGetKey = downcall("glfwGetKey", PII);
glfwGetMouseButton = downcall("glfwGetMouseButton", PII);
glfwGetCursorPos = downcall("glfwGetCursorPos", PPPV);
glfwSetCursorPos = downcall("glfwSetCursorPos", PDDV);
glfwCreateCursor = downcall("glfwCreateCursor", PIIP);
glfwCreateStandardCursor = downcall("glfwCreateStandardCursor", IP);
glfwDestroyCursor = downcall("glfwDestroyCursor", PV);
glfwSetCursor = downcall("glfwSetCursor", PPV);
glfwSetKeyCallback = downcall("glfwSetKeyCallback", PPP);
glfwSetCharCallback = downcall("glfwSetCharCallback", PPP);
glfwSetMouseButtonCallback = downcall("glfwSetMouseButtonCallback", PPP);
glfwSetCursorPosCallback = downcall("glfwSetCursorPosCallback", PPP);
glfwSetCursorEnterCallback = downcall("glfwSetCursorEnterCallback", PPP);
glfwSetScrollCallback = downcall("glfwSetScrollCallback", PPP);
glfwSetDropCallback = downcall("glfwSetDropCallback", PPP);
glfwJoystickPresent = downcallTrivial("glfwJoystickPresent", II);
glfwGetJoystickAxes = downcallTrivial("glfwGetJoystickAxes", IPp);
glfwGetJoystickButtons = downcallTrivial("glfwGetJoystickButtons", IPp);
glfwGetJoystickHats = downcallTrivial("glfwGetJoystickHats", IPP);
glfwGetJoystickName = downcallTrivial("glfwGetJoystickName", Ip);
glfwGetJoystickGUID = downcallTrivial("glfwGetJoystickGUID", Ip);
glfwJoystickPresent = downcall("glfwJoystickPresent", II);
glfwGetJoystickAxes = downcall("glfwGetJoystickAxes", IPp);
glfwGetJoystickButtons = downcall("glfwGetJoystickButtons", IPp);
glfwGetJoystickHats = downcall("glfwGetJoystickHats", IPP);
glfwGetJoystickName = downcall("glfwGetJoystickName", Ip);
glfwGetJoystickGUID = downcall("glfwGetJoystickGUID", Ip);
glfwSetJoystickUserPointer = downcallTrivial("glfwSetJoystickUserPointer", IPV);
glfwGetJoystickUserPointer = downcallTrivial("glfwGetJoystickUserPointer", IP);
glfwJoystickIsGamepad = downcallTrivial("glfwJoystickIsGamepad", II);
glfwJoystickIsGamepad = downcall("glfwJoystickIsGamepad", II);
glfwSetJoystickCallback = downcall("glfwSetJoystickCallback", PP);
glfwUpdateGamepadMappings = downcall("glfwUpdateGamepadMappings", fd_PI);
glfwGetGamepadName = downcallTrivial("glfwGetGamepadName", Ip);
glfwGetGamepadState = downcallTrivial("glfwGetGamepadState", IPI);
glfwSetClipboardString = downcallTrivial("glfwSetClipboardString", PPV);
glfwGetClipboardString = downcallTrivial("glfwGetClipboardString", Pp);
glfwGetGamepadName = downcall("glfwGetGamepadName", Ip);
glfwGetGamepadState = downcall("glfwGetGamepadState", IPI);
glfwSetClipboardString = downcall("glfwSetClipboardString", PPV);
glfwGetClipboardString = downcall("glfwGetClipboardString", Pp);
glfwGetTime = downcallTrivial("glfwGetTime", D);
glfwSetTime = downcallTrivial("glfwSetTime", DV);
glfwGetTimerValue = downcallTrivial("glfwGetTimerValue", J);
glfwGetTimerFrequency = downcallTrivial("glfwGetTimerFrequency", J);
glfwMakeContextCurrent = downcall("glfwMakeContextCurrent", PV);
glfwGetCurrentContext = downcallTrivial("glfwGetCurrentContext", P);
glfwSwapBuffers = downcall("glfwSwapBuffers", PV);
glfwSwapInterval = downcallTrivial("glfwSwapInterval", IV);
glfwExtensionSupported = downcallTrivial("glfwExtensionSupported", fd_PI);
glfwSwapInterval = downcall("glfwSwapInterval", IV);
glfwExtensionSupported = downcall("glfwExtensionSupported", fd_PI);
glfwGetProcAddress = downcall("glfwGetProcAddress", PP);
glfwVulkanSupported = downcallTrivial("glfwVulkanSupported", I);
glfwGetRequiredInstanceExtensions = downcallTrivial("glfwGetRequiredInstanceExtensions", Pp);
glfwVulkanSupported = downcall("glfwVulkanSupported", I);
glfwGetRequiredInstanceExtensions = downcall("glfwGetRequiredInstanceExtensions", Pp);

// GLFW Vulkan
glfwGetInstanceProcAddress = downcall("glfwGetInstanceProcAddress", PPP);
Expand Down
14 changes: 7 additions & 7 deletions modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
* @since 0.1.0
*/
public final class NFD {
private static final SymbolLookup LOOKUP = RuntimeHelper.load("nfd", "nfd", OverrunGL.VERSION);
private static final SymbolLookup LOOKUP = RuntimeHelper.load("nfd", "nfd", "0.1.0.0");
private static final Platform os = Platform.current();
private static final boolean isOsWin = os instanceof Platform.Windows;
private static final boolean isOsWinOrApple = isOsWin || os instanceof Platform.MacOSX;
Expand All @@ -133,23 +133,23 @@ public final class NFD {
}

private static final MethodHandle
NFD_FreePathN = downcallTrivial("NFD_FreePathN", PV),
NFD_FreePathN = downcall("NFD_FreePathN", PV),
NFD_Init = downcall("NFD_Init", I),
NFD_Quit = downcall("NFD_Quit", V),
NFD_OpenDialogN = downcall("NFD_OpenDialogN", PPIPI),
NFD_OpenDialogMultipleN = downcall("NFD_OpenDialogMultipleN", PPIPI),
NFD_SaveDialogN = downcall("NFD_SaveDialogN", PPIPPI),
NFD_PickFolderN = downcall("NFD_PickFolderN", PPI),
NFD_GetError = downcallTrivial("NFD_GetError", p),
NFD_ClearError = downcallTrivial("NFD_ClearError", V),
NFD_GetError = downcall("NFD_GetError", p),
NFD_ClearError = downcall("NFD_ClearError", V),
NFD_PathSet_GetCount = downcall("NFD_PathSet_GetCount", PPI),
NFD_PathSet_GetPathN = downcall("NFD_PathSet_GetPathN", FunctionDescriptor.of(JAVA_INT, ADDRESS, PATH_SET_SIZE, ADDRESS)),
NFD_PathSet_FreePathN = downcallSafeTrivial("NFD_PathSet_FreePathN", PV),
NFD_PathSet_FreePathN = downcallSafe("NFD_PathSet_FreePathN", PV),
NFD_PathSet_GetEnum = downcall("NFD_PathSet_GetEnum", PPI),
NFD_PathSet_FreeEnum = downcall("NFD_PathSet_FreeEnum", PV),
NFD_PathSet_EnumNextN = downcall("NFD_PathSet_EnumNextN", PPI),
NFD_PathSet_Free = downcallTrivial("NFD_PathSet_Free", PV),
NFD_FreePathU8 = downcallSafeTrivial("NFD_FreePathU8", PV),
NFD_PathSet_Free = downcall("NFD_PathSet_Free", PV),
NFD_FreePathU8 = downcallSafe("NFD_FreePathU8", PV),
NFD_OpenDialogU8 = downcallSafe("NFD_OpenDialogU8", PPIPI),
NFD_OpenDialogMultipleU8 = downcallSafe("NFD_OpenDialogMultipleU8", PPIPI),
NFD_SaveDialogU8 = downcallSafe("NFD_SaveDialogU8", PPIPPI),
Expand Down
Loading

0 comments on commit a8260bb

Please sign in to comment.