Coder Social home page Coder Social logo

gl-matrix.c's People

Contributors

coreh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gl-matrix.c's Issues

Fails to compile on Mac

make
cc -c vec3.c -Wall -Werror -pedantic-errors -std=c99 -o vec3.o
cc -c mat3.c -Wall -Werror -pedantic-errors -std=c99 -o mat3.o
cc -c mat4.c -Wall -Werror -pedantic-errors -std=c99 -o mat4.o
cc -c quat.c -Wall -Werror -pedantic-errors -std=c99 -o quat.o
quat.c:32:25: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
        quat[3] = -sqrt(abs(1.0 - x * x - y * y - z * z));
                        ^
quat.c:32:25: note: use function 'fabs' instead
        quat[3] = -sqrt(abs(1.0 - x * x - y * y - z * z));
                        ^~~
                        fabs
quat.c:38:21: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
    dest[3] = -sqrt(abs(1.0 - x * x - y * y - z * z));
                    ^
quat.c:38:21: note: use function 'fabs' instead
    dest[3] = -sqrt(abs(1.0 - x * x - y * y - z * z));
                    ^~~
                    fabs
quat.c:220:9: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
    if (abs(cosHalfTheta) >= 1.0) {
        ^
quat.c:220:9: note: use function 'fabs' instead
    if (abs(cosHalfTheta) >= 1.0) {
        ^~~
        fabs
quat.c:233:9: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
    if (abs(sinHalfTheta) < 0.001) {
        ^
quat.c:233:9: note: use function 'fabs' instead
    if (abs(sinHalfTheta) < 0.001) {
        ^~~
        fabs
4 errors generated.
make: *** [quat] Error 1

replaced all occasions of abs with fabs and compile went through.

Latest version of OSX (10.11.1)

cc -v
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.0.0
Thread model: posix

M_PI is not supposed to be defined in C99

The code is compiled with -std=c99 flag, but the C99 standard dropped M_PI and all other mathc defines of the same type. When compiling a compiler that strictly respects ISO like gcc, it generates a M_PI undefined error.

You should probably define your own PI, or compile with -std=gnu99 flag, for instance.

calloc memory overflow

Hi, not sure if you're still working on this or not, but I was reading through your code and noticed that your arguments to calloc are reversed in every call. It should be calloc(count, size).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.