Merge pull request #18852 from yuwata/tree-wide-use-UINT64_MAX
tree-wide: use UINT64_MAX or friends
This commit is contained in:
@@ -41,7 +41,7 @@ static void fuzz_client(const uint8_t *data, size_t size, bool is_information_re
|
||||
|
||||
assert_se(write(test_dhcp_fd[1], data, size) == (ssize_t) size);
|
||||
|
||||
sd_event_run(e, (uint64_t) -1);
|
||||
sd_event_run(e, UINT64_MAX);
|
||||
|
||||
assert_se(sd_dhcp6_client_stop(client) >= 0);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
assert_se(sd_ndisc_set_mac(nd, &mac_addr) >= 0);
|
||||
assert_se(sd_ndisc_start(nd) >= 0);
|
||||
assert_se(write(test_fd[1], data, size) == (ssize_t) size);
|
||||
(void) sd_event_run(e, (uint64_t) -1);
|
||||
(void) sd_event_run(e, UINT64_MAX);
|
||||
assert_se(sd_ndisc_stop(nd) >= 0);
|
||||
close(test_fd[1]);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ int lldp_network_bind_raw_socket(int ifindex) {
|
||||
BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(struct ethhdr, h_proto)), /* A <- protocol */
|
||||
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_LLDP, 1, 0), /* A != ETHERTYPE_LLDP */
|
||||
BPF_STMT(BPF_RET + BPF_K, 0), /* drop packet */
|
||||
BPF_STMT(BPF_RET + BPF_K, (uint32_t) -1), /* accept packet */
|
||||
BPF_STMT(BPF_RET + BPF_K, UINT32_MAX), /* accept packet */
|
||||
};
|
||||
|
||||
static const struct sock_fprog fprog = {
|
||||
|
||||
@@ -2229,7 +2229,7 @@ int sd_dhcp_client_new(sd_dhcp_client **ret, int anonymize) {
|
||||
.mtu = DHCP_DEFAULT_MIN_SIZE,
|
||||
.port = DHCP_PORT_CLIENT,
|
||||
.anonymize = !!anonymize,
|
||||
.max_attempts = (uint64_t) -1,
|
||||
.max_attempts = UINT64_MAX,
|
||||
.ip_service_type = -1,
|
||||
};
|
||||
/* NOTE: this could be moved to a function. */
|
||||
|
||||
@@ -1257,13 +1257,13 @@ int dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
|
||||
}
|
||||
|
||||
if (client_id_hex) {
|
||||
r = unhexmem(client_id_hex, (size_t) -1, &lease->client_id, &lease->client_id_len);
|
||||
r = unhexmem(client_id_hex, SIZE_MAX, &lease->client_id, &lease->client_id_len);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to parse client ID %s, ignoring: %m", client_id_hex);
|
||||
}
|
||||
|
||||
if (vendor_specific_hex) {
|
||||
r = unhexmem(vendor_specific_hex, (size_t) -1, &lease->vendor_specific, &lease->vendor_specific_len);
|
||||
r = unhexmem(vendor_specific_hex, SIZE_MAX, &lease->vendor_specific, &lease->vendor_specific_len);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to parse vendor specific data %s, ignoring: %m", vendor_specific_hex);
|
||||
}
|
||||
@@ -1275,7 +1275,7 @@ int dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
|
||||
if (!options[i])
|
||||
continue;
|
||||
|
||||
r = unhexmem(options[i], (size_t) -1, &data, &len);
|
||||
r = unhexmem(options[i], SIZE_MAX, &data, &len);
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed to parse private DHCP option %s, ignoring: %m", options[i]);
|
||||
continue;
|
||||
|
||||
@@ -373,7 +373,7 @@ _public_ int sd_lldp_new(sd_lldp **ret) {
|
||||
.n_ref = 1,
|
||||
.fd = -1,
|
||||
.neighbors_max = LLDP_DEFAULT_NEIGHBORS_MAX,
|
||||
.capability_mask = (uint16_t) -1,
|
||||
.capability_mask = UINT16_MAX,
|
||||
};
|
||||
|
||||
lldp->neighbor_by_id = hashmap_new(&lldp_neighbor_hash_ops);
|
||||
|
||||
@@ -308,7 +308,7 @@ static void test_discover_message(sd_event *e) {
|
||||
|
||||
assert_se(IN_SET(res, 0, -EINPROGRESS));
|
||||
|
||||
sd_event_run(e, (uint64_t) -1);
|
||||
sd_event_run(e, UINT64_MAX);
|
||||
|
||||
sd_dhcp_client_stop(client);
|
||||
sd_dhcp_client_unref(client);
|
||||
|
||||
@@ -160,25 +160,25 @@ static void test_basic_request(sd_event *e) {
|
||||
assert_se(sd_ipv4ll_set_ifindex(ll, 1) == 0);
|
||||
assert_se(sd_ipv4ll_start(ll) == 1);
|
||||
|
||||
sd_event_run(e, (uint64_t) -1);
|
||||
sd_event_run(e, UINT64_MAX);
|
||||
assert_se(sd_ipv4ll_start(ll) == 0);
|
||||
|
||||
assert_se(sd_ipv4ll_is_running(ll));
|
||||
|
||||
/* PROBE */
|
||||
sd_event_run(e, (uint64_t) -1);
|
||||
sd_event_run(e, UINT64_MAX);
|
||||
assert_se(recv(test_fd[1], &arp, sizeof(struct ether_arp), 0) == sizeof(struct ether_arp));
|
||||
|
||||
if (extended) {
|
||||
/* PROBE */
|
||||
sd_event_run(e, (uint64_t) -1);
|
||||
sd_event_run(e, UINT64_MAX);
|
||||
assert_se(recv(test_fd[1], &arp, sizeof(struct ether_arp), 0) == sizeof(struct ether_arp));
|
||||
|
||||
/* PROBE */
|
||||
sd_event_run(e, (uint64_t) -1);
|
||||
sd_event_run(e, UINT64_MAX);
|
||||
assert_se(recv(test_fd[1], &arp, sizeof(struct ether_arp), 0) == sizeof(struct ether_arp));
|
||||
|
||||
sd_event_run(e, (uint64_t) -1);
|
||||
sd_event_run(e, UINT64_MAX);
|
||||
assert_se(basic_request_handler_bind == 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user