diff options
-rw-r--r-- | os-posix.c | 2 | ||||
-rw-r--r-- | target-i386/cpuid.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/os-posix.c b/os-posix.c index 00133a0c76..6321e990c5 100644 --- a/os-posix.c +++ b/os-posix.c @@ -110,7 +110,7 @@ char *os_find_datadir(const char *argv0) size_t len = sizeof(buf) - 1; *buf = '\0'; - if (!sysctl(mib, sizeof(mib)/sizeof(*mib), buf, &len, NULL, 0) && + if (!sysctl(mib, ARRAY_SIZE(mib), buf, &len, NULL, 0) && *buf) { buf[sizeof(buf) - 1] = '\0'; p = buf; diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index dcfd81b7ac..dade145807 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -543,7 +543,7 @@ static int check_features_against_host(x86_def_t *guest_def) ~CPUID_EXT3_SVM, ext3_feature_name, 0x80000001}}; cpu_x86_fill_host(&host_def); - for (rv = 0, i = 0; i < sizeof (ft) / sizeof (ft[0]); ++i) + for (rv = 0, i = 0; i < ARRAY_SIZE(ft); ++i) for (mask = 1; mask; mask <<= 1) if (ft[i].check_feat & mask && *ft[i].guest_feat & mask && !(*ft[i].host_feat & mask)) { |