FreeBSD Bugzilla – Attachment 170103 Details for
Bug 209369
chinese/sunpinyin: Fix build with libc++ 3.8.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Explicitly call float versions of log, exp, etc.
chinese__sunpinyin-fix-float-1.diff (text/plain), 2.44 KB, created by
Dimitry Andric
on 2016-05-07 20:27:16 UTC
(
hide
)
Description:
Explicitly call float versions of log, exp, etc.
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2016-05-07 20:27:16 UTC
Size:
2.44 KB
patch
obsolete
>Index: chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp >=================================================================== >--- chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp (nonexistent) >+++ chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp (working copy) >@@ -0,0 +1,35 @@ >+--- src/slm/thread/slmthread.cpp.orig 2014-11-14 14:17:48 UTC >++++ src/slm/thread/slmthread.cpp >+@@ -250,10 +250,10 @@ main(int argc, char* argv[]) >+ >+ bool usingLogPr = slm.isUseLogPr(); >+ >+- #define EffectivePr(a) (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a))))) >+- #define OriginalPr(b) (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b))))) >+- #define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a)))) >+- #define OriginalBow(b) (float((usingLogPr) ? (-log((b))) : ((b)))) >++ #define EffectivePr(a) (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a))))) >++ #define OriginalPr(b) (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b))))) >++ #define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a)))) >++ #define OriginalBow(b) (float((usingLogPr) ? (-logf((b))) : ((b)))) >+ >+ printf("\nfirst pass..."); fflush(stdout); >+ for (int lvl = 0; lvl <= slm.getN(); ++lvl) { >+@@ -291,7 +291,7 @@ main(int argc, char* argv[]) >+ }; >+ >+ for (unsigned i = 0, sz = sizeof(msprs) / sizeof(float); i < sz; ++i) { >+- float real_pr = (usingLogPr) ? (-log(msprs[i])) : (msprs[i]); >++ float real_pr = (usingLogPr) ? (-logf(msprs[i])) : (msprs[i]); >+ float eff_pr = EffectivePr(real_pr); >+ if (pr_eff.find(eff_pr) == pr_eff.end()) { >+ pr_eff[eff_pr] = real_pr; >+@@ -309,7 +309,7 @@ main(int argc, char* argv[]) >+ }; >+ >+ for (unsigned i = 0, sz = sizeof(msbows) / sizeof(float); i < sz; ++i) { >+- float real_bow = (usingLogPr) ? (-log(msbows[i])) : (msbows[i]); >++ float real_bow = (usingLogPr) ? (-logf(msbows[i])) : (msbows[i]); >+ float eff_bow = EffectiveBow(real_bow); >+ if (bow_eff.find(eff_bow) == bow_eff.end()) { >+ bow_eff[eff_bow] = real_bow; > >Property changes on: chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209369
: 170103