Merge pull request #9261 from keszybz/drop-bool-casts

Drop bool casts
This commit is contained in:
Lennart Poettering
2018-06-13 16:19:24 +02:00
committed by GitHub
21 changed files with 70 additions and 31 deletions
+1 -1
View File
@@ -500,7 +500,7 @@ int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *ret) {
(usec_t) le32toh(ri->otime.nsec) / NSEC_PER_USEC;
ret->subvol_id = subvol_id;
ret->read_only = !!(le64toh(ri->flags) & BTRFS_ROOT_SUBVOL_RDONLY);
ret->read_only = le64toh(ri->flags) & BTRFS_ROOT_SUBVOL_RDONLY;
assert_cc(sizeof(ri->uuid) == sizeof(ret->uuid));
memcpy(&ret->uuid, ri->uuid, sizeof(ret->uuid));
+1 -1
View File
@@ -572,7 +572,7 @@ int table_add_many_internal(Table *t, TableDataType first_type, ...) {
break;
case TABLE_BOOLEAN:
buffer.b = !!va_arg(ap, int);
buffer.b = va_arg(ap, int);
data = &buffer.b;
break;
+1 -1
View File
@@ -662,7 +662,7 @@ int parse_permille_unbounded(const char *p) {
r = safe_atoi(n, &v);
if (r < 0)
return r;
if (v > ((INT_MAX - q) / 10))
if (v > (INT_MAX - q) / 10)
return -ERANGE;
v = v * 10 + q;
+1 -1
View File
@@ -81,7 +81,7 @@ int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) {
if (name)
found = streq(name, verbs[i].verb);
else
found = !!(verbs[i].flags & VERB_DEFAULT);
found = verbs[i].flags & VERB_DEFAULT;
if (found) {
verb = &verbs[i];
+1 -1
View File
@@ -56,7 +56,7 @@ static int detect_vm_cpuid(void) {
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) == 0)
return VIRTUALIZATION_NONE;
hypervisor = !!(ecx & 0x80000000U);
hypervisor = ecx & 0x80000000U;
if (hypervisor) {
union {