hv:replace unsigned long long with uint64_t

unsigned long long--> uint64_t
long long --> int64_t

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
Mingqiang Chi 2018-06-08 15:43:50 +08:00 committed by lijinxia
parent f757d49ead
commit 5e2c83f395
2 changed files with 8 additions and 8 deletions

View File

@ -30,7 +30,7 @@ struct print_param {
/* The parsed format precision. */ /* The parsed format precision. */
int precision; int precision;
/* The bitmask for unsigned values. */ /* The bitmask for unsigned values. */
unsigned long long mask; uint64_t mask;
/* A pointer to the preformated value. */ /* A pointer to the preformated value. */
const char *value; const char *value;
/* The number of characters in the preformated value buffer. */ /* The number of characters in the preformated value buffer. */

View File

@ -143,7 +143,7 @@ static const char *get_flags(const char *s, int *flags)
} }
static const char *get_length_modifier(const char *s, 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) */ /* check for h[h] (char/short) */
if (*s == 'h') { if (*s == 'h') {
@ -258,7 +258,7 @@ static int format_number(struct print_param *param)
} }
static int print_pow2(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 */ /* max buffer required for octal representation of unsigned long long */
char digitbuff[22]; char digitbuff[22];
@ -269,7 +269,7 @@ static int print_pow2(struct print_param *param,
/* pointer to the digits translation table */ /* pointer to the digits translation table */
const char *digits; const char *digits;
/* mask to extract next character */ /* mask to extract next character */
unsigned long long mask; uint64_t mask;
int ret; int ret;
/* calculate mask */ /* calculate mask */
@ -311,7 +311,7 @@ static int print_pow2(struct print_param *param,
return ret; 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 */ /* max. required buffer for unsigned long long in decimal format */
char digitbuff[20]; char digitbuff[20];
@ -326,14 +326,14 @@ static int print_decimal(struct print_param *param, long long value)
int ret; int ret;
/* assume an unsigned 64 bit value */ /* 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 * assign sign and correct value if value is negative and
* value must be interpreted as signed * value must be interpreted as signed
*/ */
if (((param->vars.flags & PRINT_FLAG_UINT32) == 0) && (value < 0)) { 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.prefix = "-";
param->vars.prefixlen = 1; param->vars.prefixlen = 1;
} }
@ -561,7 +561,7 @@ int do_print(const char *fmt, struct print_param *param,
* (uint32_t) __builtin_va_arg(args, * (uint32_t) __builtin_va_arg(args,
* void *),4); * void *),4);
*/ */
res = print_pow2(param, (unsigned long long) res = print_pow2(param, (uint64_t)
__builtin_va_arg(args, void *), 4); __builtin_va_arg(args, void *), 4);
} }
/* single character argument */ /* single character argument */