diff --git a/libraries/asmjit/asmjit/base/cpuinfo.h b/libraries/asmjit/asmjit/base/cpuinfo.h index 268d37e8d..6398f993e 100644 --- a/libraries/asmjit/asmjit/base/cpuinfo.h +++ b/libraries/asmjit/asmjit/base/cpuinfo.h @@ -37,15 +37,17 @@ public: // [Construction / Destruction] // -------------------------------------------------------------------------- - ASMJIT_INLINE CpuFeatures() noexcept { reset(); } - ASMJIT_INLINE CpuFeatures(const CpuFeatures& other) noexcept { init(other); } + ASMJIT_INLINE CpuFeatures() noexcept : _bits{} {} + + ASMJIT_INLINE CpuFeatures(const CpuFeatures& other) noexcept = default; + ASMJIT_INLINE CpuFeatures& operator=(const CpuFeatures& other) noexcept = default; // -------------------------------------------------------------------------- // [Init / Reset] // -------------------------------------------------------------------------- - ASMJIT_INLINE void init(const CpuFeatures& other) noexcept { ::memcpy(this, &other, sizeof(*this)); } - ASMJIT_INLINE void reset() noexcept { ::memset(this, 0, sizeof(*this)); } + ASMJIT_INLINE void init(const CpuFeatures& other) noexcept { *this = other; } + ASMJIT_INLINE void reset() noexcept { *this = CpuFeatures{}; } // -------------------------------------------------------------------------- // [Ops] @@ -248,8 +250,21 @@ public: // [Construction / Destruction] // -------------------------------------------------------------------------- - ASMJIT_INLINE CpuInfo() noexcept { reset(); } - ASMJIT_INLINE CpuInfo(const CpuInfo& other) noexcept { init(other); } + ASMJIT_INLINE CpuInfo() noexcept: + _archInfo{}, + _vendorId{}, + _family{}, + _model{}, + _stepping{}, + _hwThreadsCount{}, + _features{}, + _vendorString{}, + _brandString{}, + _x86Data{} + {} + + ASMJIT_INLINE CpuInfo(const CpuInfo& other) noexcept = default; + ASMJIT_INLINE CpuInfo& operator=(const CpuInfo& other) noexcept = default; // -------------------------------------------------------------------------- // [Init / Reset] @@ -260,8 +275,8 @@ public: _archInfo.init(archType, archMode); } - ASMJIT_INLINE void init(const CpuInfo& other) noexcept { ::memcpy(this, &other, sizeof(*this)); } - ASMJIT_INLINE void reset() noexcept { ::memset(this, 0, sizeof(*this)); } + ASMJIT_INLINE void init(const CpuInfo& other) noexcept { *this = other; } + ASMJIT_INLINE void reset() noexcept { *this = CpuInfo{}; } // -------------------------------------------------------------------------- // [Detect] diff --git a/libraries/asmjit/asmjit/base/func.h b/libraries/asmjit/asmjit/base/func.h index c9ab0529d..8139eee96 100644 --- a/libraries/asmjit/asmjit/base/func.h +++ b/libraries/asmjit/asmjit/base/func.h @@ -734,10 +734,18 @@ public: // [Construction / Destruction] // -------------------------------------------------------------------------- - ASMJIT_INLINE FuncDetail() noexcept { reset(); } - ASMJIT_INLINE FuncDetail(const FuncDetail& other) noexcept { - ::memcpy(this, &other, sizeof(*this)); - } + ASMJIT_INLINE FuncDetail() noexcept: + _callConv{}, + _argCount{}, + _retCount{}, + _usedRegs{}, + _argStackSize{}, + _rets{}, + _args{} + {} + + ASMJIT_INLINE FuncDetail(const FuncDetail& other) noexcept = default; + ASMJIT_INLINE FuncDetail& operator=(const FuncDetail& other) noexcept = default; // -------------------------------------------------------------------------- // [Init / Reset] @@ -745,7 +753,7 @@ public: //! Initialize this `FuncDetail` to the given signature. ASMJIT_API Error init(const FuncSignature& sign); - ASMJIT_INLINE void reset() noexcept { ::memset(this, 0, sizeof(*this)); } + ASMJIT_INLINE void reset() noexcept { *this = FuncDetail{}; } // -------------------------------------------------------------------------- // [Accessors - Calling Convention] @@ -878,20 +886,23 @@ struct FuncFrameInfo { // [Construction / Destruction] // -------------------------------------------------------------------------- - ASMJIT_INLINE FuncFrameInfo() noexcept { reset(); } + ASMJIT_INLINE FuncFrameInfo() noexcept: + _attributes{}, + _dirtyRegs{}, + _stackFrameAlignment{}, + _callFrameAlignment{}, + _stackArgsRegId{Globals::kInvalidRegId}, + _stackFrameSize{}, + _callFrameSize{} + {} - ASMJIT_INLINE FuncFrameInfo(const FuncFrameInfo& other) noexcept { - ::memcpy(this, &other, sizeof(*this)); - } + ASMJIT_INLINE FuncFrameInfo(const FuncFrameInfo& other) noexcept = default; // -------------------------------------------------------------------------- // [Init / Reset] // -------------------------------------------------------------------------- - ASMJIT_INLINE void reset() noexcept { - ::memset(this, 0, sizeof(*this)); - _stackArgsRegId = Globals::kInvalidRegId; - } + ASMJIT_INLINE void reset() noexcept { *this = FuncFrameInfo{}; } // -------------------------------------------------------------------------- // [Accessors] @@ -1180,19 +1191,18 @@ public: // [Construction / Destruction] // -------------------------------------------------------------------------- - explicit ASMJIT_INLINE FuncArgsMapper(const FuncDetail* fd) noexcept { reset(fd); } - ASMJIT_INLINE FuncArgsMapper(const FuncArgsMapper& other) noexcept { - ::memcpy(this, &other, sizeof(*this)); - } + explicit ASMJIT_INLINE FuncArgsMapper(const FuncDetail* fd = nullptr) noexcept: + _funcDetail(fd), + _args{} + {} + + ASMJIT_INLINE FuncArgsMapper(const FuncArgsMapper& other) noexcept = default; // -------------------------------------------------------------------------- // [Reset] // -------------------------------------------------------------------------- - ASMJIT_INLINE void reset(const FuncDetail* fd = nullptr) noexcept { - _funcDetail = fd; - ::memset(_args, 0, sizeof(_args)); - } + ASMJIT_INLINE void reset(const FuncDetail* fd = nullptr) noexcept { *this = FuncArgsMapper(fd); } // -------------------------------------------------------------------------- // [Accessors] diff --git a/libraries/asmjit/asmjit/base/regalloc_p.h b/libraries/asmjit/asmjit/base/regalloc_p.h index 53c7aebe6..46187898b 100644 --- a/libraries/asmjit/asmjit/base/regalloc_p.h +++ b/libraries/asmjit/asmjit/base/regalloc_p.h @@ -101,7 +101,7 @@ struct TiedReg { // -------------------------------------------------------------------------- ASMJIT_INLINE TiedReg& operator=(const TiedReg& other) { - ::memcpy(this, &other, sizeof(TiedReg)); + ::memcpy((void*)this, &other, sizeof(TiedReg)); return *this; } diff --git a/libraries/asmjit/asmjit/base/zone.cpp b/libraries/asmjit/asmjit/base/zone.cpp index 6dd535de8..95deb98fa 100644 --- a/libraries/asmjit/asmjit/base/zone.cpp +++ b/libraries/asmjit/asmjit/base/zone.cpp @@ -221,7 +221,8 @@ void ZoneHeap::reset(Zone* zone) noexcept { } // Zero the entire class and initialize to the given `zone`. - ::memset(this, 0, sizeof(*this)); + _dynamicBlocks = nullptr; + ::memset(_slots, 0, sizeof(_slots)); _zone = zone; } diff --git a/libraries/asmjit/asmjit/base/zone.h b/libraries/asmjit/asmjit/base/zone.h index 5a461a29c..818436084 100644 --- a/libraries/asmjit/asmjit/base/zone.h +++ b/libraries/asmjit/asmjit/base/zone.h @@ -297,14 +297,19 @@ class ZoneHeap { //! Create a new `ZoneHeap`. //! //! NOTE: To use it, you must first `init()` it. - ASMJIT_INLINE ZoneHeap() noexcept { - ::memset(this, 0, sizeof(*this)); - } + ASMJIT_INLINE ZoneHeap() noexcept: + _zone{}, + _slots{}, + _dynamicBlocks{} + {} + //! Create a new `ZoneHeap` initialized to use `zone`. - explicit ASMJIT_INLINE ZoneHeap(Zone* zone) noexcept { - ::memset(this, 0, sizeof(*this)); - _zone = zone; - } + explicit ASMJIT_INLINE ZoneHeap(Zone* zone) noexcept: + _zone(zone), + _slots{}, + _dynamicBlocks{} + {} + //! Destroy the `ZoneHeap`. ASMJIT_INLINE ~ZoneHeap() noexcept { reset(); } diff --git a/src/common/objects/dobjtype.cpp b/src/common/objects/dobjtype.cpp index d08947903..b3a815ebc 100644 --- a/src/common/objects/dobjtype.cpp +++ b/src/common/objects/dobjtype.cpp @@ -5,6 +5,7 @@ **--------------------------------------------------------------------------- ** Copyright 1998-2016 Randy Heit ** Copyright 2005-2016 Christoph Oelckers +** Copyright 2017-2025 GZDoom Maintainers and Contributors ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -816,7 +817,7 @@ void PClass::BuildFlatPointers() const else { pairType *flat = (pairType*)ClassDataAllocator.Alloc(sizeof(pairType) * NativePointers.Size()); - memcpy(flat, NativePointers.Data(), sizeof(pairType) * NativePointers.Size()); + std::copy(NativePointers.Data(), NativePointers.Data() + NativePointers.Size(), flat); FlatPointers = flat; FlatPointersSize = NativePointers.Size(); @@ -849,15 +850,15 @@ void PClass::BuildFlatPointers() const if (ParentClass->FlatPointersSize > 0) { - memcpy (flat, ParentClass->FlatPointers, sizeof(pairType) * ParentClass->FlatPointersSize); + std::copy(ParentClass->FlatPointers, ParentClass->FlatPointers + ParentClass->FlatPointersSize, flat); } if (NativePointers.Size() > 0) { - memcpy(flat + ParentClass->FlatPointersSize, NativePointers.Data(), sizeof(pairType) * NativePointers.Size()); + std::copy(NativePointers.Data(), NativePointers.Data() + NativePointers.Size(), flat + ParentClass->FlatPointersSize); } if (ScriptPointers.Size() > 0) { - memcpy(flat + ParentClass->FlatPointersSize + NativePointers.Size(), &ScriptPointers[0], sizeof(pairType) * ScriptPointers.Size()); + std::copy(&ScriptPointers[0], &ScriptPointers[0] + ScriptPointers.Size(), flat + ParentClass->FlatPointersSize + NativePointers.Size()); } FlatPointers = flat; FlatPointersSize = ParentClass->FlatPointersSize + NativePointers.Size() + ScriptPointers.Size(); @@ -913,12 +914,12 @@ void PClass::BuildArrayPointers() const pairType *flat = (pairType*)ClassDataAllocator.Alloc(sizeof(pairType) * (ParentClass->ArrayPointersSize + ScriptPointers.Size())); if (ParentClass->ArrayPointersSize > 0) { - memcpy(flat, ParentClass->ArrayPointers, sizeof(pairType) * ParentClass->ArrayPointersSize); + std::copy(ParentClass->ArrayPointers, ParentClass->ArrayPointers + ParentClass->ArrayPointersSize, flat); } if (ScriptPointers.Size() > 0) { - memcpy(flat + ParentClass->ArrayPointersSize, ScriptPointers.Data(), sizeof(pairType) * ScriptPointers.Size()); + std::copy(ScriptPointers.Data(), ScriptPointers.Data() + ScriptPointers.Size(), flat + ParentClass->ArrayPointersSize); } ArrayPointers = flat; @@ -974,12 +975,12 @@ void PClass::BuildMapPointers() const pairType *flat = (pairType*)ClassDataAllocator.Alloc(sizeof(pairType) * (ParentClass->MapPointersSize + ScriptPointers.Size())); if (ParentClass->MapPointersSize > 0) { - memcpy(flat, ParentClass->MapPointers, sizeof(pairType) * ParentClass->MapPointersSize); + std::copy(ParentClass->MapPointers, ParentClass->MapPointers + ParentClass->MapPointersSize, flat); } if (ScriptPointers.Size() > 0) { - memcpy(flat + ParentClass->MapPointersSize, ScriptPointers.Data(), sizeof(pairType) * ScriptPointers.Size()); + std::copy(ScriptPointers.Data(), ScriptPointers.Data() + ScriptPointers.Size(), flat + ParentClass->MapPointersSize); } MapPointers = flat; MapPointersSize = ParentClass->MapPointersSize + ScriptPointers.Size(); diff --git a/src/maploader/glnodes.cpp b/src/maploader/glnodes.cpp index 33051b6c1..986dd6cd8 100644 --- a/src/maploader/glnodes.cpp +++ b/src/maploader/glnodes.cpp @@ -3,6 +3,7 @@ ** **--------------------------------------------------------------------------- ** Copyright 2005-2010 Christoph Oelckers +** Copyright 2017-2025 GZDoom Maintainers and Contributors ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -442,20 +443,25 @@ bool MapLoader::LoadGLSubsectors(FileReader &lump) lump.Seek(0, FileReader::SeekSet); auto datab = lump.Read(); const unsigned numsegs = Level->segs.Size(); - + if (numsubsectors == 0) { return false; } - + if (!format5 && memcmp(datab.data(), "gNd3", 4)) { auto data = (const mapsubsector_t*) datab.data(); numsubsectors /= sizeof(mapsubsector_t); Level->subsectors.Alloc(numsubsectors); auto &subsectors = Level->subsectors; - memset(&subsectors[0],0,numsubsectors * sizeof(subsector_t)); - + + for (i = 0; i < numsubsectors; i++) + { + subsectors[i].sprites.Clear(); + memset((void*)&subsectors[i], 0, sizeof(mapsubsector_t)); + } + for (i=0; isubsectors.Alloc(numsubsectors); auto &subsectors = Level->subsectors; - memset(&subsectors[0],0,numsubsectors * sizeof(subsector_t)); - + + for (i = 0; i < numsubsectors; i++) + { + subsectors[i].sprites.Clear(); + memset((void*)&subsectors[i], 0, sizeof(mapsubsector_t)); + } + for (i=0; isubsectors.Alloc(numSubs); - memset (&Level->subsectors[0], 0, Level->subsectors.Size()*sizeof(subsector_t)); + + for (i = 0; i < Level->subsectors.Size(); i++) + { + Level->subsectors[i].sprites.Clear(); + memset((void*)&Level->subsectors[i], 0, sizeof(mapsubsector_t)); + } for (i = currSeg = 0; i < numSubs; ++i) { @@ -1012,9 +1018,13 @@ bool MapLoader::LoadSubsectors (MapData * map) auto &subsectors = Level->subsectors; subsectors.Alloc(numsubsectors); auto &fr = map->Reader(ML_SSECTORS); - - memset (&subsectors[0], 0, numsubsectors*sizeof(subsector_t)); - + + for (unsigned i = 0; i < numsubsectors; i++) + { + subsectors[i].sprites.Clear(); + memset((void*)&subsectors[i], 0, sizeof(mapsubsector_t)); + } + for (unsigned i = 0; i < numsubsectors; i++) { subsectortype subd; diff --git a/src/maploader/renderinfo.cpp b/src/maploader/renderinfo.cpp index 533526237..b2bc55865 100644 --- a/src/maploader/renderinfo.cpp +++ b/src/maploader/renderinfo.cpp @@ -1,7 +1,8 @@ // //--------------------------------------------------------------------------- // -// Copyright(C) 2005-2016 Christoph Oelckers +// Copyright 2005-2016 Christoph Oelckers +// Copyright 2017-2025 GZDoom Maintainers and Contributors // All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -937,7 +938,10 @@ void MapLoader::FixHoles() DPrintf(DMSG_NOTIFY, "Adding dummy subsector for sector %d\n", Index(segloop[0]->Subsector->render_sector)); subsector_t &sub = Level->subsectors[newssstart++]; - memset(&sub, 0, sizeof(sub)); + + sub.sprites.Clear(); + memset((void*)&sub, 0, sizeof(sub)); + sub.sector = segloop[0]->frontsector; sub.render_sector = segloop[0]->Subsector->render_sector; sub.numlines = segloop.Size(); diff --git a/src/maploader/udmf.cpp b/src/maploader/udmf.cpp index 7a2e20b35..425a656d2 100644 --- a/src/maploader/udmf.cpp +++ b/src/maploader/udmf.cpp @@ -5,6 +5,7 @@ ** **--------------------------------------------------------------------------- ** Copyright 2008 Christoph Oelckers +** Copyright 2017-2025 GZDoom Maintainers and Contributors ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -2629,7 +2630,7 @@ public: // Create the real vertices Level->vertexes.Alloc(ParsedVertices.Size()); - memcpy(&Level->vertexes[0], &ParsedVertices[0], Level->vertexes.Size() * sizeof(vertex_t)); + std::copy(&ParsedVertices[0], &ParsedVertices[0] + ParsedVertices.Size(), &Level->vertexes[0]); // Create the real sectors Level->sectors.Alloc(ParsedSectors.Size()); diff --git a/src/playsim/a_dynlight.cpp b/src/playsim/a_dynlight.cpp index 1f7786543..7ed9949fd 100644 --- a/src/playsim/a_dynlight.cpp +++ b/src/playsim/a_dynlight.cpp @@ -1,7 +1,8 @@ // //--------------------------------------------------------------------------- // -// Copyright(C) 2004-2016 Christoph Oelckers +// Copyright 2004-2016 Christoph Oelckers +// Copyright 2017-2025 GZDoom Maintainers and Contributors // All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -86,7 +87,7 @@ static FDynamicLight *GetLight(FLevelLocals *Level) FreeList.Pop(ret); } else ret = (FDynamicLight*)DynLightArena.Alloc(sizeof(FDynamicLight)); - memset(ret, 0, sizeof(*ret)); + memset((void*)ret, 0, sizeof(*ret)); ret = new(ret)FDynamicLight(); ret->m_cycler.m_increment = true; ret->next = Level->lights; diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index 41a3b47f4..a47dace93 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -1,7 +1,8 @@ // //--------------------------------------------------------------------------- // -// Copyright(C) 2005-2016 Christoph Oelckers +// Copyright 2005-2016 Christoph Oelckers +// Copyright 2017-2025 GZDoom Maintainers and Contributors // All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -19,6 +20,7 @@ // //-------------------------------------------------------------------------- // + /* ** gl_models.cpp ** @@ -694,7 +696,7 @@ void InitModels() { FVoxelModel *md = (FVoxelModel*)Models[VoxelDefs[i]->Voxel->VoxelIndex]; FSpriteModelFrame smf; - memset(&smf, 0, sizeof(smf)); + memset((void*)&smf, 0, sizeof(smf)); smf.isVoxel = true; smf.modelsAmount = 1; smf.modelframes.Alloc(1); @@ -772,7 +774,7 @@ void ParseModelDefLump(int Lump) sc.MustGetString(); FSpriteModelFrame smf; - memset(&smf, 0, sizeof(smf)); + memset((void*)&smf, 0, sizeof(smf)); smf.xscale=smf.yscale=smf.zscale=1.f; auto type = PClass::FindClass(sc.String); @@ -1187,7 +1189,7 @@ FSpriteModelFrame * FindModelFrameRaw(const AActor * actorDefaults, const PClass { FSpriteModelFrame smf; - memset(&smf, 0, sizeof(smf)); + memset((void*)&smf, 0, sizeof(smf)); smf.type = ti; smf.sprite = sprite; smf.frame = frame; diff --git a/src/utility/nodebuilder/nodebuild_extract.cpp b/src/utility/nodebuilder/nodebuild_extract.cpp index 9714a52c6..669a0c832 100644 --- a/src/utility/nodebuilder/nodebuild_extract.cpp +++ b/src/utility/nodebuilder/nodebuild_extract.cpp @@ -6,6 +6,7 @@ ** **--------------------------------------------------------------------------- ** Copyright 2002-2006 Randy Heit +** Copyright 2017-2025 GZDoom Maintainers and Contributors ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -54,13 +55,11 @@ void FNodeBuilder::Extract (FLevelLocals &theLevel) { - int i; - auto &outVerts = theLevel.vertexes; int vertCount = Vertices.Size (); outVerts.Alloc(vertCount); - for (i = 0; i < vertCount; ++i) + for (int i = 0; i < vertCount; ++i) { outVerts[i].set(Vertices[i].x, Vertices[i].y); } @@ -68,13 +67,17 @@ void FNodeBuilder::Extract (FLevelLocals &theLevel) auto &outSubs = theLevel.subsectors; auto subCount = Subsectors.Size(); outSubs.Alloc(subCount); - memset(&outSubs[0], 0, subCount * sizeof(subsector_t)); + memset((void*)&outSubs[0], 0, subCount * sizeof(subsector_t)); auto &outNodes = theLevel.nodes; auto nodeCount = Nodes.Size (); outNodes.Alloc(nodeCount); - memcpy (&outNodes[0], &Nodes[0], nodeCount*sizeof(node_t)); + for (unsigned i = 0; i < nodeCount; ++i) + { + outNodes[i] = Nodes[i]; + } + for (unsigned i = 0; i < nodeCount; ++i) { D(Printf(PRINT_LOG, "Node %d: Splitter[%08x,%08x] [%08x,%08x]\n", i, @@ -135,7 +138,11 @@ void FNodeBuilder::Extract (FLevelLocals &theLevel) } else { - memcpy (&outSubs[0], &Subsectors[0], subCount*sizeof(subsector_t)); + for (unsigned i = 0; i < subCount; ++i) + { + outSubs[i] = Subsectors[i]; + } + auto segCount = Segs.Size (); outSegs.Alloc(segCount); for (unsigned i = 0; i < segCount; ++i) @@ -161,7 +168,7 @@ void FNodeBuilder::Extract (FLevelLocals &theLevel) D(Printf("%i segs, %i nodes, %i subsectors\n", segCount, nodeCount, subCount)); - for (i = 0; i < Level.NumLines; ++i) + for (int i = 0; i < Level.NumLines; ++i) { Level.Lines[i].v1 = &outVerts[(size_t)Level.Lines[i].v1]; Level.Lines[i].v2 = &outVerts[(size_t)Level.Lines[i].v2]; @@ -180,10 +187,18 @@ void FNodeBuilder::ExtractMini (FMiniBSP *bsp) } bsp->Subsectors.Resize(Subsectors.Size()); - memset(&bsp->Subsectors[0], 0, Subsectors.Size() * sizeof(subsector_t)); + for (i = 0; i < bsp->Subsectors.Size(); ++i) + { + bsp->Subsectors[i].sprites.Clear(); + memset((void*)&bsp->Subsectors[i], 0, sizeof(mapsubsector_t)); + } bsp->Nodes.Resize(Nodes.Size()); - memcpy(&bsp->Nodes[0], &Nodes[0], Nodes.Size()*sizeof(node_t)); + for (i = 0; i < Nodes.Size(); ++i) + { + bsp->Nodes[i] = Nodes[i]; + } + for (i = 0; i < Nodes.Size(); ++i) { D(Printf(PRINT_LOG, "Node %d:\n", i)); @@ -228,7 +243,11 @@ void FNodeBuilder::ExtractMini (FMiniBSP *bsp) } else { - memcpy(&bsp->Subsectors[0], &Subsectors[0], Subsectors.Size()*sizeof(subsector_t)); + for (i = 0; i < Subsectors.Size(); ++i) + { + bsp->Subsectors[i] = Subsectors[i]; + } + bsp->Segs.Resize(Segs.Size()); for (i = 0; i < Segs.Size(); ++i) { diff --git a/tools/re2c/src/ir/adfa/prepare.cc b/tools/re2c/src/ir/adfa/prepare.cc index 39cf65c1b..a65ed37e3 100644 --- a/tools/re2c/src/ir/adfa/prepare.cc +++ b/tools/re2c/src/ir/adfa/prepare.cc @@ -125,7 +125,7 @@ void DFA::findBaseState() operator delete (s->go.span); s->go.nSpans = nSpans; s->go.span = allocate (nSpans); - memcpy(s->go.span, span, nSpans*sizeof(Span)); + memcpy((void*)(s->go.span), span, nSpans*sizeof(Span)); } break;