Skip to content

Commit 3877933

Browse files
committed
remove unused variables
1 parent 2977b46 commit 3877933

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

program/src/oracle/oracle.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ static uint64_t add_mapping( SolParameters *prm, SolAccountInfo *ka )
100100
nptr->size_ = sizeof( pc_map_table_t ) - sizeof( nptr->prod_ );
101101

102102
// Set last mapping account to point to this mapping account
103-
pc_pub_key_t *pkey = (pc_pub_key_t*)ka[1].key;
104103
pc_pub_key_t *nkey = (pc_pub_key_t*)ka[2].key;
105104
pc_pub_key_assign( &pptr->next_, nkey );
106105
return SUCCESS;
@@ -182,7 +181,6 @@ static uint64_t upd_product( SolParameters *prm, SolAccountInfo *ka )
182181
sizeof( cmd_upd_product_t ) - sizeof( pc_prod_t ) ) {
183182
return ERROR_INVALID_ARGUMENT;
184183
}
185-
cmd_upd_product_t *cptr = (cmd_upd_product_t*)prm->data;
186184
pptr->size_ = sizeof ( pc_prod_t ) + prm->data_len -
187185
sizeof( cmd_upd_product_t );
188186
uint8_t *tgt = (uint8_t*)pptr + sizeof( pc_prod_t );

program/src/oracle/test_oracle.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Test(oracle, init_mapping) {
1414
SolPubkey p_id2 = {.x = { 0xfe, }};
1515
SolPubkey pkey = {.x = { 1, }};
1616
SolPubkey mkey = {.x = { 2, }};
17-
uint64_t pqty = 100, mqty = 200;
17+
uint64_t pqty = 100;
1818
pc_map_table_t mptr[1];
1919
sol_memset( mptr, 0, sizeof( pc_map_table_t ) );
2020
SolAccountInfo acc[] = {{
@@ -95,7 +95,7 @@ Test(oracle, add_mapping ) {
9595
SolPubkey pkey = {.x = { 1, }};
9696
SolPubkey tkey = {.x = { 2, }};
9797
SolPubkey mkey = {.x = { 3, }};
98-
uint64_t pqty = 100, tqty = 100, mqty = 200;
98+
uint64_t pqty = 100, tqty = 100;
9999
pc_map_table_t mptr[1];
100100
sol_memset( mptr, 0, sizeof( pc_map_table_t ) );
101101
SolAccountInfo acc[] = {{
@@ -160,12 +160,11 @@ Test(oracle, add_product) {
160160
.cmd_ = e_cmd_add_product,
161161
};
162162
SolPubkey p_id = {.x = { 0xff, }};
163-
SolPubkey p_id2 = {.x = { 0xfe, }};
164163
SolPubkey pkey = {.x = { 1, }};
165164
SolPubkey mkey = {.x = { 2, }};
166165
SolPubkey skey = {.x = { 3, }};
167166
SolPubkey skey2 = {.x = { 4, }};
168-
uint64_t pqty = 100, mqty = 200;
167+
uint64_t pqty = 100;
169168
pc_map_table_t mptr[1];
170169
sol_memset( mptr, 0, sizeof( pc_map_table_t ) );
171170
mptr->magic_ = PC_MAGIC;
@@ -257,7 +256,6 @@ Test( oracle, add_publisher ) {
257256
.pub_ = { .k8_ = { 3UL, 4UL, 5UL, 6UL } }
258257
};
259258
SolPubkey p_id = {.x = { 0xff, }};
260-
SolPubkey p_id2 = {.x = { 0xfe, }};
261259
SolPubkey pkey = {.x = { 1, }};
262260
SolPubkey skey = {.x = { 3, }};
263261
uint64_t pqty = 100, sqty = 200;
@@ -348,7 +346,6 @@ Test( oracle, upd_price ) {
348346
.pub_slot_ = 1
349347
};
350348
SolPubkey p_id = {.x = { 0xff, }};
351-
SolPubkey p_id2 = {.x = { 0xfe, }};
352349
SolPubkey pkey = {.x = { 1, }};
353350
SolPubkey skey = {.x = { 3, }};
354351
sysvar_clock_t cvar = {
@@ -534,8 +531,6 @@ Test( oracle, del_publisher ) {
534531
.status_ = PC_STATUS_TRADING, .pub_slot_ = 42 };
535532
pc_price_info_t p2 = { .price_=200, .conf_=20,
536533
.status_ = PC_STATUS_TRADING, .pub_slot_ = 42 };
537-
pc_price_info_t p3 = { .price_=300, .conf_=30,
538-
.status_ = PC_STATUS_TRADING, .pub_slot_ = 42 };
539534

540535
// start with perfect inputs
541536
pc_pub_key_t p_id = { .k8_ = { 1, 2, 3, 4 } };

0 commit comments

Comments
 (0)