Changeset - r22502:3625e96bd0f3
[Not reviewed]
master
0 2 0
frosch - 8 years ago 2016-12-25 13:26:15
frosch@openttd.org
(svn r27709) -Fix-ish: Silence some warnings. (adf88)
2 files changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1401,12 +1401,15 @@ make_compiler_cflags() {
 

	
 
		if [ $cc_version -eq 407 ]; then
 
			# Disable -Wnarrowing which gives many warnings, such as:
 
			# warning: narrowing conversion of '...' from 'unsigned int' to 'int' inside { } [-Wnarrowing]
 
			# They are valid according to the C++ standard, but useless.
 
			cxxflags="$cxxflags -Wno-narrowing"
 
		fi
 

	
 
		if [ $cc_version -ge 407 ]; then
 
			# Disable bogus 'attempt to free a non-heap object' warning
 
			flags="$flags -Wno-free-nonheap-object"
 
		fi
 

	
 
		if [ $cc_version -ge 600 ]; then
 
			# -flifetime-dse=2 (default since GCC 6) doesn't play
src/saveload/saveload.cpp
Show inline comments
 
@@ -1481,12 +1481,14 @@ size_t SlCalcObjMemberLength(const void 
 
		case SL_ST_INCLUDE: return SlCalcObjLength(object, GetBaseStationDescription());
 
		default: NOT_REACHED();
 
	}
 
	return 0;
 
}
 

	
 
#ifdef OTTD_ASSERT
 

	
 
/**
 
 * Check whether the variable size of the variable in the saveload configuration
 
 * matches with the actual variable size.
 
 * @param sld The saveload configuration to test.
 
 */
 
static bool IsVariableSizeRight(const SaveLoad *sld)
 
@@ -1521,15 +1523,19 @@ static bool IsVariableSizeRight(const Sa
 

	
 
		default:
 
			return true;
 
	}
 
}
 

	
 
#endif /* OTTD_ASSERT */
 

	
 
bool SlObjectMember(void *ptr, const SaveLoad *sld)
 
{
 
#ifdef OTTD_ASSERT
 
	assert(IsVariableSizeRight(sld));
 
#endif
 

	
 
	VarType conv = GB(sld->conv, 0, 8);
 
	switch (sld->cmd) {
 
		case SL_VAR:
 
		case SL_REF:
 
		case SL_ARR:
0 comments (0 inline, 0 general)