[base] Formatting and nanooptimizations.
* src/base/ftcalc.c, * src/base/fttrigon.c: Revise sign restoration.
This commit is contained in:
parent
36a4676136
commit
7024155328
@ -1,3 +1,10 @@
|
||||
2014-12-24 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||
|
||||
[base] Formatting and nanooptimizations.
|
||||
|
||||
* src/base/ftcalc.c,
|
||||
* src/base/fttrigon.c: Revise sign restoration.
|
||||
|
||||
2014-12-13 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/pcf/pcfread.c (pcf_read_TOC): Improve fix from 2014-12-08.
|
||||
|
@ -86,8 +86,8 @@
|
||||
FT_EXPORT_DEF( FT_Fixed )
|
||||
FT_RoundFix( FT_Fixed a )
|
||||
{
|
||||
return ( a >= 0 ) ? ( a + 0x8000L ) & ~0xFFFFL
|
||||
: -((-a + 0x8000L ) & ~0xFFFFL );
|
||||
return a >= 0 ? ( a + 0x8000L ) & ~0xFFFFL
|
||||
: -((-a + 0x8000L ) & ~0xFFFFL );
|
||||
}
|
||||
|
||||
|
||||
@ -96,8 +96,8 @@
|
||||
FT_EXPORT_DEF( FT_Fixed )
|
||||
FT_CeilFix( FT_Fixed a )
|
||||
{
|
||||
return ( a >= 0 ) ? ( a + 0xFFFFL ) & ~0xFFFFL
|
||||
: -((-a + 0xFFFFL ) & ~0xFFFFL );
|
||||
return a >= 0 ? ( a + 0xFFFFL ) & ~0xFFFFL
|
||||
: -((-a + 0xFFFFL ) & ~0xFFFFL );
|
||||
}
|
||||
|
||||
|
||||
@ -106,8 +106,8 @@
|
||||
FT_EXPORT_DEF( FT_Fixed )
|
||||
FT_FloorFix( FT_Fixed a )
|
||||
{
|
||||
return ( a >= 0 ) ? a & ~0xFFFFL
|
||||
: -((-a) & ~0xFFFFL );
|
||||
return a >= 0 ? a & ~0xFFFFL
|
||||
: -((-a) & ~0xFFFFL );
|
||||
}
|
||||
|
||||
#ifndef FT_MSB
|
||||
@ -188,7 +188,7 @@
|
||||
d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
|
||||
: 0x7FFFFFFFL );
|
||||
|
||||
return ( s > 0 ) ? d : -d;
|
||||
return s < 0 ? -d : d;
|
||||
}
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@
|
||||
d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
|
||||
: 0x7FFFFFFFL );
|
||||
|
||||
return ( s > 0 ) ? d : -d;
|
||||
return s < 0 ? -d : d;
|
||||
}
|
||||
|
||||
|
||||
@ -235,7 +235,7 @@
|
||||
|
||||
c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
|
||||
|
||||
return ( s > 0 ) ? c : -c;
|
||||
return s < 0 ? -c : c;
|
||||
|
||||
#endif /* FT_MULFIX_ASSEMBLER */
|
||||
}
|
||||
@ -257,7 +257,7 @@
|
||||
q = (FT_Long)( b > 0 ? ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b
|
||||
: 0x7FFFFFFFL );
|
||||
|
||||
return ( s < 0 ? -q : q );
|
||||
return s < 0 ? -q : q;
|
||||
}
|
||||
|
||||
|
||||
@ -439,7 +439,7 @@
|
||||
: ft_div64by32( temp.hi, temp.lo, c );
|
||||
}
|
||||
|
||||
return ( s < 0 ? -a : a );
|
||||
return s < 0 ? -a : a;
|
||||
}
|
||||
|
||||
|
||||
@ -476,7 +476,7 @@
|
||||
: ft_div64by32( temp.hi, temp.lo, c );
|
||||
}
|
||||
|
||||
return ( s < 0 ? -a : a );
|
||||
return s < 0 ? -a : a;
|
||||
}
|
||||
|
||||
|
||||
@ -574,7 +574,7 @@
|
||||
( ( al * ( ub & 0xFFFFUL ) + 0x8000UL ) >> 16 );
|
||||
}
|
||||
|
||||
return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua );
|
||||
return s < 0 ? -(FT_Long)ua : (FT_Long)ua;
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
@ -621,7 +621,7 @@
|
||||
q = (FT_Long)ft_div64by32( temp.hi, temp.lo, b );
|
||||
}
|
||||
|
||||
return ( s < 0 ? -q : q );
|
||||
return s < 0 ? -q : q;
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,7 +73,7 @@
|
||||
/* and CORDIC hypotenuse, so it minimizes the error */
|
||||
val = (FT_Fixed)( ( (FT_Int64)val * FT_TRIG_SCALE + 0x40000000UL ) >> 32 );
|
||||
|
||||
return ( s >= 0 ) ? val : -val;
|
||||
return s < 0 ? -val : val;
|
||||
}
|
||||
|
||||
#else /* !FT_LONG64 */
|
||||
@ -122,7 +122,7 @@
|
||||
|
||||
val = (FT_Fixed)hi;
|
||||
|
||||
return ( s >= 0 ) ? val : -val;
|
||||
return s < 0 ? -val : val;
|
||||
}
|
||||
|
||||
#endif /* !FT_LONG64 */
|
||||
@ -480,8 +480,8 @@
|
||||
|
||||
v.x = ft_trig_downscale( v.x );
|
||||
|
||||
*length = ( shift >= 0 ) ? ( v.x >> shift )
|
||||
: (FT_Fixed)( (FT_UInt32)v.x << -shift );
|
||||
*length = shift >= 0 ? ( v.x >> shift )
|
||||
: (FT_Fixed)( (FT_UInt32)v.x << -shift );
|
||||
*angle = v.y;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user