Skip to content

Commit 5a307d3

Browse files
committed
Regenerate Sources
1 parent baffe50 commit 5a307d3

119 files changed

Lines changed: 14187 additions & 12763 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

natives/clang.dll

76.8 MB
Binary file not shown.

src/main/java/generation/Box2DGeneration.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//import org.lwjgl.llvm.ClangIndex;
1313
//
1414
//import volucris.bindings.generator.generation.Generator;
15-
//import volucris.bindings.generator.parsing.FunctionPointer;
1615
//import volucris.bindings.generator.parsing.HeaderFile;
16+
//import volucris.bindings.generator.parsing.NativeFunctionPointer;
1717
//
1818
//public class Box2DGeneration {
1919
//
@@ -45,9 +45,10 @@
4545
// e.printStackTrace();
4646
// }
4747
//
48-
// Map<String, FunctionPointer> functionPointers = new HashMap<>();
49-
// headerFile.getStruct("b2DebugDraw").getFunctionPointers().forEach(f -> {
50-
// functionPointers.put(f.getName(), f);
48+
// Map<String, NativeFunctionPointer> functionPointers = new HashMap<>();
49+
// headerFile.getRecord("b2DebugDraw").getFunctionPointerFields().forEach(f -> {
50+
// NativeFunctionPointer functionPointer = f.getFunctionPointer();
51+
// functionPointers.put(functionPointer.getName(), functionPointer);
5152
// });
5253
//
5354
// generator.generateCallbacks("src/main/resources/callbacksConfig/callbacksConfig.yaml", functionPointers);

src/main/java/volucris/bindings/box2d/AllocFcn.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
package volucris.bindings.box2d;
55

6+
import edu.umd.cs.findbugs.annotations.Nullable;
67
import java.lang.foreign.Arena;
78
import java.lang.foreign.FunctionDescriptor;
89
import java.lang.foreign.Linker;
@@ -11,13 +12,19 @@
1112
import java.lang.invoke.MethodHandles;
1213
import java.lang.ref.WeakReference;
1314
import java.util.HashMap;
15+
import java.util.Map;
1416

1517
import static java.lang.foreign.ValueLayout.*;
1618
import static volucris.bindings.core.FFMUtils.*;
1719

20+
/// ```
21+
/// Prototype for user allocation function
22+
/// @param size the allocation size in bytes
23+
/// @param alignment the required alignment, guaranteed to be a power of 2
24+
/// ```
1825
public abstract class AllocFcn {
1926

20-
private static final HashMap<Long, WeakReference<AllocFcn>> CACHE;
27+
private static final Map<Long, WeakReference<AllocFcn>> CACHE;
2128

2229
public static final FunctionDescriptor DESCRIPTION;
2330
public static final MethodHandle HANDLE;
@@ -51,7 +58,7 @@ public AllocFcn(Arena arena) {
5158
}
5259

5360
public MemorySegment invoke(
54-
int size,
61+
int size,
5562
int alignment
5663
) {
5764
throw new UnsupportedOperationException(
@@ -63,7 +70,7 @@ public MemorySegment memorySegment() {
6370
return segment;
6471
}
6572

66-
public static AllocFcn get(MemorySegment segment) {
73+
public static @Nullable AllocFcn get(MemorySegment segment) {
6774
WeakReference<AllocFcn> reference = CACHE.get(segment.address());
6875

6976
if (reference == null)

src/main/java/volucris/bindings/box2d/AssertFcn.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
package volucris.bindings.box2d;
55

6+
import edu.umd.cs.findbugs.annotations.Nullable;
67
import java.lang.foreign.Arena;
78
import java.lang.foreign.FunctionDescriptor;
89
import java.lang.foreign.Linker;
@@ -11,14 +12,18 @@
1112
import java.lang.invoke.MethodHandles;
1213
import java.lang.ref.WeakReference;
1314
import java.util.HashMap;
15+
import java.util.Map;
1416
import volucris.bindings.core.NativeByteArray;
1517

1618
import static java.lang.foreign.ValueLayout.*;
1719
import static volucris.bindings.core.FFMUtils.*;
1820

21+
/// ```
22+
/// Prototype for the user assert callback. Return 0 to skip the debugger break.
23+
/// ```
1924
public abstract class AssertFcn {
2025

21-
private static final HashMap<Long, WeakReference<AssertFcn>> CACHE;
26+
private static final Map<Long, WeakReference<AssertFcn>> CACHE;
2227

2328
public static final FunctionDescriptor DESCRIPTION;
2429
public static final MethodHandle HANDLE;
@@ -53,33 +58,32 @@ public AssertFcn(Arena arena) {
5358
}
5459

5560
public int invoke(
56-
MemorySegment condition,
57-
MemorySegment fileName,
61+
MemorySegment condition,
62+
MemorySegment fileName,
5863
int lineNumber
5964
) {
60-
return (int) invoke(
61-
new NativeByteArray(condition),
62-
new NativeByteArray(fileName),
63-
lineNumber
65+
return invoke(
66+
new NativeByteArray(condition),
67+
new NativeByteArray(fileName),
68+
lineNumber
6469
);
6570
}
6671

6772
public int invoke(
68-
NativeByteArray condition,
69-
NativeByteArray fileName,
73+
NativeByteArray condition,
74+
NativeByteArray fileName,
7075
int lineNumber
7176
) {
7277
throw new UnsupportedOperationException(
7378
"Override either the typed or raw callback method in AssertFcn."
7479
);
7580
};
7681

77-
7882
public MemorySegment memorySegment() {
7983
return segment;
8084
}
8185

82-
public static AssertFcn get(MemorySegment segment) {
86+
public static @Nullable AssertFcn get(MemorySegment segment) {
8387
WeakReference<AssertFcn> reference = CACHE.get(segment.address());
8488

8589
if (reference == null)

src/main/java/volucris/bindings/box2d/FreeFcn.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
package volucris.bindings.box2d;
55

6+
import edu.umd.cs.findbugs.annotations.Nullable;
67
import java.lang.foreign.Arena;
78
import java.lang.foreign.FunctionDescriptor;
89
import java.lang.foreign.Linker;
@@ -11,13 +12,17 @@
1112
import java.lang.invoke.MethodHandles;
1213
import java.lang.ref.WeakReference;
1314
import java.util.HashMap;
15+
import java.util.Map;
1416

15-
import static java.lang.foreign.ValueLayout.*;
1617
import static volucris.bindings.core.FFMUtils.*;
1718

19+
/// ```
20+
/// Prototype for user free function
21+
/// @param mem the memory previously allocated through `b2AllocFcn`
22+
/// ```
1823
public abstract class FreeFcn {
1924

20-
private static final HashMap<Long, WeakReference<FreeFcn>> CACHE;
25+
private static final Map<Long, WeakReference<FreeFcn>> CACHE;
2126

2227
public static final FunctionDescriptor DESCRIPTION;
2328
public static final MethodHandle HANDLE;
@@ -60,7 +65,7 @@ public MemorySegment memorySegment() {
6065
return segment;
6166
}
6267

63-
public static FreeFcn get(MemorySegment segment) {
68+
public static @Nullable FreeFcn get(MemorySegment segment) {
6469
WeakReference<FreeFcn> reference = CACHE.get(segment.address());
6570

6671
if (reference == null)

0 commit comments

Comments
 (0)