ee34e7131a
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 |
||
---|---|---|
.. | ||
Prefabs | ||
BioGen.cpp | ||
BioGen.h | ||
Caves.cpp | ||
Caves.h | ||
ChunkDesc.cpp | ||
ChunkDesc.h | ||
ChunkGenerator.cpp | ||
ChunkGenerator.h | ||
CMakeLists.txt | ||
CompoGen.cpp | ||
CompoGen.h | ||
CompoGenBiomal.cpp | ||
CompoGenBiomal.h | ||
ComposableGenerator.cpp | ||
ComposableGenerator.h | ||
CompositedHeiGen.h | ||
DistortedHeightmap.cpp | ||
DistortedHeightmap.h | ||
DungeonRoomsFinisher.cpp | ||
DungeonRoomsFinisher.h | ||
EndGen.cpp | ||
EndGen.h | ||
FinishGen.cpp | ||
FinishGen.h | ||
GridStructGen.cpp | ||
GridStructGen.h | ||
HeiGen.cpp | ||
HeiGen.h | ||
IntGen.h | ||
MineShafts.cpp | ||
MineShafts.h | ||
NetherFortGen.cpp | ||
NetherFortGen.h | ||
Noise3DGenerator.cpp | ||
Noise3DGenerator.h | ||
PieceGenerator.cpp | ||
PieceGenerator.h | ||
POCPieceGenerator.cpp | ||
POCPieceGenerator.h | ||
Prefab.cpp | ||
Prefab.h | ||
PrefabPiecePool.cpp | ||
PrefabPiecePool.h | ||
ProtIntGen.h | ||
RainbowRoadsGen.cpp | ||
RainbowRoadsGen.h | ||
Ravines.cpp | ||
Ravines.h | ||
RoughRavines.cpp | ||
RoughRavines.h | ||
ShapeGen.cpp | ||
StructGen.cpp | ||
StructGen.h | ||
TestRailsGen.cpp | ||
TestRailsGen.h | ||
Trees.cpp | ||
Trees.h | ||
TwoHeights.cpp | ||
TwoHeights.h | ||
UnderwaterBaseGen.cpp | ||
UnderwaterBaseGen.h | ||
VillageGen.cpp | ||
VillageGen.h |