Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change cstdlib abs to cmath abs(float). in mingw 4.9.1 abs(in castlib… #15

Merged
merged 1 commit into from
May 26, 2015

Conversation

dushibaiyu
Copy link
Contributor

change cstdlib abs to cmath abs. in mingw 4.9.1 abs(in castlib) is erro.
funtion abs in cstdlib is : http://www.cplusplus.com/reference/cstdlib/abs/
in cmath is : http://www.cplusplus.com/reference/cmath/abs/

@Benjamin-Dobell
Copy link
Member

Could you please elaborate on the reason for the change?

Also, please don't leave commented-out code - just delete the line(s).

@dushibaiyu
Copy link
Contributor Author

in file /core/src/zxing/pdf417/detector/LinesSampler.cpp
in about line 708:
float denom = dxa * dyb - dya * dxb;
if(abs(denom) < 1e-12) // Lines don't intersect (replaces "denom == 0")
In default it use abs in cstdlib,. funtion abs in cstdlib can't handle abs(float). So , in my build (win7,mingw 4.9.1), there is a erro. I include cmath , replace abs funtion the used to abs(float) in cmath. it is ok.
the action used funtion abs in cstdlib is same to funtion abs in cmath. they are |x|。

Sorry, my english is bad.

@Benjamin-Dobell
Copy link
Member

Alright, seems reasonable. Merging...

Benjamin-Dobell added a commit that referenced this pull request May 26, 2015
change cstdlib abs to cmath abs(float). in mingw 4.9.1 abs(in castlib…
@Benjamin-Dobell Benjamin-Dobell merged commit d34acfd into glassechidna:master May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants