From e8e1c163a41ce25cc91dd3d62ba29cfb6e98d4d1 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sat, 23 May 2020 15:10:42 -0400 Subject: [PATCH] Remove naming redundancy in src/frame.c --- src/frame.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/frame.c b/src/frame.c index dbcaba9..13e1ea6 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3,9 +3,9 @@ #include -static ssize_t frame_decode_station(patty_ax25_address *address, - void *data, - off_t offset) { +static ssize_t decode_station(patty_ax25_address *address, + void *data, + off_t offset) { int i, space = 0; uint8_t ssid = ((uint8_t *)data + offset)[6]; @@ -61,9 +61,9 @@ error: return -1; } -static ssize_t frame_decode_hops(patty_ax25_frame *frame, - void *data, - off_t start) { +static ssize_t decode_hops(patty_ax25_frame *frame, + void *data, + off_t start) { ssize_t decoded; off_t offset = start; @@ -74,7 +74,7 @@ static ssize_t frame_decode_hops(patty_ax25_frame *frame, * frame. */ for (i=0; irepeaters[i], data, offset)) < 0) { + if ((decoded = decode_station(&frame->repeaters[i], data, offset)) < 0) { goto error; } else { offset += decoded; @@ -105,13 +105,13 @@ error: return -1; } -static ssize_t frame_decode_address(patty_ax25_frame *frame, - void *data, - off_t start) { +static ssize_t decode_address(patty_ax25_frame *frame, + void *data, + off_t start) { off_t offset = start; ssize_t decoded; - if ((decoded = frame_decode_station(&frame->dest, data, offset)) < 0) { + if ((decoded = decode_station(&frame->dest, data, offset)) < 0) { goto error; } else { offset += decoded; @@ -121,7 +121,7 @@ static ssize_t frame_decode_address(patty_ax25_frame *frame, * It would be considered erroneous if the destination address did have the * extension bit set to 1. */ - if ((decoded = frame_decode_station(&frame->src, data, offset)) < 0) { + if ((decoded = decode_station(&frame->src, data, offset)) < 0) { goto error; } else { offset += decoded; @@ -146,7 +146,7 @@ static ssize_t frame_decode_address(patty_ax25_frame *frame, * decoding repeater addresses. */ if (!frame->src.last) { - if ((decoded = frame_decode_hops(frame, data, offset)) < 0) { + if ((decoded = decode_hops(frame, data, offset)) < 0) { goto error; } else { offset += decoded; @@ -159,9 +159,9 @@ error: return -1; } -static ssize_t frame_decode_payload(patty_ax25_frame *frame, - void *data, - off_t offset) { +static ssize_t decode_payload(patty_ax25_frame *frame, + void *data, + off_t offset) { uint8_t control = ((uint8_t *)data + offset)[0]; size_t decoded = 0; @@ -223,7 +223,7 @@ int patty_ax25_frame_decode(patty_ax25_frame *frame, void *data, size_t size) { /* * First, decode the variable-length Address field. */ - if ((decoded = frame_decode_address(frame, data, offset)) < 0) { + if ((decoded = decode_address(frame, data, offset)) < 0) { errno = EIO; goto error_decode; @@ -235,7 +235,7 @@ int patty_ax25_frame_decode(patty_ax25_frame *frame, void *data, size_t size) { * Next, decode the remaining Control Field, optional Protocol Identifier * field, and payload that may follow. */ - if ((decoded = frame_decode_payload(frame, data, offset)) < 0) { + if ((decoded = decode_payload(frame, data, offset)) < 0) { errno = EIO; goto error_decode;