Skip to content

Commit

Permalink
acarsmsg_t: remove unneeded member
Browse files Browse the repository at this point in the history
'msn_seq' is only used once locally in outputmsg()
  • Loading branch information
f00b4r0 committed Aug 31, 2024
1 parent eb2cb90 commit d6b48ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion acarsdec.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ typedef struct {
float lvl;
#ifdef HAVE_LIBACARS
char msn[4];
char msn_seq;
la_proto_node *decoded_tree;
la_reasm_status reasm_status;
#endif
Expand Down
5 changes: 3 additions & 2 deletions output.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ void outputmsg(const msgblk_t *blk)

bool down = IS_DOWNLINK_BLK(msg.bid);
#ifdef HAVE_LIBACARS
char msn_seq;
la_msg_dir msg_dir = down ? LA_MSG_DIR_AIR2GND : LA_MSG_DIR_GND2AIR;
msg.reasm_status = LA_REASM_SKIPPED; // default value (valid for message with empty text)
#endif
Expand Down Expand Up @@ -788,7 +789,7 @@ void outputmsg(const msgblk_t *blk)
/* to store the MSN separately as prefix and seq character. */
for (i = 0; i < sizeof(msg.msn)-1; i++)
msg.msn[i] = msg.no[i];
msg.msn_seq = msg.no[3];
msn_seq = msg.no[3];
#endif
i = sizeof(msg.fid) - 1;
if (text_len < i)
Expand Down Expand Up @@ -836,7 +837,7 @@ void outputmsg(const msgblk_t *blk)
.msg_data = (uint8_t *)msg.txt,
.msg_data_len = text_len,
.total_pdu_len = 0, // not used
.seq_num = down ? msg.msn_seq - 'A' : msg.bid - 'A',
.seq_num = down ? msn_seq - 'A' : msg.bid - 'A',
.seq_num_first = down ? 0 : SEQ_FIRST_NONE,
.seq_num_wrap = seq_num_wrap,
.is_final_fragment = msg.be != 0x17, // ETB means "more fragments"
Expand Down

0 comments on commit d6b48ae

Please sign in to comment.