@@ -18,8 +18,8 @@ pub const Body = *align(@sizeOf(usize)) BodyImpl;
18
18
pub const Constraint = * align (@sizeOf (usize )) ConstraintImpl ;
19
19
pub const Point2PointConstraint = * align (@sizeOf (usize )) Point2PointConstraintImpl ;
20
20
21
- pub const AllocFn = * const fn (size : usize , alignment : i32 ) callconv (.C ) ? * anyopaque ;
22
- pub const FreeFn = * const fn (ptr : ? * anyopaque ) callconv (.C ) void ;
21
+ pub const AllocFn = * const fn (size : usize , alignment : i32 ) callconv (.c ) ? * anyopaque ;
22
+ pub const FreeFn = * const fn (ptr : ? * anyopaque ) callconv (.c ) void ;
23
23
24
24
extern fn cbtAlignedAllocSetCustomAligned (
25
25
alloc : ? AllocFn ,
@@ -34,7 +34,7 @@ var mem_allocator: ?std.mem.Allocator = null;
34
34
var mem_allocations : ? std .AutoHashMap (usize , SizeAndAlignment ) = null ;
35
35
var mem_mutex : std.Thread.Mutex = .{};
36
36
37
- export fn zbulletAlloc (size : usize , alignment : i32 ) callconv (.C ) ? * anyopaque {
37
+ export fn zbulletAlloc (size : usize , alignment : i32 ) callconv (.c ) ? * anyopaque {
38
38
mem_mutex .lock ();
39
39
defer mem_mutex .unlock ();
40
40
@@ -53,7 +53,7 @@ export fn zbulletAlloc(size: usize, alignment: i32) callconv(.C) ?*anyopaque {
53
53
return ptr ;
54
54
}
55
55
56
- export fn zbulletFree (maybe_ptr : ? * anyopaque ) callconv (.C ) void {
56
+ export fn zbulletFree (maybe_ptr : ? * anyopaque ) callconv (.c ) void {
57
57
if (maybe_ptr ) | ptr | {
58
58
mem_mutex .lock ();
59
59
defer mem_mutex .unlock ();
@@ -1156,23 +1156,23 @@ pub const DebugDraw = extern struct {
1156
1156
* const [3 ]f32 ,
1157
1157
* const [3 ]f32 ,
1158
1158
* const [3 ]f32 ,
1159
- ) callconv (.C ) void ;
1159
+ ) callconv (.c ) void ;
1160
1160
1161
1161
const DrawLine2Fn = * const fn (
1162
1162
? * anyopaque ,
1163
1163
* const [3 ]f32 ,
1164
1164
* const [3 ]f32 ,
1165
1165
* const [3 ]f32 ,
1166
1166
* const [3 ]f32 ,
1167
- ) callconv (.C ) void ;
1167
+ ) callconv (.c ) void ;
1168
1168
1169
1169
const DrawContactPointFn = * const fn (
1170
1170
? * anyopaque ,
1171
1171
* const [3 ]f32 ,
1172
1172
* const [3 ]f32 ,
1173
1173
f32 ,
1174
1174
* const [3 ]f32 ,
1175
- ) callconv (.C ) void ;
1175
+ ) callconv (.c ) void ;
1176
1176
1177
1177
drawLine1 : DrawLine1Fn ,
1178
1178
drawLine2 : ? DrawLine2Fn ,
@@ -1188,12 +1188,12 @@ pub const DebugDrawer = struct {
1188
1188
color : u32 ,
1189
1189
};
1190
1190
1191
- pub fn init (alloc : std.mem.Allocator ) DebugDrawer {
1192
- return .{ .lines = std .ArrayList (Vertex ). init ( alloc ) };
1191
+ pub fn init () DebugDrawer {
1192
+ return .{ .lines = std .ArrayList (Vertex ){} };
1193
1193
}
1194
1194
1195
1195
pub fn deinit (debug : * DebugDrawer ) void {
1196
- debug .lines .deinit ();
1196
+ debug .lines .deinit (mem_allocator .? );
1197
1197
debug .* = undefined ;
1198
1198
}
1199
1199
@@ -1211,7 +1211,7 @@ pub const DebugDrawer = struct {
1211
1211
p0 : * const [3 ]f32 ,
1212
1212
p1 : * const [3 ]f32 ,
1213
1213
color : * const [3 ]f32 ,
1214
- ) callconv (.C ) void {
1214
+ ) callconv (.c ) void {
1215
1215
const debug = @as (
1216
1216
* DebugDrawer ,
1217
1217
@ptrCast (@alignCast (context .? )),
@@ -1223,9 +1223,11 @@ pub const DebugDrawer = struct {
1223
1223
const rgb = r | g | b ;
1224
1224
1225
1225
debug .lines .append (
1226
+ mem_allocator .? ,
1226
1227
.{ .position = .{ p0 [0 ], p0 [1 ], p0 [2 ] }, .color = rgb },
1227
1228
) catch unreachable ;
1228
1229
debug .lines .append (
1230
+ mem_allocator .? ,
1229
1231
.{ .position = .{ p1 [0 ], p1 [1 ], p1 [2 ] }, .color = rgb },
1230
1232
) catch unreachable ;
1231
1233
}
@@ -1236,7 +1238,7 @@ pub const DebugDrawer = struct {
1236
1238
p1 : * const [3 ]f32 ,
1237
1239
color0 : * const [3 ]f32 ,
1238
1240
color1 : * const [3 ]f32 ,
1239
- ) callconv (.C ) void {
1241
+ ) callconv (.c ) void {
1240
1242
const debug = @as (
1241
1243
* DebugDrawer ,
1242
1244
@ptrCast (@alignCast (context .? )),
@@ -1253,9 +1255,11 @@ pub const DebugDrawer = struct {
1253
1255
const rgb1 = r1 | g1 | b1 ;
1254
1256
1255
1257
debug .lines .append (
1258
+ mem_allocator .? ,
1256
1259
.{ .position = .{ p0 [0 ], p0 [1 ], p0 [2 ] }, .color = rgb0 },
1257
1260
) catch unreachable ;
1258
1261
debug .lines .append (
1262
+ mem_allocator .? ,
1259
1263
.{ .position = .{ p1 [0 ], p1 [1 ], p1 [2 ] }, .color = rgb1 },
1260
1264
) catch unreachable ;
1261
1265
}
0 commit comments