Page MenuHomePhabricator

freetype: Prevent lose of data when fixed point divide calculation.
ClosedPublic

Authored by jsuya on Sep 3 2019, 3:03 AM.

Details

Summary

In environments that long is 4byte, fixed-point division calculations will cause data loss.
fixed-point division need to more space.
Therefore, change all long types to long long types.

Test Plan

N/A

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jsuya created this revision.Sep 3 2019, 3:03 AM
jsuya requested review of this revision.Sep 3 2019, 3:03 AM
jsuya planned changes to this revision.Sep 3 2019, 3:12 AM
jsuya updated this revision to Diff 24699.Sep 3 2019, 4:16 AM

Update code

jsuya updated this revision to Diff 24700.Sep 3 2019, 4:22 AM

update code

jsuya updated this revision to Diff 24701.Sep 3 2019, 4:25 AM

update comment

jsuya updated this revision to Diff 24702.Sep 3 2019, 4:27 AM
jsuya edited the summary of this revision. (Show Details)

update commit message

vtorri added a subscriber: vtorri.Sep 3 2019, 4:29 AM

I just want to mention that long is a 32 bits type on Windows 64 bits, so you must pay attention at what is done on this platform when using long

jsuya updated this revision to Diff 24704.Sep 3 2019, 5:53 AM

Fix wrong type(unsigned long long-> long long)

jsuya updated this revision to Diff 24705.Sep 3 2019, 5:54 AM
jsuya retitled this revision from freetype: Prevent lose of data when type casting on 32bit machine to freetype: Prevent lose of data when fixed point divide calculation..
jsuya edited the summary of this revision. (Show Details)

Fix commit message

jsuya added a comment.Sep 3 2019, 5:54 AM

@vtorri
Thank you for your metion.
I modified the commit message and the code.

Hermet accepted this revision.Sep 3 2019, 8:06 PM
This revision is now accepted and ready to land.Sep 3 2019, 8:06 PM
This revision was automatically updated to reflect the committed changes.