Update GLFWImage.java

wrap deprecated functions
This commit is contained in:
NotAHero04 2022-10-20 10:39:12 +07:00 committed by GitHub
parent c32b38b521
commit f9616655ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,7 +255,7 @@ public class GLFWImage extends Struct implements NativeResource {
* @param stack the stack from which to allocate * @param stack the stack from which to allocate
*/ */
public static GLFWImage mallocStack(MemoryStack stack) { public static GLFWImage mallocStack(MemoryStack stack) {
return wrap(GLFWImage.class, stack.nmalloc(ALIGNOF, SIZEOF)); return malloc(stack);
} }
/** /**
@ -264,7 +264,7 @@ public class GLFWImage extends Struct implements NativeResource {
* @param stack the stack from which to allocate * @param stack the stack from which to allocate
*/ */
public static GLFWImage callocStack(MemoryStack stack) { public static GLFWImage callocStack(MemoryStack stack) {
return wrap(GLFWImage.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); return calloc(stack);
} }
/** /**
@ -292,7 +292,7 @@ public class GLFWImage extends Struct implements NativeResource {
* @param capacity the buffer capacity * @param capacity the buffer capacity
*/ */
public static GLFWImage.Buffer mallocStack(int capacity, MemoryStack stack) { public static GLFWImage.Buffer mallocStack(int capacity, MemoryStack stack) {
return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); return malloc(capacity, stack);
} }
/** /**
@ -302,7 +302,7 @@ public class GLFWImage extends Struct implements NativeResource {
* @param capacity the buffer capacity * @param capacity the buffer capacity
*/ */
public static GLFWImage.Buffer callocStack(int capacity, MemoryStack stack) { public static GLFWImage.Buffer callocStack(int capacity, MemoryStack stack) {
return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); return calloc(capacity, stack);
} }
// ----------------------------------- // -----------------------------------