Merge pull request #18852 from yuwata/tree-wide-use-UINT64_MAX
tree-wide: use UINT64_MAX or friends
This commit is contained in:
@@ -27,7 +27,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
assert_se(stdout_stream_install(&s, stream_fds[0], &stream) >= 0);
|
||||
assert_se(write(stream_fds[1], data, size) == (ssize_t) size);
|
||||
while (ioctl(stream_fds[0], SIOCINQ, &v) == 0 && v)
|
||||
sd_event_run(s.event, (uint64_t) -1);
|
||||
sd_event_run(s.event, UINT64_MAX);
|
||||
if (s.n_stdout_streams)
|
||||
stdout_stream_destroy(stream);
|
||||
server_done(&s);
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
static size_t cache_max(void) {
|
||||
static size_t cached = -1;
|
||||
|
||||
if (cached == (size_t) -1) {
|
||||
if (cached == SIZE_MAX) {
|
||||
uint64_t mem_total;
|
||||
int r;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static int server_process_entry(
|
||||
*
|
||||
* Note that *remaining is altered on both success and failure. */
|
||||
|
||||
size_t n = 0, j, tn = (size_t) -1, m = 0, entry_size = 0;
|
||||
size_t n = 0, j, tn = SIZE_MAX, m = 0, entry_size = 0;
|
||||
char *identifier = NULL, *message = NULL;
|
||||
struct iovec *iovec = NULL;
|
||||
int priority = LOG_INFO;
|
||||
|
||||
@@ -144,7 +144,7 @@ static int cache_space_refresh(Server *s, JournalStorage *storage) {
|
||||
|
||||
ts = now(CLOCK_MONOTONIC);
|
||||
|
||||
if (space->timestamp != 0 && space->timestamp + RECHECK_SPACE_USEC > ts)
|
||||
if (space->timestamp != 0 && usec_add(space->timestamp, RECHECK_SPACE_USEC) > ts)
|
||||
return 0;
|
||||
|
||||
r = determine_path_usage(s, storage->path, &vfs_used, &vfs_avail);
|
||||
@@ -1206,7 +1206,7 @@ finish:
|
||||
server_driver_message(s, 0, NULL,
|
||||
LOG_MESSAGE("Time spent on flushing to %s is %s for %u entries.",
|
||||
s->system_storage.path,
|
||||
format_timespan(ts, sizeof(ts), now(CLOCK_MONOTONIC) - start, 0),
|
||||
format_timespan(ts, sizeof(ts), usec_sub_unsigned(now(CLOCK_MONOTONIC), start), 0),
|
||||
n),
|
||||
NULL);
|
||||
|
||||
@@ -2187,7 +2187,7 @@ int server_init(Server *s, const char *namespace) {
|
||||
.notify_fd = -1,
|
||||
|
||||
.compress.enabled = true,
|
||||
.compress.threshold_bytes = (uint64_t) -1,
|
||||
.compress.threshold_bytes = UINT64_MAX,
|
||||
.seal = true,
|
||||
|
||||
.set_audit = true,
|
||||
@@ -2595,7 +2595,7 @@ int config_parse_compress(
|
||||
|
||||
if (isempty(rvalue)) {
|
||||
compress->enabled = true;
|
||||
compress->threshold_bytes = (uint64_t) -1;
|
||||
compress->threshold_bytes = UINT64_MAX;
|
||||
} else if (streq(rvalue, "1")) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||
"Compress= ambiguously specified as 1, enabling compression with default threshold");
|
||||
|
||||
@@ -43,7 +43,7 @@ static void test_config_compress(void) {
|
||||
/* Invalid Case */
|
||||
COMPRESS_PARSE_CHECK("-1", true, 111);
|
||||
COMPRESS_PARSE_CHECK("blah blah", true, 111);
|
||||
COMPRESS_PARSE_CHECK("", true, (uint64_t)-1);
|
||||
COMPRESS_PARSE_CHECK("", true, UINT64_MAX);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
Reference in New Issue
Block a user