From 5e2c83f3951342a86abc03cfec7e8ef39604bfa1 Mon Sep 17 00:00:00 2001 From: Mingqiang Chi Date: Fri, 8 Jun 2018 15:43:50 +0800 Subject: [PATCH] hv:replace unsigned long long with uint64_t unsigned long long--> uint64_t long long --> int64_t Signed-off-by: Mingqiang Chi --- hypervisor/include/lib/sprintf.h | 2 +- hypervisor/lib/sprintf.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hypervisor/include/lib/sprintf.h b/hypervisor/include/lib/sprintf.h index b006e5d49..2e3ef976a 100644 --- a/hypervisor/include/lib/sprintf.h +++ b/hypervisor/include/lib/sprintf.h @@ -30,7 +30,7 @@ struct print_param { /* The parsed format precision. */ int precision; /* The bitmask for unsigned values. */ - unsigned long long mask; + uint64_t mask; /* A pointer to the preformated value. */ const char *value; /* The number of characters in the preformated value buffer. */ diff --git a/hypervisor/lib/sprintf.c b/hypervisor/lib/sprintf.c index b0353f48f..85764af28 100644 --- a/hypervisor/lib/sprintf.c +++ b/hypervisor/lib/sprintf.c @@ -143,7 +143,7 @@ static const char *get_flags(const char *s, int *flags) } static const char *get_length_modifier(const char *s, - int *flags, unsigned long long *mask) + int *flags, uint64_t *mask) { /* check for h[h] (char/short) */ if (*s == 'h') { @@ -258,7 +258,7 @@ static int format_number(struct print_param *param) } static int print_pow2(struct print_param *param, - unsigned long long v, uint32_t shift) + uint64_t v, uint32_t shift) { /* max buffer required for octal representation of unsigned long long */ char digitbuff[22]; @@ -269,7 +269,7 @@ static int print_pow2(struct print_param *param, /* pointer to the digits translation table */ const char *digits; /* mask to extract next character */ - unsigned long long mask; + uint64_t mask; int ret; /* calculate mask */ @@ -311,7 +311,7 @@ static int print_pow2(struct print_param *param, return ret; } -static int print_decimal(struct print_param *param, long long value) +static int print_decimal(struct print_param *param, int64_t value) { /* max. required buffer for unsigned long long in decimal format */ char digitbuff[20]; @@ -326,14 +326,14 @@ static int print_decimal(struct print_param *param, long long value) int ret; /* assume an unsigned 64 bit value */ - v.qword = ((unsigned long long)value) & param->vars.mask; + v.qword = ((uint64_t)value) & param->vars.mask; /* * assign sign and correct value if value is negative and * value must be interpreted as signed */ if (((param->vars.flags & PRINT_FLAG_UINT32) == 0) && (value < 0)) { - v.qword = (unsigned long long)-value; + v.qword = (uint64_t)-value; param->vars.prefix = "-"; param->vars.prefixlen = 1; } @@ -561,7 +561,7 @@ int do_print(const char *fmt, struct print_param *param, * (uint32_t) __builtin_va_arg(args, * void *),4); */ - res = print_pow2(param, (unsigned long long) + res = print_pow2(param, (uint64_t) __builtin_va_arg(args, void *), 4); } /* single character argument */