Skip to content

Commit

Permalink
Fix compilation warnings to error, mostly use-after-free and maybe un…
Browse files Browse the repository at this point in the history
…initialized.
  • Loading branch information
Silvanosky committed May 16, 2023
1 parent 43022f9 commit acf9943
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions include/ext_stl/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ template <class Type> class ElFifo

void incr_capa()
{
if (_capa == 0)
_capa = 1;

Type * NewTab = new Type [2*_capa];
for (INT kk=0; kk<_nb ; kk++)
NewTab[kk] = _tab[(kk+_begin)%_capa];
Expand Down
2 changes: 1 addition & 1 deletion src/TpMMPD/DeformAnalyse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int DeformAnalyse_main (int argc, char ** argv)

// 3. get the vector PerResidu
ifstream aPR((aDir + aOut1).c_str());
char *aPerR;
char *aPerR{nullptr};
if(aPR)
{
std::string aLine;
Expand Down
2 changes: 1 addition & 1 deletion src/TpMMPD/TiePByMesh/TaskCorrel/cAppliTaskCorrel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void cAppliTaskCorrel::ReadXMLMesurePts(string aGCPMesureXML, vector<cImgForTiep
std::list<cOneMesureAF1I> & aMes = iT1->OneMesureAF1I();
string aNameIm = iT1->NameIm();
cout<<endl<<" + Img : "<<aNameIm<<endl;
cImgForTiepTri* aImg;
cImgForTiepTri* aImg{};
for (uint akIm=0; akIm<mVImgs.size(); akIm++)
{
if (aNameIm == mVImgs[akIm]->Name())
Expand Down
4 changes: 4 additions & 0 deletions src/uti_phgrm/GraphCut/MaxFlow/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ template <typename captype, typename tcaptype, typename flowtype>
flow = 0;
}

/*
template <typename captype, typename tcaptype, typename flowtype>
void Graph<captype,tcaptype,flowtype>::reallocate_nodes(int num)
{
Expand Down Expand Up @@ -86,7 +87,9 @@ template <typename captype, typename tcaptype, typename flowtype>
}
}
}
*/

/*
template <typename captype, typename tcaptype, typename flowtype>
void Graph<captype,tcaptype,flowtype>::reallocate_arcs()
{
Expand Down Expand Up @@ -117,5 +120,6 @@ template <typename captype, typename tcaptype, typename flowtype>
}
}
}
*/

#include "instances.inc"
2 changes: 1 addition & 1 deletion src/util/regex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ cElRegex::cElRegex(const std::string & aNameExprIn,int aNbMatchMax,int aCFlag,bo

if (! IsOk())
return;
regmatch_t aMatch;
regmatch_t aMatch{};
mVMatch.reserve(aNbMatchMax);
for (int aK=0; aK<aNbMatchMax ; aK++)
mVMatch.push_back(aMatch);
Expand Down

0 comments on commit acf9943

Please sign in to comment.