From c10970dd7d7cd88f4e14743bd56f6bf010c49274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20Sp=C3=B6rlein?= Date: Sun, 23 Jan 2011 11:08:28 +0000 Subject: libkvm code janitoring - make WARNS=6 clean for archs w/o strict alignment requirments - add const, ANSIfy, remove unused vars, cast types for comparison - thanks to differing definitions of VM_MIN_ADDRESS across our archs, we need to trick the compiler to not complain about signedness. We could either fix VM_MIN_ADDRESS to always be a simple integer or make the check conditional on $ARCH. Closes PRs: kern/42386, kern/83364 Reviewed by: bde --- lib/libkvm/kvm_vnet.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/libkvm/kvm_vnet.c') diff --git a/lib/libkvm/kvm_vnet.c b/lib/libkvm/kvm_vnet.c index a5c8aad22468..12ecafc074f8 100644 --- a/lib/libkvm/kvm_vnet.c +++ b/lib/libkvm/kvm_vnet.c @@ -59,7 +59,6 @@ int _kvm_vnet_selectpid(kvm_t *kd, pid_t pid) { struct proc proc; - struct thread td; struct ucred cred; struct prison prison; struct vnet vnet; @@ -82,7 +81,12 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid) { .n_name = "proc0" }, { .n_name = NULL }, }; - uintptr_t procp, tdp, credp; + uintptr_t procp, credp; +#define VMCORE_VNET_OF_PROC0 +#ifndef VMCORE_VNET_OF_PROC0 + struct thread td; + uintptr_t tdp; +#endif lwpid_t dumptid; /* @@ -124,7 +128,6 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid) credp = 0; procp = nl[NLIST_ALLPROC].n_value; -#define VMCORE_VNET_OF_PROC0 #ifdef VMCORE_VNET_OF_PROC0 if (dumptid > 0) { procp = nl[NLIST_PROC0].n_value; -- cgit v1.2.3