ejoy / ejoy2d

A 2D Graphics Engine for Mobile Game
MIT License
1.98k stars 641 forks source link

macosx编译有warning #86

Closed jintiao closed 9 years ago

jintiao commented 9 years ago

mbp:ejoy2d jintiao$ make gcc -g -Wall -Ilib -Ilib/render -Ilua -D EJOY2D_OS=MACOSX -I/usr/X11R6/include -I/usr/include -I/opt/X11/include/freetype2 -D **MACOSX -o ej2d lib/shader.c lib/lshader.c lib/ejoy2dgame.c lib/fault.c lib/screen.c lib/texture.c lib/ppm.c lib/spritepack.c lib/sprite.c lib/lsprite.c lib/matrix.c lib/lmatrix.c lib/dfont.c lib/label.c lib/particle.c lib/lparticle.c lib/scissor.c lib/renderbuffer.c lib/lrenderbuffer.c lib/lgeometry.c lib/render/render.c lib/render/carray.c lib/render/log.c posix/window.c posix/winfw.c posix/winfont.c lua/lapi.c lua/lauxlib.c lua/lbaselib.c lua/lbitlib.c lua/lcode.c lua/lcorolib.c lua/lctype.c lua/ldblib.c lua/ldebug.c lua/ldo.c lua/ldump.c lua/lfunc.c lua/lgc.c lua/linit.c lua/liolib.c lua/llex.c lua/lmathlib.c lua/lmem.c lua/loadlib.c lua/lobject.c lua/lopcodes.c lua/loslib.c lua/lparser.c lua/lstate.c lua/lstring.c lua/lstrlib.c lua/ltable.c lua/ltablib.c lua/ltm.c lua/lundump.c lua/lutf8lib.c lua/lvm.c lua/lzio.c -L/usr/X11R6/lib -lGLEW -lGL -lX11 -lfreetype -lm -ldl lib/lgeometry.c:55:6: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] if (abs(x1-x2) > abs(y1-y2)) { ^ lib/lgeometry.c:55:6: note: use function 'fabsf' instead if (abs(x1-x2) > abs(y1-y2)) { ^~~ fabsf lib/lgeometry.c:55:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] if (abs(x1-x2) > abs(y1-y2)) { ^ lib/lgeometry.c:55:19: note: use function 'fabsf' instead if (abs(x1-x2) > abs(y1-y2)) { ^~~ fabsf 2 warnings generated. lib/render/render.c:947:14: warning: comparison of constant 2 with expression of type 'enum DRAW_MODE' is always true [-Wtautological-constant-out-of-range-compare] assert(mode < sizeof(draw_mode)/sizeof(int));


/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func**, **FILE**, **LINE**, #e...
                        ^
1 warning generated.
mbp:ejoy2d jintiao$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.4.0
Thread model: posix
lvzixun commented 9 years ago

这个在VAO分支上面已经fix了,只是还没merge到master上面来。