Skip to content

Commit

Permalink
Removed trailing whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasko committed Jul 6, 2019
1 parent 0305f77 commit 39f5b4c
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions src/common/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ get_assigned_port(const struct channel* ch)
log(LL_WARN, true, "unable to obtain address of the %s socket", ch->ch_name);
return false;
}

// Obtain the address details based on the protocol family.
if (ss.ss_family == PF_INET) {
s4 = (struct sockaddr_in*)&ss;
return s4->sin_port;
} else {
} else {
s6 = (struct sockaddr_in6*)&ss;
return s6->sin6_port;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ create_socket(struct channel* ch, const bool ipv4)
return true;
}

/// Attach the channel to a local name.
/// Attach the channel to a local name.
/// @return success/failure indication
///
/// @param[in] ch channel
Expand Down Expand Up @@ -176,7 +176,7 @@ assign_name(struct channel* ch, const uint16_t port, const bool ipv4)

/// Set the advisory socket buffer sizes.
/// @return success/failure indication
///
///
/// @param[in] ch channel
/// @param[in] rbuf receive buffer size in bytes
/// @param[in] sbuf send buffer size in bytes
Expand Down Expand Up @@ -310,7 +310,7 @@ open_channel(struct channel* ch,
/// Log all channel information.
///
/// @param[in] ch channel
void
void
log_channel(const struct channel* ch)
{
log(LL_DEBUG, false, "local UDP port: %" PRIu16, ch->ch_port);
Expand Down
4 changes: 2 additions & 2 deletions src/common/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ bool log_col; ///< Coloring policy.
/// @param[in] inp input string (NUL-terminated)
/// @param[in] cur current length of the output string
/// @param[in] max maximal length of the output string
static size_t
static size_t
append(char* out, const char* inp, const size_t cur, const size_t max)
{
size_t rem; // Remaining space.
size_t len; // Length of the input string.
size_t act; // Actual addition length.

// Early exit if the string is already full.
// Early exit if the string is already full.
if (cur == max) {
return cur;
}
Expand Down
6 changes: 3 additions & 3 deletions src/common/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ decode_payload(struct payload* dst, const struct payload* src)
// Copy the whole payload. This ensures that all single-byte fields are
// copied correctly, future-proofing the code for future field additions.
(void)memcpy(dst, src, sizeof(*src));

// Handle all multi-byte conversions into the host byte order.
dst->pl_mgic = ntohs(src->pl_mgic);
dst->pl_len = ntohs(src->pl_len);
Expand Down Expand Up @@ -141,7 +141,7 @@ retrieve_ttl(uint8_t* ttl, struct msghdr* msg)
///
/// @global wrapper
///
/// @param[in] ch channel
/// @param[in] ch channel
/// @param[in] pl payload in host byte order
/// @param[in] addr IPv4/IPv6 address
/// @param[in] err fail on error
Expand Down Expand Up @@ -302,7 +302,7 @@ receive_packet(struct channel* ch,
if (ctl == true) {
retrieve_ttl(ttl, &msg);
} else {
*ttl = 0;
*ttl = 0;
}

// Verify the payload correctness.
Expand Down
2 changes: 1 addition & 1 deletion src/common/payload.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Memory size.
#define NEMO_PAYLOAD_SIZE 104
#define NEMO_HOST_NAME_SIZE 36

// Payload.
struct payload {
uint16_t pl_mgic; ///< Magic identifier.
Expand Down
4 changes: 2 additions & 2 deletions src/ureq/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ option_m(struct config* cf, const char* in)
/// Turn off coloring and highlights in the logging output.
/// @return success/failure indication
///
/// @param[out] cf configuration
/// @param[out] cf configuration
/// @param[in] in argument input (unused)
static bool
option_n(struct config* cf, const char* in)
Expand Down Expand Up @@ -373,7 +373,7 @@ option_w(struct config* cf, const char* in)
/// @return success/failure indication
///
/// @param[out] cf configuration
static bool
static bool
set_defaults(struct config* cf)
{
intmax_t i;
Expand Down
4 changes: 2 additions & 2 deletions src/ureq/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/// single integer.
/// @return portion of IPv6 address
///
/// @param[in] ab address bytes
/// @param[in] ab address bytes
static uint64_t
ipv6_part(const uint8_t* ab)
{
Expand All @@ -53,7 +53,7 @@ ipv6_part(const uint8_t* ab)
static void
retrieve_address(uint64_t* la,
uint64_t* ha,
const struct sockaddr_storage* ss)
const struct sockaddr_storage* ss)
{
struct sockaddr_in* s4;
struct sockaddr_in6* s6;
Expand Down
2 changes: 1 addition & 1 deletion src/ureq/funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void report_header(const struct config* cf);
void report_event(const struct payload* hpl,
const char hn[static NEMO_HOST_NAME_SIZE],
const uint64_t real,
const uint64_t mono,
const uint64_t mono,
const uint8_t ttl,
const uint64_t la,
const uint64_t ha,
Expand Down
8 changes: 4 additions & 4 deletions src/ureq/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// single integer.
/// @return portion of IPv6 address
///
/// @param[in] ab address bytes
/// @param[in] ab address bytes
static uint64_t
ipv6_part(const uint8_t* ab)
{
Expand Down Expand Up @@ -147,7 +147,7 @@ resolve_name(struct target* tg,
}

/// Parse a string into a network target.
/// @return success/failure indication
/// @return success/failure indication
///
/// @param[out] tg array of targets
/// @param[out] tcnt number of targets
Expand Down Expand Up @@ -316,14 +316,14 @@ load_targets(struct target* tg,
(void)memcpy(tg + tall, tg2, (size_t)tcnt2 * sizeof(tg2[0]));
tall += tcnt2;
}

// Final normalization sweep.
normalize_targets(tg, tcnt, tcnt2);

return true;
}

/// Print all targets and their sources as debugging log entries.
/// Print all targets and their sources as debugging log entries.
///
/// @param[in] tg array of targets
/// @param[in] cnt number of targets
Expand Down
4 changes: 2 additions & 2 deletions src/ures/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ option_m(struct config* cf, const char* in)
/// Turn off coloring and highlights in the logging output.
/// @return success/failure indication
///
/// @param[out] cf configuration
/// @param[out] cf configuration
/// @param[in] in argument input (unused)
static bool
option_n(struct config* cf, const char* in)
Expand Down Expand Up @@ -290,7 +290,7 @@ option_v(struct config* cf, const char* in)
/// @return success/failure indication
///
/// @param[out] cf configuration
static bool
static bool
set_defaults(struct config* cf)
{
intmax_t i;
Expand Down
10 changes: 5 additions & 5 deletions src/ures/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// @param[in] hn local host name
/// @param[in] ttl time-to-live value
/// @param[in] cf configuration
static void
static void
update_payload(struct payload* pl,
const char hn[static NEMO_HOST_NAME_SIZE],
const uint8_t ttl,
Expand All @@ -46,7 +46,7 @@ update_payload(struct payload* pl,
/// single integer.
/// @return portion of IPv6 address
///
/// @param[in] ab address bytes
/// @param[in] ab address bytes
static uint64_t
ipv6_part(const uint8_t* ab)
{
Expand All @@ -65,12 +65,12 @@ ipv6_part(const uint8_t* ab)
///
/// @param[out] pn port number
/// @param[in] ss IPv4/IPv6 socket address
static void
static void
retrieve_port(uint16_t* pn, const struct sockaddr_storage* ss)
{
struct sockaddr_in* s4;
struct sockaddr_in6* s6;

// Cast the address to the appropriate format based on the address family.
if (ss->ss_family == AF_INET) {
s4 = (struct sockaddr_in*)ss;
Expand All @@ -89,7 +89,7 @@ retrieve_port(uint16_t* pn, const struct sockaddr_storage* ss)
static void
retrieve_address(uint64_t* la,
uint64_t* ha,
const struct sockaddr_storage* ss)
const struct sockaddr_storage* ss)
{
struct sockaddr_in* s4;
struct sockaddr_in6* s6;
Expand Down
4 changes: 2 additions & 2 deletions src/ures/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ report_event(const struct payload* pl,
"%" PRIu64 "," // real_dep_req
"%" PRIu64 "," // real_arr_res
"%" PRIu64 "," // mono_dep_req
"%" PRIu64 "\n", // mono_arr_res
"%" PRIu64 "\n", // mono_arr_res
pl->pl_key, pl->pl_snum, pl->pl_slen,
NEMO_HOST_NAME_SIZE, pl->pl_host,
addrstr, pn,
NEMO_HOST_NAME_SIZE, hn,
NEMO_HOST_NAME_SIZE, hn,
pl->pl_ttl1, ttlstr,
pl->pl_rtm1, pl->pl_rtm2,
pl->pl_mtm1, pl->pl_mtm2);
Expand Down

0 comments on commit 39f5b4c

Please sign in to comment.