When reading the source code file src/libcrun/cgroup-systemd.c I noticed the use of (uint64_t) strtoll
$ git grep "(uint64_t) strtoll " remotes/origin/main
remotes/origin/main:src/libcrun/cgroup-systemd.c: *value = (uint64_t) strtoll (resources->unified->values[i], &endptr, 10);
remotes/origin/main:src/libcrun/cgroup-systemd.c: *value = (uint64_t) strtoll (str, &endptr, 10);
|
*value = (uint64_t) strtoll (resources->unified->values[i], &endptr, 10); |
|
*value = (uint64_t) strtoll (str, &endptr, 10); |
I'm a bit lost here. There is also another function strtoull() that could be used without needing to cast.
Why is not strtoull() used instead?
I see that strtoull() is used in a few places already
$ git grep strtoull remotes/origin/main | wc -l
4
I'll plan to also ask an AI, to see if I can figure this mystery out by myself. If so, I'll close this issue.
When reading the source code file src/libcrun/cgroup-systemd.c I noticed the use of
(uint64_t) strtollcrun/src/libcrun/cgroup-systemd.c
Line 822 in 46cedc0
crun/src/libcrun/cgroup-systemd.c
Line 932 in 46cedc0
I'm a bit lost here. There is also another function
strtoull()that could be used without needing to cast.Why is not
strtoull()used instead?I see that
strtoull()is used in a few places alreadyI'll plan to also ask an AI, to see if I can figure this mystery out by myself. If so, I'll close this issue.