From c9e12bb36f2a70ba3b1393658811ed99c8f43d15 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Tue, 10 Sep 2019 16:23:01 -0400 Subject: [PATCH] fix some function signatures from libskycoin.h ref #108 --- lib/cgo/tests/check_cipher.address.common.c | 6 +++--- lib/cgo/tests/check_cipher.crypto.common.c | 6 +++--- lib/cgo/tests/check_cipher.hash.common.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/cgo/tests/check_cipher.address.common.c b/lib/cgo/tests/check_cipher.address.common.c index fd08635c9..6545486be 100644 --- a/lib/cgo/tests/check_cipher.address.common.c +++ b/lib/cgo/tests/check_cipher.address.common.c @@ -68,7 +68,7 @@ START_TEST(TestAddressFromBytes) cipher__SecKey sk; cipher__PubKey pk; GoSlice bytes; - GoSlice_ tempBytes; + GoSlice tempBytes; GoUint8 buff[1024]; GoUint32 err = SKY_cipher_GenerateKeyPair(&pk, &sk); ck_assert(err == SKY_OK); @@ -80,7 +80,7 @@ START_TEST(TestAddressFromBytes) SKY_cipher_Address_Bytes(&addr, &tempBytes); ck_assert_msg(tempBytes.len > 0, "address bytes written"); - copyGoSlice_toGoSlice(&bytes, &tempBytes, tempBytes.len); + copyGoSlice_toGoSlice(&bytes, (GoSlice_*)&tempBytes, tempBytes.len); err = SKY_cipher_AddressFromBytes(bytes, &addr2); ck_assert_msg(err == SKY_OK, "convert bytes to SKY address"); @@ -101,7 +101,7 @@ START_TEST(TestAddressFromBytes) addr.Version = 2; SKY_cipher_Address_Bytes(&addr, &tempBytes); - copyGoSlice_toGoSlice(&bytes, &tempBytes, tempBytes.len); + copyGoSlice_toGoSlice(&bytes, (GoSlice_*)&tempBytes, tempBytes.len); err = SKY_cipher_AddressFromBytes(bytes, &addr2); ck_assert_msg(err == SKY_ErrAddressInvalidVersion, "Invalid version"); } diff --git a/lib/cgo/tests/check_cipher.crypto.common.c b/lib/cgo/tests/check_cipher.crypto.common.c index 9f44048a9..21b788288 100644 --- a/lib/cgo/tests/check_cipher.crypto.common.c +++ b/lib/cgo/tests/check_cipher.crypto.common.c @@ -104,7 +104,7 @@ START_TEST(TestPubKeyHex) GoUint32 err = SKY_cipher_GenerateKeyPair(&p, &sk); ck_assert(err == SKY_OK); - GoString_ tmp_s3 = {buff_s3, 0}; + GoString tmp_s3 = {buff_s3, 0}; err = SKY_cipher_PubKey_Hex(&p, &tmp_s3); ck_assert(err == SKY_OK); s3.n = tmp_s3.n; @@ -115,7 +115,7 @@ START_TEST(TestPubKeyHex) ck_assert(isPubKeyEq(&p, &p2)); unsigned char s4_buff[50]; - GoString_ tmp_s4 = {s4_buff, 0}; + GoString tmp_s4 = {s4_buff, 0}; err = SKY_cipher_PubKey_Hex(&p2, &tmp_s4); ck_assert(err == SKY_OK); s4.n = s4.n; @@ -263,7 +263,7 @@ START_TEST(TestSigHex) ck_assert(errorcode == SKY_OK); char buffer[100]; - GoString_ tmp_str = {buffer, 0}; + GoString tmp_str = {buffer, 0}; SKY_cipher_Sig_Hex(&s, &tmp_str); str.p = tmp_str.p; str.n = tmp_str.n; diff --git a/lib/cgo/tests/check_cipher.hash.common.c b/lib/cgo/tests/check_cipher.hash.common.c index 072f57d48..1aa9f87a7 100644 --- a/lib/cgo/tests/check_cipher.hash.common.c +++ b/lib/cgo/tests/check_cipher.hash.common.c @@ -101,7 +101,7 @@ START_TEST(TestSHA256KnownValue) SKY_cipher_SumSHA256(slice_input, &sha); - GoString_ tmp_output; + GoString tmp_output; SKY_cipher_SHA256_Hex(&sha, &tmp_output); registerMemCleanup((void*)tmp_output.p); @@ -188,7 +188,7 @@ START_TEST(TestSHA256FromHex) ck_assert(error == SKY_ErrInvalidHexLength); // Valid hex hash - GoString_ s2; + GoString s2; memset(&s2, 0, sizeof(GoString_)); SKY_cipher_SHA256_Hex(&h, &s2); registerMemCleanup((void*)s2.p);