Skip to content

Commit

Permalink
Fix some warnings:
Browse files Browse the repository at this point in the history
float.c: abs of unsigned has no effect.
sr.h: TARCE format for debug builds wrong.
  • Loading branch information
Fish-Git committed May 28, 2016
1 parent 4e44069 commit 4034f45
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 11 additions & 7 deletions float.c
Expand Up @@ -2461,7 +2461,7 @@ int i;
/*-------------------------------------------------------------------*/
/* Square root of fraction */
/* This routine uses the Newton-Iteration-Method */
/* The iteration is startet with a table look up */
/* The iteration is started with a table look up */
/* */
/* Input: */
/* a short fraction expanded to U64 */
Expand Down Expand Up @@ -2740,10 +2740,12 @@ static const unsigned short sqtab[] = {
/* exit iteration when xi, xj equal or differ by 1 */
for (;;) {
xj = (((U32)(a / xi)) + xi) >> 1;

if ((xj == xi) || (abs(xj - xi) == 1)) {
if (0
|| xj == xi
|| xj == (xi+1)
|| xj == (xi-1)
)
break;
}
xi = xj;
}

Expand Down Expand Up @@ -5118,10 +5120,12 @@ U64 msj, lsj;
/* done iteration when xi, xj equal or differ by 1 */
for (;;) {
xj = (div_U128(mmsa, msa, xi) + xi) >> 1;

if ((xj == xi) || (abs(xj - xi) == 1)) {
if (0
|| xj == xi
|| xj == (xi+1)
|| xj == (xi-1)
)
break;
}
xi = xj;
}

Expand Down
8 changes: 4 additions & 4 deletions sr.h
Expand Up @@ -597,7 +597,7 @@ BYTE* buf = p;
if (sr_write_hdr(file, key, len) != 0)
return -1;

TRACE("SR: sr_write_buf: key=0x%8.8x, len=0x%16.16llx\n", key, len);
TRACE("SR: sr_write_buf: key=0x%8.8x, len=0x%16.16"PRIx64"\n", key, len);

while (tot)
{
Expand All @@ -622,7 +622,7 @@ static INLINE int sr_write_value (FILE* file, U32 key, U64 val, U32 len)
{
BYTE buf[8];

TRACE("SR: sr_write_value: key=0x%8.8x, len=0x%8.8x, val=0x%16.16llx\n", key, len, val);
TRACE("SR: sr_write_value: key=0x%8.8x, len=0x%8.8x, val=0x%16.16"PRIx64"\n", key, len, val);

if (len != 1 && len != 2 && len != 4 && len != 8)
{
Expand Down Expand Up @@ -729,7 +729,7 @@ U32 siz;
U64 tot = len;
BYTE* buf = p;

TRACE("SR: sr_read_buf: len=0x%16.16llx\n", len);
TRACE("SR: sr_read_buf: len=0x%16.16"PRIx64"\n", len);

while (tot)
{
Expand Down Expand Up @@ -778,7 +778,7 @@ U64 value;
default: value = 0; break; /* To ward off gcc -Wall */
}

TRACE(" val=0x%16.16llx\n", value);
TRACE(" val=0x%16.16"PRIx64"\n", value);

switch (reslen)
{
Expand Down

0 comments on commit 4034f45

Please sign in to comment.