Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
de3b5c20
by Alexei Podtelezhnikov at 2021-08-20T13:51:40-04:00
1 changed file:
Changes:
... | ... | @@ -375,12 +375,12 @@ typedef ptrdiff_t FT_PtrDist; |
375 | 375 |
|
376 | 376 |
/* These macros speed up repetitive divisions by replacing them */
|
377 | 377 |
/* with multiplications and right shifts. */
|
378 |
-#define FT_UDIVPREP( c, b ) \
|
|
379 |
- long b ## _r = c ? (long)( FT_ULONG_MAX >> PIXEL_BITS ) / ( b ) \
|
|
378 |
+#define FT_UDIVPREP( c, b ) \
|
|
379 |
+ FT_Int64 b ## _r = c ? (FT_Int64)( ~(FT_UInt64)0 >> PIXEL_BITS ) / ( b ) \
|
|
380 | 380 |
: 0
|
381 |
-#define FT_UDIV( a, b ) \
|
|
382 |
- (TCoord)( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \
|
|
383 |
- ( sizeof( long ) * FT_CHAR_BIT - PIXEL_BITS ) )
|
|
381 |
+#define FT_UDIV( a, b ) \
|
|
382 |
+ (TCoord)( ( (FT_UInt64)( a ) * (FT_UInt64)( b ## _r ) ) >> \
|
|
383 |
+ ( sizeof( FT_UInt64 ) * FT_CHAR_BIT - PIXEL_BITS ) )
|
|
384 | 384 |
|
385 | 385 |
|
386 | 386 |
/* Scale area and apply fill rule to calculate the coverage byte. */
|
... | ... | @@ -921,7 +921,7 @@ typedef ptrdiff_t FT_PtrDist; |
921 | 921 |
}
|
922 | 922 |
else /* any other line */
|
923 | 923 |
{
|
924 |
- TPos prod = dx * (TPos)fy1 - dy * (TPos)fx1;
|
|
924 |
+ FT_Int64 prod = dx * (FT_Int64)fy1 - dy * (FT_Int64)fx1;
|
|
925 | 925 |
FT_UDIVPREP( ex1 != ex2, dx );
|
926 | 926 |
FT_UDIVPREP( ey1 != ey2, dy );
|
927 | 927 |
|