Changeset - r22935:dd88c75e2001
[Not reviewed]
master
0 9 0
Charles Pigott - 6 years ago 2018-05-13 17:34:57
charlespigott@googlemail.com
Codechange: Silence -Wclass-memaccess warnings with GCC8
9 files changed with 12 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/squirrel/squirrel/squtils.h
Show inline comments
 
@@ -90,7 +90,7 @@ public:
 
	{
 
		_vals[idx].~T();
 
		if(idx < (_size - 1)) {
 
			memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - (size_t)idx - 1));
 
			memmove(static_cast<void *>(&_vals[idx]), &_vals[idx+1], sizeof(T) * (_size - (size_t)idx - 1));
 
		}
 
		_size--;
 
	}
src/3rdparty/squirrel/squirrel/sqvm.cpp
Show inline comments
 
@@ -378,8 +378,7 @@ bool SQVM::StartCall(SQClosure *closure,
 
	}
 

	
 
	if (!tailcall) {
 
		CallInfo lc;
 
		memset(&lc, 0, sizeof(lc));
 
		CallInfo lc = {};
 
		lc._generator = NULL;
 
		lc._etraps = 0;
 
		lc._prevstkbase = (SQInt32) ( stackbase - _stackbase );
 
@@ -1159,8 +1158,7 @@ bool SQVM::CallNative(SQNativeClosure *n
 
	SQInteger oldtop = _top;
 
	SQInteger oldstackbase = _stackbase;
 
	_top = stackbase + nargs;
 
	CallInfo lci;
 
	memset(&lci, 0, sizeof(lci));
 
	CallInfo lci = {};
 
	lci._closure = nclosure;
 
	lci._generator = NULL;
 
	lci._etraps = 0;
src/base_media_func.h
Show inline comments
 
@@ -40,8 +40,6 @@
 
template <class T, size_t Tnum_files, bool Tsearch_in_tars>
 
bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const char *path, const char *full_filename, bool allow_empty_filename)
 
{
 
	memset(this, 0, sizeof(*this));
 

	
 
	IniGroup *metadata = ini->GetGroup("metadata");
 
	IniItem *item;
 

	
src/blitter/32bpp_anim.cpp
Show inline comments
 
@@ -361,7 +361,7 @@ void Blitter_32bppAnim::CopyFromBuffer(v
 
		Colour *dst_pal = dst;
 
		uint16 *anim_pal = anim_line;
 

	
 
		memcpy(dst, usrc, width * sizeof(uint32));
 
		memcpy(static_cast<void *>(dst), usrc, width * sizeof(uint32));
 
		usrc += width;
 
		dst += _screen.pitch;
 
		/* Copy back the anim-buffer */
src/core/alloc_func.hpp
Show inline comments
 
@@ -125,7 +125,7 @@ static inline T *ReallocT(T *t_ptr, size
 
	/* Ensure the size does not overflow. */
 
	CheckAllocationConstraints<T>(num_elements);
 

	
 
	t_ptr = (T*)realloc(t_ptr, num_elements * sizeof(T));
 
	t_ptr = (T*)realloc(static_cast<void *>(t_ptr), num_elements * sizeof(T));
 
	if (t_ptr == NULL) ReallocError(num_elements * sizeof(T));
 
	return t_ptr;
 
}
src/economy.cpp
Show inline comments
 
@@ -696,9 +696,10 @@ static void CompaniesGenStatistics()
 
	if (!HasBit(1 << 0 | 1 << 3 | 1 << 6 | 1 << 9, _cur_month)) return;
 

	
 
	FOR_ALL_COMPANIES(c) {
 
		memmove(&c->old_economy[1], &c->old_economy[0], sizeof(c->old_economy) - sizeof(c->old_economy[0]));
 
		/* Drop the oldest history off the end */
 
		std::copy_backward(c->old_economy, c->old_economy + MAX_HISTORY_QUARTERS - 1, c->old_economy + MAX_HISTORY_QUARTERS);
 
		c->old_economy[0] = c->cur_economy;
 
		memset(&c->cur_economy, 0, sizeof(c->cur_economy));
 
		c->cur_economy = {};
 

	
 
		if (c->num_valid_stat_ent != MAX_HISTORY_QUARTERS) c->num_valid_stat_ent++;
 

	
src/landscape.cpp
Show inline comments
 
@@ -1080,8 +1080,7 @@ static uint River_Hash(uint tile, uint d
 
 */
 
static void BuildRiver(TileIndex begin, TileIndex end)
 
{
 
	AyStar finder;
 
	MemSetT(&finder, 0);
 
	AyStar finder = {};
 
	finder.CalculateG = River_CalculateG;
 
	finder.CalculateH = River_CalculateH;
 
	finder.GetNeighbours = River_GetNeighbours;
src/newgrf_object.cpp
Show inline comments
 
@@ -96,7 +96,9 @@ uint ObjectSpec::Index() const
 
void ResetObjects()
 
{
 
	/* Clean the pool. */
 
	MemSetT(_object_specs, 0, lengthof(_object_specs));
 
	for (uint16 i = 0; i < NUM_OBJECTS; i++) {
 
		_object_specs[i] = {};
 
	}
 

	
 
	/* And add our originals. */
 
	MemCpyT(_object_specs, _original_objects, lengthof(_original_objects));
src/saveload/company_sl.cpp
Show inline comments
 
@@ -498,7 +498,6 @@ static void Check_PLYR()
 
	int index;
 
	while ((index = SlIterateArray()) != -1) {
 
		CompanyProperties *cprops = new CompanyProperties();
 
		memset(cprops, 0, sizeof(*cprops));
 
		SaveLoad_PLYR_common(NULL, cprops);
 

	
 
		/* We do not load old custom names */
0 comments (0 inline, 0 general)