mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-30 19:11:37 +00:00
lib: vsprintf.c: replace NUM_TYPE with s64/u64 types
This fixes warnings when compiling with ELDK-5.2.1 for MIPS64: vsprintf.c: In function 'put_dec': vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default] vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default] include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *' Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
This commit is contained in:
parent
8acdae681a
commit
7b64f66c58
1 changed files with 5 additions and 6 deletions
|
@ -23,7 +23,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <div64.h>
|
#include <div64.h>
|
||||||
# define NUM_TYPE long long
|
|
||||||
#define noinline __attribute__((noinline))
|
#define noinline __attribute__((noinline))
|
||||||
|
|
||||||
/* some reluctance to put this into a new limits.h, so it is here */
|
/* some reluctance to put this into a new limits.h, so it is here */
|
||||||
|
@ -259,7 +258,7 @@ static char *put_dec_full(char *buf, unsigned q)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
/* No inlining helps gcc to use registers better */
|
/* No inlining helps gcc to use registers better */
|
||||||
static noinline char *put_dec(char *buf, unsigned NUM_TYPE num)
|
static noinline char *put_dec(char *buf, u64 num)
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
unsigned rem;
|
unsigned rem;
|
||||||
|
@ -292,7 +291,7 @@ static noinline char *put_dec(char *buf, unsigned NUM_TYPE num)
|
||||||
#define ADDCH(str, ch) (*(str)++ = (ch))
|
#define ADDCH(str, ch) (*(str)++ = (ch))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *number(char *buf, char *end, unsigned NUM_TYPE num,
|
static char *number(char *buf, char *end, u64 num,
|
||||||
int base, int size, int precision, int type)
|
int base, int size, int precision, int type)
|
||||||
{
|
{
|
||||||
/* we are called with base 8, 10 or 16, only, thus don't need "G..." */
|
/* we are called with base 8, 10 or 16, only, thus don't need "G..." */
|
||||||
|
@ -311,9 +310,9 @@ static char *number(char *buf, char *end, unsigned NUM_TYPE num,
|
||||||
type &= ~ZEROPAD;
|
type &= ~ZEROPAD;
|
||||||
sign = 0;
|
sign = 0;
|
||||||
if (type & SIGN) {
|
if (type & SIGN) {
|
||||||
if ((signed NUM_TYPE) num < 0) {
|
if ((s64) num < 0) {
|
||||||
sign = '-';
|
sign = '-';
|
||||||
num = -(signed NUM_TYPE) num;
|
num = -(s64) num;
|
||||||
size--;
|
size--;
|
||||||
} else if (type & PLUS) {
|
} else if (type & PLUS) {
|
||||||
sign = '+';
|
sign = '+';
|
||||||
|
@ -534,7 +533,7 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
|
||||||
static int vsnprintf_internal(char *buf, size_t size, const char *fmt,
|
static int vsnprintf_internal(char *buf, size_t size, const char *fmt,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
unsigned NUM_TYPE num;
|
u64 num;
|
||||||
int base;
|
int base;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue