Small fixups to address compiler warnings etc.

This commit is contained in:
Dave Marples 2020-05-07 09:26:46 +01:00
parent 0b3c4b50fa
commit 967e38bb57
6 changed files with 11 additions and 10 deletions

View File

@ -67,7 +67,7 @@ class WishboneStreamingBridge(Module):
]
fsm = ResetInserter()(FSM(reset_state="IDLE"))
timer = WaitTimer(clk_freq//10)
timer = WaitTimer(int(clk_freq//10))
self.submodules += fsm, timer
self.comb += [
fsm.reset.eq(timer.done),

View File

@ -46,7 +46,7 @@ static inline long int labs(long int x)
return x > 0 ? x : -x;
}
unsigned long strtoul(const char *nptr, char **endptr, int base);
unsigned long strtoul(const char *nptr, char **endptr, unsigned int base);
long strtol(const char *nptr, char **endptr, int base);
double strtod(const char *str, char **endptr);

View File

@ -374,7 +374,7 @@ void *memchr(const void *s, int c, size_t n)
* @endptr: A pointer to the end of the parsed string will be placed here
* @base: The number base to use
*/
unsigned long strtoul(const char *nptr, char **endptr, int base)
unsigned long strtoul(const char *nptr, char **endptr, unsigned int base)
{
unsigned long result = 0,value;
@ -535,7 +535,7 @@ char *number(char *buf, char *end, unsigned long num, int base, int size, int pr
*/
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
{
int i;
size_t i;
i=vsnprintf(buf,size,fmt,args);
return (i >= size) ? (size - 1) : i;
@ -579,7 +579,7 @@ int snprintf(char * buf, size_t size, const char *fmt, ...)
int scnprintf(char * buf, size_t size, const char *fmt, ...)
{
va_list args;
int i;
size_t i;
va_start(args, fmt);
i = vsnprintf(buf, size, fmt, args);

View File

@ -196,15 +196,15 @@ loop:
pn = (char *) base + nmemb * size;
r = min(pa - (char *)base, pb - pa);
vecswap(base, pb - r, r);
r = min(pd - pc, pn - pd - size);
r = min(pd - pc, pn - pd - (int)size);
vecswap(pb, pn - r, r);
if ((r = pb - pa) > size)
if ((r = pb - pa) > (int)size)
{
qsort(base, r / size, size, compar);
}
if ((r = pd - pc) > size)
if ((r = pd - pc) > (int)size)
{
/* Iterate rather than recurse to save stack space */
base = pn - r;

View File

@ -107,7 +107,7 @@ double strtod(const char *str, char **endptr)
switch (*p)
{
case '-':
negative = 1; /* Fall through to increment position */
negative = 1; /* FALLTHRU */ /* to increment position */
case '+':
p++;
}
@ -166,7 +166,7 @@ double strtod(const char *str, char **endptr)
switch(*++p)
{
case '-':
negative = 1; /* Fall through to increment pos */
negative = 1; /* FALLTHRU */ /* to increment pos */
case '+':
p++;
}

View File

@ -262,6 +262,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
case 'X':
flags |= PRINTF_LARGE;
/* FALLTHRU */
case 'x':
base = 16;
break;