1
0
Fork 0

(svn r27709) -Fix-ish: Silence some warnings. (adf88)

release/1.7
frosch 2016-12-25 13:26:15 +00:00
parent 9afb705125
commit 4342798ff5
2 changed files with 9 additions and 0 deletions

View File

@ -1404,6 +1404,9 @@ make_compiler_cflags() {
# warning: narrowing conversion of '...' from 'unsigned int' to 'int' inside { } [-Wnarrowing] # warning: narrowing conversion of '...' from 'unsigned int' to 'int' inside { } [-Wnarrowing]
# They are valid according to the C++ standard, but useless. # They are valid according to the C++ standard, but useless.
cxxflags="$cxxflags -Wno-narrowing" cxxflags="$cxxflags -Wno-narrowing"
fi
if [ $cc_version -ge 407 ]; then
# Disable bogus 'attempt to free a non-heap object' warning # Disable bogus 'attempt to free a non-heap object' warning
flags="$flags -Wno-free-nonheap-object" flags="$flags -Wno-free-nonheap-object"
fi fi

View File

@ -1484,6 +1484,8 @@ size_t SlCalcObjMemberLength(const void *object, const SaveLoad *sld)
return 0; return 0;
} }
#ifdef OTTD_ASSERT
/** /**
* Check whether the variable size of the variable in the saveload configuration * Check whether the variable size of the variable in the saveload configuration
* matches with the actual variable size. * matches with the actual variable size.
@ -1524,9 +1526,13 @@ static bool IsVariableSizeRight(const SaveLoad *sld)
} }
} }
#endif /* OTTD_ASSERT */
bool SlObjectMember(void *ptr, const SaveLoad *sld) bool SlObjectMember(void *ptr, const SaveLoad *sld)
{ {
#ifdef OTTD_ASSERT
assert(IsVariableSizeRight(sld)); assert(IsVariableSizeRight(sld));
#endif
VarType conv = GB(sld->conv, 0, 8); VarType conv = GB(sld->conv, 0, 8);
switch (sld->cmd) { switch (sld->cmd) {