Skip to content

Commit

Permalink
Get rid of compiler warnings for char/unsigned char
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrtj committed Sep 16, 2024
1 parent 1c5e503 commit 5cbe1e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Secp256k1.xs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ new(classname)
PUTBACK;

STRLEN len;
unsigned char *randomize = SvPVbyte(tmp, len);
unsigned char *randomize = (unsigned char*) SvPVbyte(tmp, len);

/* Randomness dump */
/* for (int i = 0; i < len; ++i) { warn("%d: %d", i, randomize[i]); } */
Expand All @@ -122,7 +122,7 @@ _pubkey(self, ...)
}

size_t key_size;
unsigned char *key = SvPVbyte(new_pubkey, key_size);
unsigned char *key = (unsigned char*) SvPVbyte(new_pubkey, key_size);

secp256k1_pubkey *result_pubkey = malloc(sizeof *result_pubkey);
int result = secp256k1_ec_pubkey_parse(
Expand Down Expand Up @@ -157,7 +157,7 @@ _pubkey(self, ...)
compression
);

RETVAL = newSVpv(key_output, key_size);
RETVAL = newSVpv((char*) key_output, key_size);
}
else {
RETVAL = &PL_sv_undef;
Expand All @@ -178,7 +178,7 @@ _signature(self, ...)
}

size_t signature_size;
unsigned char *signature = SvPVbyte(new_signature, signature_size);
unsigned char *signature = (unsigned char*) SvPVbyte(new_signature, signature_size);

secp256k1_ecdsa_signature *result_signature = malloc(sizeof *result_signature);
int result = secp256k1_ecdsa_signature_parse_der(
Expand Down Expand Up @@ -206,7 +206,7 @@ _signature(self, ...)
ctx->signature
);

RETVAL = newSVpv(signature_output, signature_size);
RETVAL = newSVpv((char*) signature_output, signature_size);
}
else {
RETVAL = &PL_sv_undef;
Expand Down

0 comments on commit 5cbe1e5

Please sign in to comment.