Skip to content

Commit 35d041b

Browse files
committed
chore: fix static analysis warnings
1 parent 48c6268 commit 35d041b

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/discof/eqvoc/fd_eqvoc_tile.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ during_frag( fd_eqvoc_tile_ctx_t * ctx,
131131
}
132132

133133
uchar const * packet = fd_chunk_to_laddr_const( ctx->shred_net_in_mem, chunk );
134-
fd_shred_t * shred = (fd_shred_t *)( packet + fd_disco_netmux_sig_hdr_sz( sig ) );
135-
memcpy( &ctx->shred, shred, sizeof(fd_shred_t) );
134+
memcpy( &ctx->shred, packet + fd_disco_netmux_sig_hdr_sz( sig ), sizeof(fd_shred_t) );
136135
}
137136
}
138137

src/discof/replay/fd_replay_tile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,8 @@ publish_slot_notifications( fd_replay_tile_ctx_t * ctx,
11301130
msg->slot_exec.height = block_entry_block_height;
11311131
msg->slot_exec.transaction_count = fork->slot_ctx->slot_bank.transaction_count;
11321132
msg->slot_exec.shred_cnt = fork->slot_ctx->shred_cnt;
1133-
memcpy( &msg->slot_exec.bank_hash, &fork->slot_ctx->slot_bank.banks_hash, sizeof( fd_hash_t ) );
1134-
memcpy( &msg->slot_exec.block_hash, &ctx->blockhash, sizeof( fd_hash_t ) );
1133+
msg->slot_exec.bank_hash = fork->slot_ctx->slot_bank.banks_hash;
1134+
msg->slot_exec.block_hash = ctx->blockhash;
11351135
memcpy( &msg->slot_exec.identity, ctx->validator_identity_pubkey, sizeof( fd_pubkey_t ) );
11361136
msg->slot_exec.ts = tsorig;
11371137
NOTIFY_END;
@@ -1701,7 +1701,7 @@ exec_slice( fd_replay_tile_ctx_t * ctx,
17011701
FD_COMPILER_MFENCE();
17021702
block_info->flags = fd_uchar_clear_bit( block_info->flags, FD_BLOCK_FLAG_REPLAYING );
17031703
memcpy( &block_info->block_hash, hdr->hash, sizeof(fd_hash_t) );
1704-
memcpy( &block_info->bank_hash, &fork->slot_ctx->slot_bank.banks_hash, sizeof(fd_hash_t) );
1704+
block_info->bank_hash = fork->slot_ctx->slot_bank.banks_hash;
17051705

17061706
fd_block_map_publish( query );
17071707
ctx->flags = EXEC_FLAG_FINISHED_SLOT;

src/discof/rpcserver/fd_rpc_service.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ fd_rpc_create_ctx(fd_rpcserver_args_t * args, fd_rpc_ctx_t ** ctx_p) {
23742374
if( bind(gctx->tpu_socket, (const struct sockaddr*)fd_type_pun_const(&addrLocal), sizeof(addrLocal)) == -1 ) {
23752375
FD_LOG_ERR(( "bind failed (%i-%s)", errno, strerror( errno ) ));
23762376
}
2377-
memcpy( &gctx->tpu_addr, &args->tpu_addr, sizeof(struct sockaddr_in) );
2377+
gctx->tpu_addr = args->tpu_addr;
23782378

23792379
} else {
23802380
gctx->tpu_socket = -1;

src/flamenco/runtime/program/fd_bpf_loader_program.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
14081408

14091409
/* copy in the authority public key into the authority address.
14101410
https://github.com/anza-xyz/agave/blob/v2.1.14/programs/bpf_loader/src/lib.rs#L926-L928 */
1411-
memcpy( account_state->inner.buffer.authority_address, new_authority, sizeof(fd_pubkey_t) );
1411+
*account_state->inner.buffer.authority_address = *new_authority;
14121412

14131413
err = fd_bpf_loader_v3_program_set_state( &account, account_state );
14141414
if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) {
@@ -1431,7 +1431,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
14311431
/* copy in the authority public key into the upgrade authority address.
14321432
https://github.com/anza-xyz/agave/blob/v2.1.14/programs/bpf_loader/src/lib.rs#L946-L949 */
14331433
if( new_authority ) {
1434-
memcpy( account_state->inner.program_data.upgrade_authority_address, new_authority, sizeof(fd_pubkey_t) );
1434+
*account_state->inner.program_data.upgrade_authority_address = *new_authority;
14351435
} else {
14361436
account_state->inner.program_data.upgrade_authority_address = NULL;
14371437
}

0 commit comments

Comments
 (0)