From: Andrew Cooper Date: Fri, 23 Jun 2017 15:28:16 +0000 (+0100) Subject: Use unsigned int in preference to unsigned X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=91cf34a0ebf9b6fb90cbac02da4987f16faae800;p=people%2Fandrewcoop%2Fxen-test-framework.git Use unsigned int in preference to unsigned Signed-off-by: Andrew Cooper --- diff --git a/arch/x86/hvm/traps.c b/arch/x86/hvm/traps.c index 17ca66e..899b686 100644 --- a/arch/x86/hvm/traps.c +++ b/arch/x86/hvm/traps.c @@ -65,8 +65,8 @@ static env_tss tss_DF __aligned(16) = }; #endif -void pack_gate32(struct seg_gate32 *gate, unsigned type, uint32_t func, - unsigned dpl, unsigned seg) +void pack_gate32(struct seg_gate32 *gate, unsigned int type, uint32_t func, + unsigned int dpl, unsigned int seg) { gate->offset0 = func & 0xffff; gate->selector = seg; @@ -78,8 +78,8 @@ void pack_gate32(struct seg_gate32 *gate, unsigned type, uint32_t func, gate->offset1 = (func >> 16) & 0xffff; } -void pack_gate64(struct seg_gate64 *gate, unsigned type, uint64_t func, - unsigned dpl, unsigned ist, unsigned seg) +void pack_gate64(struct seg_gate64 *gate, unsigned int type, uint64_t func, + unsigned int dpl, unsigned int ist, unsigned int seg) { gate->offset0 = func & 0xffff; gate->selector = seg; diff --git a/arch/x86/include/arch/desc.h b/arch/x86/include/arch/desc.h index 0babdce..6991a68 100644 --- a/arch/x86/include/arch/desc.h +++ b/arch/x86/include/arch/desc.h @@ -66,7 +66,7 @@ struct __packed seg_gate32 { uint16_t offset0; uint16_t selector; uint8_t _r0; - unsigned type: 4, s: 1, dpl: 2, p: 1; + unsigned int type: 4, s: 1, dpl: 2, p: 1; uint16_t offset1; }; }; @@ -81,7 +81,7 @@ struct __packed seg_gate64 { struct { uint16_t offset0; uint16_t selector; - unsigned ist: 3, _r0: 5, type: 4, s: 1, dpl: 2, p: 1; + unsigned int ist: 3, _r0: 5, type: 4, s: 1, dpl: 2, p: 1; uint16_t offset1; uint32_t offset2; uint32_t _r1; diff --git a/common/libc/vsnprintf.c b/common/libc/vsnprintf.c index 1931433..a3c2acf 100644 --- a/common/libc/vsnprintf.c +++ b/common/libc/vsnprintf.c @@ -69,8 +69,8 @@ static int fmt_int(const char **fmt) return res; } -static char *number(char *str, char *end, long long val, unsigned base, - int width, int precision, unsigned flags) +static char *number(char *str, char *end, long long val, unsigned int base, + int width, int precision, unsigned int flags) { static const char lower[] = "0123456789abcdef"; static const char upper[] = "0123456789ABCDEF"; @@ -245,7 +245,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) const char *spec_start = fmt; /* For rewinding on error. */ unsigned long long num; - unsigned base, flags = 0; + unsigned int base, flags = 0; int width = -1, precision = -1; char length_mod = 'i'; diff --git a/include/xtf/hypercall.h b/include/xtf/hypercall.h index cb33fa6..63c16f3 100644 --- a/include/xtf/hypercall.h +++ b/include/xtf/hypercall.h @@ -67,7 +67,7 @@ static inline long hypercall_memory_op(unsigned int cmd, void *arg) return HYPERCALL2(long, __HYPERVISOR_memory_op, cmd, arg); } -static inline long hypercall_xen_version(unsigned cmd, void *arg) +static inline long hypercall_xen_version(unsigned int cmd, void *arg) { return HYPERCALL2(long, __HYPERVISOR_xen_version, cmd, arg); } diff --git a/tests/xsa-122/main.c b/tests/xsa-122/main.c index 39987e0..ff8a12d 100644 --- a/tests/xsa-122/main.c +++ b/tests/xsa-122/main.c @@ -30,7 +30,7 @@ const char test_title[] = "XSA-122 PoC"; */ static void check_buffer(const char *ref, const char *buf, size_t buf_sz) { - unsigned i; + unsigned int i; size_t str_len = strnlen(buf, buf_sz); if ( str_len == buf_sz )