mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Make comment style consistent.
Majority of code base does not use C90-style // end of line comments. This formats the few existing exceptions using /* */ for consistency.
This commit is contained in:
committed by
Simon Kelley
parent
1a33eec0ba
commit
06d01f7ae4
@@ -76,9 +76,9 @@ unsigned char *hash_questions(struct dns_header *header, size_t plen, char *name
|
||||
|
||||
#else /* HAVE_DNSSEC || HAVE_CRYPTOHASH */
|
||||
|
||||
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
|
||||
typedef unsigned char BYTE; // 8-bit byte
|
||||
typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines
|
||||
#define SHA256_BLOCK_SIZE 32 /* SHA256 outputs a 32 byte digest */
|
||||
typedef unsigned char BYTE; /* 8-bit byte */
|
||||
typedef unsigned int WORD; /* 32-bit word, change to "long" for 16-bit machines */
|
||||
|
||||
typedef struct {
|
||||
BYTE data[64];
|
||||
@@ -238,7 +238,7 @@ static void sha256_final(SHA256_CTX *ctx, BYTE hash[])
|
||||
|
||||
i = ctx->datalen;
|
||||
|
||||
// Pad whatever data is left in the buffer.
|
||||
/* Pad whatever data is left in the buffer. */
|
||||
if (ctx->datalen < 56)
|
||||
{
|
||||
ctx->data[i++] = 0x80;
|
||||
@@ -254,7 +254,7 @@ static void sha256_final(SHA256_CTX *ctx, BYTE hash[])
|
||||
memset(ctx->data, 0, 56);
|
||||
}
|
||||
|
||||
// Append to the padding the total message's length in bits and transform.
|
||||
/* Append to the padding the total message's length in bits and transform. */
|
||||
ctx->bitlen += ctx->datalen * 8;
|
||||
ctx->data[63] = ctx->bitlen;
|
||||
ctx->data[62] = ctx->bitlen >> 8;
|
||||
@@ -266,8 +266,8 @@ static void sha256_final(SHA256_CTX *ctx, BYTE hash[])
|
||||
ctx->data[56] = ctx->bitlen >> 56;
|
||||
sha256_transform(ctx, ctx->data);
|
||||
|
||||
// Since this implementation uses little endian byte ordering and SHA uses big endian,
|
||||
// reverse all the bytes when copying the final state to the output hash.
|
||||
/* Since this implementation uses little endian byte ordering and SHA uses big endian,
|
||||
reverse all the bytes when copying the final state to the output hash. */
|
||||
for (i = 0; i < 4; ++i)
|
||||
{
|
||||
hash[i] = (ctx->state[0] >> (24 - i * 8)) & 0x000000ff;
|
||||
|
||||
@@ -66,8 +66,8 @@ static int is_string_matching_glob_pattern(
|
||||
pattern_character -= 'a' - 'A';
|
||||
if (pattern_character == '*')
|
||||
{
|
||||
// zero-or-more-character wildcard
|
||||
// Try to match at value_index, otherwise restart at value_index + 1 next.
|
||||
/* zero-or-more-character wildcard */
|
||||
/* Try to match at value_index, otherwise restart at value_index + 1 next. */
|
||||
next_pattern_index = pattern_index;
|
||||
pattern_index++;
|
||||
if (value_index < num_value_bytes)
|
||||
@@ -78,7 +78,7 @@ static int is_string_matching_glob_pattern(
|
||||
}
|
||||
else
|
||||
{
|
||||
// ordinary character
|
||||
/* ordinary character */
|
||||
if (value_index < num_value_bytes)
|
||||
{
|
||||
char value_character = value[value_index];
|
||||
@@ -249,7 +249,7 @@ int is_valid_dns_name_pattern(const char *value)
|
||||
for (const char *c = value;; c++)
|
||||
{
|
||||
if (*c &&
|
||||
*c != '*' && // Wildcard.
|
||||
*c != '*' && /* Wildcard. */
|
||||
*c != '-' && *c != '.' &&
|
||||
(*c < '0' || *c > '9') &&
|
||||
(*c < 'A' || *c > 'Z') &&
|
||||
|
||||
@@ -84,7 +84,7 @@ static void ubus_destroy(struct ubus_context *ubus)
|
||||
ubus_free(ubus);
|
||||
daemon->ubus = NULL;
|
||||
|
||||
// Forces re-initialization when we're reusing the same definitions later on.
|
||||
/* Forces re-initialization when we're reusing the same definitions later on. */
|
||||
ubus_object.id = 0;
|
||||
ubus_object_type.id = 0;
|
||||
}
|
||||
@@ -376,7 +376,7 @@ void ubus_event_bcast_connmark_allowlist_resolved(u32 mark, const char *name, co
|
||||
CHECK(blobmsg_add_string(&b, "value", value));
|
||||
CHECK(blobmsg_add_u32(&b, "ttl", ttl));
|
||||
|
||||
// Set timeout to allow UBus subscriber to configure firewall rules before returning.
|
||||
/* Set timeout to allow UBus subscriber to configure firewall rules before returning. */
|
||||
CHECK(ubus_notify(ubus, &ubus_object, "connmark-allowlist.resolved", b.head, /* timeout: */ 1000));
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user