1
0
cuberite-2a/src/OSSupport
linnemannr ee34e7131a Fix FreeBSD/clang errors caused by -Werror
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
2015-05-30 02:23:57 -06:00
..
CMakeLists.txt Made -Weverything an error. 2015-05-24 12:56:56 +01:00
CriticalSection.cpp cNetwork: Added multithreading protection. 2015-01-22 20:12:50 +01:00
CriticalSection.h More style checking. 2015-05-09 12:58:54 +02:00
Errors.cpp Support building on FreeBSD 2015-05-24 20:07:31 -06:00
Errors.h Switched cEvent to GetOSErrorString 2014-01-25 06:02:20 -08:00
Event.cpp Cosmetic touchups. 2014-12-11 14:34:09 +01:00
Event.h Fixed integer overflow problems. 2014-12-07 21:37:47 +01:00
File.cpp Finish fixing windows 2015-05-19 14:02:02 +01:00
File.h Properly fix cFile Warnings 2015-05-19 13:33:34 +01:00
GZipFile.cpp En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
GZipFile.h Made -Weverything an error. 2015-05-24 12:56:56 +01:00
HostnameLookup.cpp cNetwork: Added UDP API. 2015-02-20 14:28:05 +01:00
HostnameLookup.h cNetwork: Fixed race conditions with lookups; proper shutdown. 2015-01-22 20:13:02 +01:00
IPLookup.cpp cNetwork: Added error message to error callbacks. 2015-01-22 20:13:04 +01:00
IPLookup.h cNetwork: Fixed race conditions with lookups; proper shutdown. 2015-01-22 20:13:02 +01:00
IsThread.cpp cIsThread: Fixed a race condition on thread start. 2014-12-25 00:34:54 +01:00
IsThread.h cIsThread: Fixed a race condition on thread start. 2014-12-25 00:34:54 +01:00
Network.h More style checking. 2015-05-09 12:58:54 +02:00
NetworkInterfaceEnum.cpp Use std::memcpy to fix alignment 2015-03-10 22:25:53 +00:00
NetworkSingleton.cpp NetworkSingleton: LibEvent thread is joined properly on server exit. 2015-02-18 22:41:22 +01:00
NetworkSingleton.h NetworkSingleton: LibEvent thread is joined properly on server exit. 2015-02-18 22:41:22 +01:00
Queue.h Fixed CppCheck: (performance) Possible inefficient checking for emptiness. 2015-01-17 15:20:03 +03:00
Semaphore.cpp En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Semaphore.h CheckBasicStyle: checks spaces around * and &. 2015-05-09 12:58:55 +02:00
ServerHandleImpl.cpp Network: Fixed two-socket servers. 2015-02-18 09:35:14 +01:00
ServerHandleImpl.h cNetwork: Added self pointers to keep objects alive for callbacks. 2015-01-23 23:01:18 +01:00
Socket.cpp En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Socket.h Fixed reported parentheses around comparisons. 2014-12-05 12:58:47 +01:00
StackTrace.cpp Fix FreeBSD/clang errors caused by -Werror 2015-05-30 02:23:57 -06:00
StackTrace.h Added a basic stacktracing for assert and signal failures. 2014-11-29 23:06:10 +01:00
TCPLinkImpl.cpp Network: fixed excessive debug logging. 2015-04-21 12:11:44 +02:00
TCPLinkImpl.h Fixed TCP link shutdown. 2015-02-14 13:55:54 +01:00
UDPEndpointImpl.cpp Network: fixed excessive debug logging. 2015-04-21 12:11:44 +02:00
UDPEndpointImpl.h Network: Close the UDP endpoint in destructor. 2015-03-18 13:50:43 +01:00