With FreeBSD/clang, -Werror combined with the configured warning flags yields
some fatal errors, specifically related to signed conversion, 64 to 32 bit
conversion, and tautological compares.
CONTRIBUTORS
Add myself to the contributor list
src/Generating/FinishGen.cpp
In cFinishGenPassiveMobs::GetRandomMob(), change the type of RandMob
from size_t to the difference_type of the ListOfSpawnables iterator
MobIter. Using size_t triggers a 64 bit to 32 bit conversion if the
difference_type of the iterator class is 64 bit
Also explicitly cast the noise expression to unsigned long so we don't
get a signed conversion warning from the modulo against
ListOfSpawnables.size()
src/OSSupport/StackTrace.cpp
FreeBSD 10 and above includes a non glibc implementation of benchmark()
for which size_t, not int, is the return type. To account for this and
prevent a signed conversion warning, abstract the type for numItems with
a macro btsize
src/StringUtils.h
In StringToInteger(), correct a tautological compare warning for
unsigned types with the template. If T is unsigned, comparing
std::numeric_limits<T>::min() to the unsigned result is always
false. That control can enter this branch in an evaluated template with
an unsigned type T may also permit a signed number to be parsed and
erroneously stripped of its signedness at runtime. To guard against this
and avoid the warning in the case that the number parsed from the string
is non-positive, return false and don't try to parse if T is unsigned
and control enters the non-positive branch
Made cSpawnPrepare execute on the same thread since it is a syncronous operation, and most of the code happens on the lighting thread.
Also moved cSpawnPrepare into its own file
SetFlags.cmake
Add -lexecinfo to linker flags for FreeBSD to resolve backtrace()
lib/sqlite/CMakeLists.txt
Define _XOPEN_SOURCE to 600 instead of __POSIX_VISIBLE to 200112 for
POSIX 1-2001 support. For POSIX standards, the _XOPEN_SOURCE define
controls the eventual value of __POSIX_VISIBLE. _XOPEN_SOURCE is defined
to 500 in sqlite.c if not already defined, which sets up _POSIX_C_SOURCE
and __POSIX_VISIBLE to the 199506 for POSIX.1c
lib/tolua++/CMakeLists.txt
src/CMakeLists.txt
Add /usr/local/lib to the library search path for FreeBSD builds
src/OSSupport/Errors.cpp
Correct the strerror_r() implementation determination to check whether
_GNU_SOURCE is defined, not what it evaluates to