Skip to content
Snippets Groups Projects
Commit 9620cf77 authored by Ralph Giles's avatar Ralph Giles
Browse files

Print the actual arguments to the debug UADD/SUB32 routines.

The versions of UADD32 and USUB32 in fixed_debug.h take
unsigned long long (ideally 64 bit) inputs, and range
check the arguments. However, the printed warnings cast
them to (unsigned), which is confusing. Instead, print
the full value passed in.

NB this will make negative values print has huge,
rather than negative, values.
parent 9f7d17bd
No related branches found
No related tags found
No related merge requests found
......@@ -251,12 +251,12 @@ static inline unsigned int UADD32_(unsigned long long a, unsigned long long b, c
unsigned long long res;
if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
{
fprintf (stderr, "UADD32: inputs are not int: %u %u in %s: line %d\n", (unsigned)a, (unsigned)b, file, line);
fprintf (stderr, "UADD32: inputs are not uint32: %llu %llu in %s: line %d\n", a, b, file, line);
}
res = a+b;
if (!VERIFY_UINT(res))
{
fprintf (stderr, "UADD32: output is not int: %u in %s: line %d\n", (unsigned)res, file, line);
fprintf (stderr, "UADD32: output is not uint32: %llu in %s: line %d\n", res, file, line);
}
celt_mips+=2;
return res;
......@@ -269,12 +269,12 @@ static inline unsigned int USUB32_(unsigned long long a, unsigned long long b, c
unsigned long long res;
if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
{
fprintf (stderr, "USUB32: inputs are not int: %llu %llu in %s: line %d\n", (unsigned)a, (unsigned)b, file, line);
fprintf (stderr, "USUB32: inputs are not uint32: %llu %llu in %s: line %d\n", a, b, file, line);
}
res = a-b;
if (!VERIFY_UINT(res))
{
fprintf (stderr, "USUB32: output is not int: %llu - %llu = %llu in %s: line %d\n", a, b, res, file, line);
fprintf (stderr, "USUB32: output is not uint32: %llu - %llu = %llu in %s: line %d\n", a, b, res, file, line);
}
celt_mips+=2;
return res;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment