tree-wide: "<n>bit" → "<n>-bit"
In some places, "<n> bits" is used when more appropriate.
This commit is contained in:
committed by
Luca Boccassi
parent
221332ee13
commit
da89046643
@@ -19,7 +19,7 @@ assert_cc(sizeof(int) == sizeof(int32_t));
|
||||
assert_cc(sizeof(unsigned) == sizeof(uint32_t));
|
||||
#define bus_property_get_unsigned ((sd_bus_property_get_t) NULL)
|
||||
|
||||
/* On 64bit machines we can use the default serializer for size_t and
|
||||
/* On 64-bit machines we can use the default serializer for size_t and
|
||||
* friends, otherwise we need to cast this manually */
|
||||
#if __SIZEOF_SIZE_T__ == 8
|
||||
#define bus_property_get_size ((sd_bus_property_get_t) NULL)
|
||||
@@ -36,7 +36,7 @@ int bus_property_get_ulong(sd_bus *bus, const char *path, const char *interface,
|
||||
#endif
|
||||
|
||||
/* uid_t and friends on Linux 32 bit. This means we can just use the
|
||||
* default serializer for 32bit unsigned, for serializing it, and map
|
||||
* default serializer for 32-bit unsigned, for serializing it, and map
|
||||
* it to NULL here */
|
||||
assert_cc(sizeof(uid_t) == sizeof(uint32_t));
|
||||
#define bus_property_get_uid ((sd_bus_property_get_t) NULL)
|
||||
|
||||
@@ -953,12 +953,12 @@ int config_parse_id128(
|
||||
|
||||
r = sd_id128_from_string(rvalue, &t);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse 128bit ID/UUID, ignoring: %s", rvalue);
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse 128-bit ID/UUID, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sd_id128_is_null(t)) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0, "128bit ID/UUID is all 0, ignoring: %s", rvalue);
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0, "128-bit ID/UUID is all 0, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -711,8 +711,8 @@ static int dissect_image(
|
||||
sd_id128_t fsuuid, vuuid;
|
||||
|
||||
/* If a root hash is supplied, then we use the root partition that has a UUID that match the
|
||||
* first 128bit of the root hash. And we use the verity partition that has a UUID that match
|
||||
* the final 128bit. */
|
||||
* first 128-bit of the root hash. And we use the verity partition that has a UUID that match
|
||||
* the final 128-bit. */
|
||||
|
||||
if (verity->root_hash_size < sizeof(sd_id128_t))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -85,12 +85,9 @@ int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags f
|
||||
((unsigned) (n[1] - '0') * 10) +
|
||||
((unsigned) (n[2] - '0'));
|
||||
|
||||
/* Don't allow anything that doesn't
|
||||
* fit in 8bit. Note that we do allow
|
||||
* control characters, as some servers
|
||||
* (e.g. cloudflare) are happy to
|
||||
* generate labels with them
|
||||
* inside. */
|
||||
/* Don't allow anything that doesn't fit in 8 bits. Note that we do allow
|
||||
* control characters, as some servers (e.g. cloudflare) are happy to
|
||||
* generate labels with them inside. */
|
||||
if (k > 255)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -297,7 +294,7 @@ int dns_label_escape_new(const char *p, size_t l, char **ret) {
|
||||
int dns_label_apply_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max) {
|
||||
_cleanup_free_ uint32_t *input = NULL;
|
||||
size_t input_size, l;
|
||||
bool contains_8bit = false;
|
||||
bool contains_8_bit = false;
|
||||
char buffer[DNS_LABEL_MAX+1];
|
||||
int r;
|
||||
|
||||
@@ -315,9 +312,9 @@ int dns_label_apply_idna(const char *encoded, size_t encoded_size, char *decoded
|
||||
|
||||
for (const char *p = encoded; p < encoded + encoded_size; p++)
|
||||
if ((uint8_t) *p > 127)
|
||||
contains_8bit = true;
|
||||
contains_8_bit = true;
|
||||
|
||||
if (!contains_8bit) {
|
||||
if (!contains_8_bit) {
|
||||
if (encoded_size > DNS_LABEL_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* interface with this. */
|
||||
|
||||
typedef union JsonValue {
|
||||
/* Encodes a simple value. This structure is generally 8 bytes wide (as double is 64bit). */
|
||||
/* Encodes a simple value. This structure is generally 8 bytes wide (as double is 64-bit). */
|
||||
bool boolean;
|
||||
double real;
|
||||
int64_t integer;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
In case you wonder why we have our own JSON implementation, here are a couple of reasons why this implementation has
|
||||
benefits over various other implementations:
|
||||
|
||||
- We need support for 64bit signed and unsigned integers, i.e. the full 64,5bit range of -9223372036854775808…18446744073709551615
|
||||
- We need support for 64-bit signed and unsigned integers, i.e. the full 64,5bit range of -9223372036854775808…18446744073709551615
|
||||
- All our variants are immutable after creation
|
||||
- Special values such as true, false, zero, null, empty strings, empty array, empty objects require zero dynamic memory
|
||||
- Progressive parsing
|
||||
|
||||
@@ -3972,7 +3972,7 @@ union bpf_attr {
|
||||
*
|
||||
* u64 bpf_jiffies64(void)
|
||||
* Description
|
||||
* Obtain the 64bit jiffies
|
||||
* Obtain the 64-bit jiffies
|
||||
* Return
|
||||
* The 64 bit jiffies
|
||||
*
|
||||
|
||||
@@ -1093,7 +1093,7 @@ struct ethtool_rx_flow_spec {
|
||||
/* How rings are laid out when accessing virtual functions or
|
||||
* offloaded queues is device specific. To allow users to do flow
|
||||
* steering and specify these queues the ring cookie is partitioned
|
||||
* into a 32bit queue index with an 8 bit virtual function id.
|
||||
* into a 32-bit queue index with an 8 bit virtual function id.
|
||||
* This also leaves the 3bytes for further specifiers. It is possible
|
||||
* future devices may support more than 256 virtual functions if
|
||||
* devices start supporting PCIe w/ARI. However at the moment I
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Wrapper around the QCMD() macro of linux/quota.h that removes some undefined behaviour. A typical quota
|
||||
* command such as QCMD(Q_GETQUOTA, USRQUOTA) cannot be resolved on platforms where "int" is 32bit, as it is
|
||||
* command such as QCMD(Q_GETQUOTA, USRQUOTA) cannot be resolved on platforms where "int" is 32-bit, as it is
|
||||
* larger than INT_MAX. Yikes, because that are basically all platforms Linux supports. Let's add a wrapper
|
||||
* that explicitly takes its arguments as unsigned 32bit, and then converts the shift result explicitly to
|
||||
* that explicitly takes its arguments as unsigned 32-bit, and then converts the shift result explicitly to
|
||||
* int, acknowledging the undefined behaviour of the kernel headers. This doesn't remove the undefined
|
||||
* behaviour, but it stops ubsan from complaining about it. */
|
||||
static inline int QCMD_FIXED(uint32_t cmd, uint32_t type) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* to write our own implementation relatively easily. However, the main reasons are these:
|
||||
*
|
||||
* • We want to use our own JSON subsystem, with all the benefits that brings (i.e. accurate unsigned+signed
|
||||
* 64bit integers, full fuzzing, logging during parsing and so on). If we'd want to use that with
|
||||
* 64-bit integers, full fuzzing, logging during parsing and so on). If we'd want to use that with
|
||||
* libvarlink we'd have to serialize and deserialize all the time from its own representation which is
|
||||
* inefficient and nasty.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user