Skip to content

Commit

Permalink
mm3d: Fix errors reported by g++ 13.3 (Ubuntu 24.04)
Browse files Browse the repository at this point in the history
  • Loading branch information
meynardc committed Jan 13, 2025
1 parent a7c0449 commit 2eda75b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 54 deletions.
5 changes: 4 additions & 1 deletion src/geom3d/NuageToGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ void cLoadImDist::Load(int argc,char ** argv)
mPts.push_back(cPtLaser(Pt3dr(Rho,Teta,Phi)));
cPtLaser & aP = mPts.back();

for (INT aK=0; aK <mNbAux ; aK++)
// CM: g++ 13.3 (mode Release) warns with "writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]"
// on: aP.mCols[aK] = (U_INT1)mCols[mCanalAux[aK]];
// I replaced [aK <mNbAux] with [aK <std::min(mNbAux,TheNbMax)]. Not sure about that ...
for (INT aK=0; aK <std::min(mNbAux,TheNbMax) ; aK++)
aP.mCols[aK] = (U_INT1)mCols[mCanalAux[aK]];

mNbP++;
Expand Down
95 changes: 45 additions & 50 deletions src/saisieQT/HistoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,74 +128,69 @@ void HistoryManager::save()

const selectInfos &SInfo = _infos[i];

if ((SInfo.mvmatrix != NULL) && (SInfo.projmatrix != NULL) && (SInfo.glViewport != NULL))
{
QString text1, text2;
QString text1, text2;

text1 = QString::number(SInfo.mvmatrix[0], 'f');
text2 = QString::number(SInfo.projmatrix[0], 'f');
text1 = QString::number(SInfo.mvmatrix[0], 'f');
text2 = QString::number(SInfo.projmatrix[0], 'f');

for (int aK=1; aK < 16;++aK)
{
text1 += " " + QString::number(SInfo.mvmatrix[aK], 'f');
text2 += " " + QString::number(SInfo.projmatrix[aK], 'f');
}
for (int aK=1; aK < 16;++aK)
{
text1 += " " + QString::number(SInfo.mvmatrix[aK], 'f');
text2 += " " + QString::number(SInfo.projmatrix[aK], 'f');
}

t = doc.createTextNode(text1);
mvMatrixElem.appendChild(t);
t = doc.createTextNode(text1);
mvMatrixElem.appendChild(t);

t = doc.createTextNode(text2);
ProjMatrixElem.appendChild(t);
t = doc.createTextNode(text2);
ProjMatrixElem.appendChild(t);

text1 = QString::number(SInfo.glViewport[0]) ;
for (int aK=1; aK < 4;++aK)
text1 += " " + QString::number(SInfo.glViewport[aK]);
text1 = QString::number(SInfo.glViewport[0]) ;
for (int aK=1; aK < 4;++aK)
text1 += " " + QString::number(SInfo.glViewport[aK]);

t = doc.createTextNode(text1);
glViewportElem.appendChild(t);
t = doc.createTextNode(text1);
glViewportElem.appendChild(t);

SII.appendChild(mvMatrixElem);
SII.appendChild(ProjMatrixElem);
SII.appendChild(glViewportElem);
SII.appendChild(mvMatrixElem);
SII.appendChild(ProjMatrixElem);
SII.appendChild(glViewportElem);

QVector <QPointF> pts = SInfo.poly;
QVector <QPointF> pts = SInfo.poly;

for (int aK=0; aK < pts.size(); ++aK)
{
QDomElement Point = doc.createElement("Pt");
QDomElement Pt3D = doc.createElement("Pt");
QString str = QString::number(pts[aK].x(), 'f',0) + " " + QString::number(pts[aK].y(), 'f',0);
for (int aK=0; aK < pts.size(); ++aK)
{
QDomElement Point = doc.createElement("Pt");
QDomElement Pt3D = doc.createElement("Pt");
QString str = QString::number(pts[aK].x(), 'f',0) + " " + QString::number(pts[aK].y(), 'f',0);

t = doc.createTextNode( str );
Point.appendChild(t);
SII.appendChild(Point);
t = doc.createTextNode( str );
Point.appendChild(t);
SII.appendChild(Point);

//Export points 3D
//Export points 3D
QVector3D pt3d;
MatrixManager *MM = new MatrixManager();
MM->importMatrices(SInfo);
MM->getInverseProjection(pt3d, pts[aK], 0.f);
MatrixManager *MM = new MatrixManager();
MM->importMatrices(SInfo);
MM->getInverseProjection(pt3d, pts[aK], 0.f);
// str = QString::number(pt3d.x(), 'f') + " " + QString::number(pt3d.y(), 'f') + " " + QString::number(pt3d.z(), 'f');
// MPD : tentative de ne pas perdre betement de la precision qui peut etre genant avec les grande coordonnees ?
str = QString::number(pt3d.x(), 'f',20) + " " + QString::number(pt3d.y(), 'f',20) + " " + QString::number(pt3d.z(), 'f',20);
t = doc2.createTextNode( str );
Pt3D.appendChild(t);
SIt.appendChild(Pt3D);
}
t = doc2.createTextNode( str );
Pt3D.appendChild(t);
SIt.appendChild(Pt3D);
}

t = doc.createTextNode(QString::number(SInfo.selection_mode));
Mode.appendChild(t);
SII.appendChild(Mode);
t = doc.createTextNode(QString::number(SInfo.selection_mode));
Mode.appendChild(t);
SII.appendChild(Mode);

t = doc2.createTextNode(QString::number(SInfo.selection_mode));
Mode2.appendChild(t);
SIt.appendChild(Mode2);
t = doc2.createTextNode(QString::number(SInfo.selection_mode));
Mode2.appendChild(t);
SIt.appendChild(Mode2);

SI.appendChild(SII);
SI2.appendChild(SIt);
}
else
std::cerr << "saveSelectInfos: null matrix";
SI.appendChild(SII);
SI2.appendChild(SIt);
}

doc.appendChild(SI);
Expand Down
6 changes: 3 additions & 3 deletions src/util/bicub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,9 @@ cInterpolSinusCardinal<TypeEl>::cInterpolSinusCardinal(int sizeOfWindow, bool ap
template <class TypeEl>
cInterpolSinusCardinal<TypeEl>::~cInterpolSinusCardinal()
{
delete m_tabX;
delete m_tabY;
delete m_tabTemp;
delete [] m_tabX;
delete [] m_tabY;
delete [] m_tabTemp;
}


Expand Down

0 comments on commit 2eda75b

Please sign in to comment.