From 7042fa32fb1839a56e07ce33fec6b75b52785859 Mon Sep 17 00:00:00 2001 From: Charles Villard Date: Wed, 31 May 2023 18:48:26 +0200 Subject: [PATCH] edit: all: fix compilation issue for gcc 13.1 --- src/photogram/DataBase.cpp | 3 +- src/uti_image/CPP_Vignette.cpp | 51 ++++++++++++----------- src/uti_phgrm/GraphCut/QPBO-v1.4/QPBO.cpp | 4 +- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/photogram/DataBase.cpp b/src/photogram/DataBase.cpp index 8d8e0c28fb..808e534c81 100755 --- a/src/photogram/DataBase.cpp +++ b/src/photogram/DataBase.cpp @@ -239,7 +239,8 @@ std::string cInterfChantierNameManipulateur::DBNameTransfo std::string aName = aNameInit; std::string aSep = aDBNT.Separateur().Val(); int aMode = MMUserEnv().VersionNameCam().ValWithDef(1); - const cMetaDataPhoto & aMDP = cMetaDataPhoto::CreateExiv2(mDir+aName); + auto path = mDir+aName; + const cMetaDataPhoto & aMDP = cMetaDataPhoto::CreateExiv2(path); double aFoc = aMDP.FocMm(true); std::string aCompl = ""; diff --git a/src/uti_image/CPP_Vignette.cpp b/src/uti_image/CPP_Vignette.cpp index eb4cce5ea4..656a9507cb 100755 --- a/src/uti_image/CPP_Vignette.cpp +++ b/src/uti_image/CPP_Vignette.cpp @@ -479,7 +479,8 @@ vector Make_Grp(std::string aDir, std::string InCal, std::vector { code_assert(node_num_max_new > node_shift/((int)sizeof(Node))); Node* nodes_old[2] = { nodes[0], nodes[1] }; - + auto size = ((char*)nodes_old[1] - (char*)nodes_old[0]); int node_num_max = node_num_max_new; nodes[0] = (Node*) realloc(nodes_old[0], 2*node_num_max*sizeof(Node)); if (!nodes[0]) { if (error_function) (*error_function)("Not enough memory!"); exit(1); } @@ -202,7 +202,7 @@ template node_max[1] = nodes[1] + node_num_max; if (stage) { - memmove(nodes[1], (char*)nodes[0] + ((char*)nodes_old[1] - (char*)nodes_old[0]), node_num*sizeof(Node)); + memmove(nodes[1], (char*)nodes[0] + size, node_num*sizeof(Node)); } Arc* a;