Skip to content

Commit 7427ede

Browse files
committed
fixup! Add initial zig bindings.
1 parent 392948f commit 7427ede

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

bindings/zig/blst.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ pub const Pairing = struct {
8585
const opt = aug orelse &[_]u8{};
8686
var err: c.BLST_ERROR = undefined;
8787

88-
switch(@TypeOf(pk)) {
88+
switch (@TypeOf(pk)) {
8989
*const P1_Affine, *P1_Affine => {
90-
const sigp : [*c]const c.blst_p2_affine = switch(@TypeOf(sig)) {
90+
const sigp : [*c]const c.blst_p2_affine = switch (@TypeOf(sig)) {
9191
@TypeOf(null) => null,
9292
else => &sig.point,
9393
};
@@ -97,7 +97,7 @@ pub const Pairing = struct {
9797
@ptrCast(opt), opt.len);
9898
},
9999
*const P2_Affine, *P2_Affine => {
100-
const sigp : [*c]const c.blst_p1_affine = switch(@TypeOf(sig)) {
100+
const sigp : [*c]const c.blst_p1_affine = switch (@TypeOf(sig)) {
101101
@TypeOf(null) => null,
102102
else => &sig.point,
103103
};
@@ -152,7 +152,7 @@ pub const P1_Affine = struct {
152152
*P1 => return in.to_affine(),
153153
P1 => @compileError("expected type '*const blst.P1', found 'blst.P1'"),
154154
else => |T| {
155-
switch(@typeInfo(T)) {
155+
switch (@typeInfo(T)) {
156156
.pointer => { const s: []const u8 = in; _ = s; },
157157
else => @compileError("expected type '[]const u8', found '" ++ @typeName(T) ++ "'"),
158158
}
@@ -249,7 +249,7 @@ pub const P1 = struct {
249249
*P1_Affine => return in.to_jacobian(),
250250
P1_Affine => @compileError("expected type '*const blst.P1_Affine', found 'blst.P1_Affine'"),
251251
else => |T| {
252-
switch(@typeInfo(T)) {
252+
switch (@typeInfo(T)) {
253253
.pointer => { const s: []const u8 = in; _ = s; },
254254
else => @compileError("expected type '[]const u8', found '" ++ @typeName(T) ++ "'"),
255255
}
@@ -371,7 +371,7 @@ pub const P2_Affine = struct {
371371
*P2 => return in.to_affine(),
372372
P2 => @compileError("expected type '*const blst.P2', found 'blst.P2'"),
373373
else => |T| {
374-
switch(@typeInfo(T)) {
374+
switch (@typeInfo(T)) {
375375
.pointer => { const s: []const u8 = in; _ = s; },
376376
else => @compileError("expected type '[]const u8', found '" ++ @typeName(T) ++ "'"),
377377
}
@@ -468,7 +468,7 @@ pub const P2 = struct {
468468
*P2_Affine => return in.to_jacobian(),
469469
P2_Affine => @compileError("expected type '*const blst.P2_Affine', found 'blst.P2_Affine'"),
470470
else => |T| {
471-
switch(@typeInfo(T)) {
471+
switch (@typeInfo(T)) {
472472
.pointer => { const s: []const u8 = in; _ = s; },
473473
else => @compileError("expected type '[]const u8', found '" ++ @typeName(T) ++ "'"),
474474
}

bindings/zig/generate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ def newer(*files):
117117
const opt = aug orelse &[_]u8{};
118118
var err: c.BLST_ERROR = undefined;
119119
120-
switch(@TypeOf(pk)) {
120+
switch (@TypeOf(pk)) {
121121
*const P1_Affine, *P1_Affine => {
122-
const sigp : [*c]const c.blst_p2_affine = switch(@TypeOf(sig)) {
122+
const sigp : [*c]const c.blst_p2_affine = switch (@TypeOf(sig)) {
123123
@TypeOf(null) => null,
124124
else => &sig.point,
125125
};
@@ -129,7 +129,7 @@ def newer(*files):
129129
@ptrCast(opt), opt.len);
130130
},
131131
*const P2_Affine, *P2_Affine => {
132-
const sigp : [*c]const c.blst_p1_affine = switch(@TypeOf(sig)) {
132+
const sigp : [*c]const c.blst_p1_affine = switch (@TypeOf(sig)) {
133133
@TypeOf(null) => null,
134134
else => &sig.point,
135135
};
@@ -184,7 +184,7 @@ def newer(*files):
184184
*P1 => return in.to_affine(),
185185
P1 => @compileError("expected type '*const blst.P1', found 'blst.P1'"),
186186
else => |T| {
187-
switch(@typeInfo(T)) {
187+
switch (@typeInfo(T)) {
188188
.pointer => { const s: []const u8 = in; _ = s; },
189189
else => @compileError("expected type '[]const u8', found '" ++ @typeName(T) ++ "'"),
190190
}
@@ -281,7 +281,7 @@ def newer(*files):
281281
*P1_Affine => return in.to_jacobian(),
282282
P1_Affine => @compileError("expected type '*const blst.P1_Affine', found 'blst.P1_Affine'"),
283283
else => |T| {
284-
switch(@typeInfo(T)) {
284+
switch (@typeInfo(T)) {
285285
.pointer => { const s: []const u8 = in; _ = s; },
286286
else => @compileError("expected type '[]const u8', found '" ++ @typeName(T) ++ "'"),
287287
}

0 commit comments

Comments
 (0)