@@ -18,8 +18,8 @@ pub const Body = *align(@sizeOf(usize)) BodyImpl;
1818pub const Constraint = * align (@sizeOf (usize )) ConstraintImpl ;
1919pub const Point2PointConstraint = * align (@sizeOf (usize )) Point2PointConstraintImpl ;
2020
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 ;
2323
2424extern fn cbtAlignedAllocSetCustomAligned (
2525 alloc : ? AllocFn ,
@@ -34,7 +34,7 @@ var mem_allocator: ?std.mem.Allocator = null;
3434var mem_allocations : ? std .AutoHashMap (usize , SizeAndAlignment ) = null ;
3535var mem_mutex : std.Thread.Mutex = .{};
3636
37- export fn zbulletAlloc (size : usize , alignment : i32 ) callconv (.C ) ? * anyopaque {
37+ export fn zbulletAlloc (size : usize , alignment : i32 ) callconv (.c ) ? * anyopaque {
3838 mem_mutex .lock ();
3939 defer mem_mutex .unlock ();
4040
@@ -53,7 +53,7 @@ export fn zbulletAlloc(size: usize, alignment: i32) callconv(.C) ?*anyopaque {
5353 return ptr ;
5454}
5555
56- export fn zbulletFree (maybe_ptr : ? * anyopaque ) callconv (.C ) void {
56+ export fn zbulletFree (maybe_ptr : ? * anyopaque ) callconv (.c ) void {
5757 if (maybe_ptr ) | ptr | {
5858 mem_mutex .lock ();
5959 defer mem_mutex .unlock ();
@@ -1156,23 +1156,23 @@ pub const DebugDraw = extern struct {
11561156 * const [3 ]f32 ,
11571157 * const [3 ]f32 ,
11581158 * const [3 ]f32 ,
1159- ) callconv (.C ) void ;
1159+ ) callconv (.c ) void ;
11601160
11611161 const DrawLine2Fn = * const fn (
11621162 ? * anyopaque ,
11631163 * const [3 ]f32 ,
11641164 * const [3 ]f32 ,
11651165 * const [3 ]f32 ,
11661166 * const [3 ]f32 ,
1167- ) callconv (.C ) void ;
1167+ ) callconv (.c ) void ;
11681168
11691169 const DrawContactPointFn = * const fn (
11701170 ? * anyopaque ,
11711171 * const [3 ]f32 ,
11721172 * const [3 ]f32 ,
11731173 f32 ,
11741174 * const [3 ]f32 ,
1175- ) callconv (.C ) void ;
1175+ ) callconv (.c ) void ;
11761176
11771177 drawLine1 : DrawLine1Fn ,
11781178 drawLine2 : ? DrawLine2Fn ,
@@ -1188,12 +1188,12 @@ pub const DebugDrawer = struct {
11881188 color : u32 ,
11891189 };
11901190
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 ){} };
11931193 }
11941194
11951195 pub fn deinit (debug : * DebugDrawer ) void {
1196- debug .lines .deinit ();
1196+ debug .lines .deinit (mem_allocator .? );
11971197 debug .* = undefined ;
11981198 }
11991199
@@ -1211,7 +1211,7 @@ pub const DebugDrawer = struct {
12111211 p0 : * const [3 ]f32 ,
12121212 p1 : * const [3 ]f32 ,
12131213 color : * const [3 ]f32 ,
1214- ) callconv (.C ) void {
1214+ ) callconv (.c ) void {
12151215 const debug = @as (
12161216 * DebugDrawer ,
12171217 @ptrCast (@alignCast (context .? )),
@@ -1223,9 +1223,11 @@ pub const DebugDrawer = struct {
12231223 const rgb = r | g | b ;
12241224
12251225 debug .lines .append (
1226+ mem_allocator .? ,
12261227 .{ .position = .{ p0 [0 ], p0 [1 ], p0 [2 ] }, .color = rgb },
12271228 ) catch unreachable ;
12281229 debug .lines .append (
1230+ mem_allocator .? ,
12291231 .{ .position = .{ p1 [0 ], p1 [1 ], p1 [2 ] }, .color = rgb },
12301232 ) catch unreachable ;
12311233 }
@@ -1236,7 +1238,7 @@ pub const DebugDrawer = struct {
12361238 p1 : * const [3 ]f32 ,
12371239 color0 : * const [3 ]f32 ,
12381240 color1 : * const [3 ]f32 ,
1239- ) callconv (.C ) void {
1241+ ) callconv (.c ) void {
12401242 const debug = @as (
12411243 * DebugDrawer ,
12421244 @ptrCast (@alignCast (context .? )),
@@ -1253,9 +1255,11 @@ pub const DebugDrawer = struct {
12531255 const rgb1 = r1 | g1 | b1 ;
12541256
12551257 debug .lines .append (
1258+ mem_allocator .? ,
12561259 .{ .position = .{ p0 [0 ], p0 [1 ], p0 [2 ] }, .color = rgb0 },
12571260 ) catch unreachable ;
12581261 debug .lines .append (
1262+ mem_allocator .? ,
12591263 .{ .position = .{ p1 [0 ], p1 [1 ], p1 [2 ] }, .color = rgb1 },
12601264 ) catch unreachable ;
12611265 }
0 commit comments