Skip to content

Commit

Permalink
bindings/c#: resolve lgtm warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Jun 24, 2022
1 parent 70b0bb9 commit 924181e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ queries:
- include: "*"
- exclude: cpp/unused-static-function
- exclude: cpp/include-non-header
- exclude: cs/call-to-unmanaged-code
- exclude: cs/unmanaged-code

extraction:
cpp:
Expand All @@ -15,6 +17,5 @@ extraction:

csharp:
index:
buildless: true
nuget_restore: false

10 changes: 5 additions & 5 deletions bindings/c#/run.me
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public enum ERROR {
}
public class Exception : ApplicationException {
private ERROR code;
private readonly ERROR code;
public Exception(ERROR err) { code = err; }
public override string Message
Expand Down Expand Up @@ -265,7 +265,7 @@ static extern ERROR blst_core_verify_pk_in_g2([In] long[] pk, [In] long[] sig,
[In] byte[] aug, size_t aug_len);
public struct P1_Affine {
internal long[] point;
internal readonly long[] point;
private static readonly int sz = (int)blst_p1_affine_sizeof()/sizeof(long);
Expand Down Expand Up @@ -380,7 +380,7 @@ public struct P1 {
private P1(bool _) { point = new long[sz]; }
private P1(P1 p) { point = (long[])p.point.Clone(); }
private long[] self()
{ if (point==null) point = new long[sz]; return point; }
{ if (point==null) { point = new long[sz]; } return point; }
public P1(SecretKey sk) : this(true)
{ blst_sk_to_pk_in_g1(point, sk.key); }
Expand Down Expand Up @@ -522,7 +522,7 @@ static extern bool blst_fp12_in_group([In] long[] a);
static extern void blst_bendian_from_fp12([Out] byte[] ret, [In] long[] a);
public struct PT {
internal long[] fp12;
internal readonly long[] fp12;
private static readonly int sz = (int)blst_fp12_sizeof()/sizeof(long);
Expand Down Expand Up @@ -590,7 +590,7 @@ void blst_pairing_raw_aggregate([In, Out] long[] ctx, [In] long[] q,
static extern IntPtr blst_pairing_as_fp12([In] long[] ctx);
public struct Pairing {
private long[] ctx;
private readonly long[] ctx;
private static readonly int sz = (int)blst_pairing_sizeof()/sizeof(long);
Expand Down
14 changes: 7 additions & 7 deletions bindings/c#/supranational.blst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum ERROR {
}

public class Exception : ApplicationException {
private ERROR code;
private readonly ERROR code;

public Exception(ERROR err) { code = err; }
public override string Message
Expand Down Expand Up @@ -264,7 +264,7 @@ static extern ERROR blst_core_verify_pk_in_g2([In] long[] pk, [In] long[] sig,
[In] byte[] aug, size_t aug_len);

public struct P1_Affine {
internal long[] point;
internal readonly long[] point;

private static readonly int sz = (int)blst_p1_affine_sizeof()/sizeof(long);

Expand Down Expand Up @@ -379,7 +379,7 @@ public struct P1 {
private P1(bool _) { point = new long[sz]; }
private P1(P1 p) { point = (long[])p.point.Clone(); }
private long[] self()
{ if (point==null) point = new long[sz]; return point; }
{ if (point==null) { point = new long[sz]; } return point; }

public P1(SecretKey sk) : this(true)
{ blst_sk_to_pk_in_g1(point, sk.key); }
Expand Down Expand Up @@ -527,7 +527,7 @@ static extern ERROR blst_core_verify_pk_in_g1([In] long[] pk, [In] long[] sig,
[In] byte[] aug, size_t aug_len);

public struct P2_Affine {
internal long[] point;
internal readonly long[] point;

private static readonly int sz = (int)blst_p2_affine_sizeof()/sizeof(long);

Expand Down Expand Up @@ -642,7 +642,7 @@ public struct P2 {
private P2(bool _) { point = new long[sz]; }
private P2(P2 p) { point = (long[])p.point.Clone(); }
private long[] self()
{ if (point==null) point = new long[sz]; return point; }
{ if (point==null) { point = new long[sz]; } return point; }

public P2(SecretKey sk) : this(true)
{ blst_sk_to_pk_in_g2(point, sk.key); }
Expand Down Expand Up @@ -784,7 +784,7 @@ static extern void blst_fp12_mul([Out] long[] ret, [In] long[] a,
static extern void blst_bendian_from_fp12([Out] byte[] ret, [In] long[] a);

public struct PT {
internal long[] fp12;
internal readonly long[] fp12;

private static readonly int sz = (int)blst_fp12_sizeof()/sizeof(long);

Expand Down Expand Up @@ -852,7 +852,7 @@ void blst_pairing_raw_aggregate([In, Out] long[] ctx, [In] long[] q,
static extern IntPtr blst_pairing_as_fp12([In] long[] ctx);

public struct Pairing {
private long[] ctx;
private readonly long[] ctx;

private static readonly int sz = (int)blst_pairing_sizeof()/sizeof(long);

Expand Down

0 comments on commit 924181e

Please sign in to comment.