Rapptz / sol

A C++11 Lua wrapper
MIT License
209 stars 32 forks source link

fix tautological compare error #53

Closed PeterHajdu closed 10 years ago

PeterHajdu commented 10 years ago

In case of userdata I=0, size_t i(0) is never less than 0, causing a tautological-compare warning.

sol/function_types.hpp:262:38: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]

FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 Target: x86_64-unknown-freebsd10.0 Thread model: posix

Rapptz commented 10 years ago

Thanks for the patch.

Quick question, what triggered I = 0?

PeterHajdu commented 10 years ago

lua->new_userdata< SomeCoordinateClass, int, int >( "coordinate" ); The error was triggered by the line above. SomeCoordinateClass takes two int constructor parameters.