Style fix: cast to size_t rather than u_long when comparing to sizeof()

rets.

Requested by:	kib
This commit is contained in:
Attilio Rao 2011-05-27 16:01:51 +00:00
parent d5880f9cdf
commit d361ed4b1c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/largeSMP/; revision=222363
4 changed files with 4 additions and 4 deletions

View File

@ -107,7 +107,7 @@ kgdb_thr_init(void)
addr = kgdb_lookup("stopped_cpus");
CPU_ZERO(&stopped_cpus);
cpusetsize = sysconf(_SC_CPUSET_SIZE);
if (cpusetsize != -1 && (u_long)cpusetsize <= sizeof(cpuset_t) &&
if (cpusetsize != -1 && (size_t)cpusetsize <= sizeof(cpuset_t) &&
addr != 0)
kvm_read(kvm, addr, &stopped_cpus, cpusetsize);

View File

@ -131,7 +131,7 @@ kvm_getpcpu(kvm_t *kd, int cpu)
}
kcpusetsize = sysconf(_SC_CPUSET_SIZE);
if (kcpusetsize == -1 || (u_long)kcpusetsize > sizeof(cpuset_t))
if (kcpusetsize == -1 || (size_t)kcpusetsize > sizeof(cpuset_t))
return ((void *)-1);
if (maxcpu == 0)

View File

@ -341,7 +341,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
return (-1);
}
cpusetsize = sysconf(_SC_CPUSET_SIZE);
if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) {
if (cpusetsize == -1 || (size_t)cpusetsize > sizeof(cpuset_t)) {
list->mtl_error = MEMSTAT_ERROR_KVM_NOSYMBOL;
return (-1);
}

View File

@ -148,7 +148,7 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list)
/* Determine the set of active CPUs. */
cpusetsize = sysconf(_SC_CPUSET_SIZE);
if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) {
if (cpusetsize == -1 || (size_t)cpusetsize > sizeof(cpuset_t)) {
err(EX_OSERR, "ERROR: Cannot determine which CPUs are "
"halted");
}