Skip to content
Snippets Groups Projects
Unverified Commit 6b07e29b authored by Austin Sanders's avatar Austin Sanders Committed by GitHub
Browse files

Address compile warnings on ubuntu (#5050)

* Addressed compiler warnings

* Added missing iterator declaration

* Initialize outputpoint

* Updated changelog
parent e5b0fbd7
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ release.
- Fixed bugs in downloadIsisData script [#5024](https://github.com/USGS-Astrogeology/ISIS3/issues/5024)
- Fixed shadow shifting image by 2 pixels to the upper left corner. [#5035](https://github.com/USGS-Astrogeology/ISIS3/issues/5035)
- Fixed compiler warnings on ubuntu [#4911](https://github.com/USGS-Astrogeology/ISIS3/issues/4911)
## [7.1.0] - 2022-07-27
......
......@@ -39,7 +39,7 @@ namespace Isis {
*/
CassiniIssFixDnFunctor(PvlKeyword &stretchPairs, QString dataConversionType, int validMax) {
m_stretch = Stretch();
for (size_t i = 0; i < stretchPairs.size(); i+=2) {
for (size_t i = 0; i < (size_t)stretchPairs.size(); i+=2) {
m_stretch.AddPair(toDouble(stretchPairs[i]),
toDouble(stretchPairs[i + 1]));
}
......@@ -192,7 +192,7 @@ namespace Isis {
//Adjust Table-encoded values from 8 bit back to 12 bit.
PvlKeyword stretchPairs = translation["stretchPairs"];
Stretch stretch;
for (size_t i = 0; i < stretchPairs.size(); i+=2) {
for (size_t i = 0; i < (size_t)stretchPairs.size(); i+=2) {
stretch.AddPair(toDouble(stretchPairs[i]),
toDouble(stretchPairs[i + 1]));
}
......
......@@ -100,7 +100,7 @@ void image_open(char *filename, struct image_header *header, char *mode)
header->bpe = hdr_buf[3];
if(header->bpe == 0)
header->bpe = 8;
text_ptr = (char *) malloc(strlen(((char *)hdr_buf) + IMAGE_LABEL_OFFSET));
text_ptr = (char *) malloc(strlen(((char *)hdr_buf) + IMAGE_LABEL_OFFSET)+1);
strcpy(text_ptr, (char *)(((char *)hdr_buf) + IMAGE_LABEL_OFFSET));
header->label = text_ptr;
header->fd = fd;
......
......@@ -207,7 +207,7 @@ namespace Isis {
zdr.Dump(hiconf.getMatrixSource("DumpModuleFile",hiprof));
}
}
catch(IException e){
catch(IException &e){
if (hiprof.exists("Fallback") && IsTrueValue(hiprof, "Fallback")){
zdrFallback = true;
calVars->add(hiconf.getProfileName(), HiVector(nsamps, 0.0));
......
......@@ -69,12 +69,12 @@ TEST_F(DefaultCube, FunctionalTestCkwriterDefault) {
ASSERT_EQ(newKernelRotation->cacheSize(), originalRotation->cacheSize());
for (int i = 0; i < newKernelRotation->TimeBasedMatrix().size(); i++) {
for (size_t i = 0; i < newKernelRotation->TimeBasedMatrix().size(); i++) {
ASSERT_DOUBLE_EQ(newKernelRotation->TimeBasedMatrix()[i],
originalRotation->TimeBasedMatrix()[i]);
}
for (int i = 0; i < newKernelRotation->AngularVelocity().size(); i++) {
for (size_t i = 0; i < newKernelRotation->AngularVelocity().size(); i++) {
ASSERT_DOUBLE_EQ(newKernelRotation->AngularVelocity()[i],
originalRotation->AngularVelocity()[i]);
}
......@@ -138,12 +138,12 @@ TEST_F(DefaultCube, FunctionalTestCkwriterFromlist) {
ASSERT_EQ(newKernelRotation->cacheSize(), originalRotation->cacheSize());
for (int i = 0; i < newKernelRotation->TimeBasedMatrix().size(); i++) {
for (size_t i = 0; i < newKernelRotation->TimeBasedMatrix().size(); i++) {
ASSERT_DOUBLE_EQ(newKernelRotation->TimeBasedMatrix()[i],
originalRotation->TimeBasedMatrix()[i]);
}
for (int i = 0; i < newKernelRotation->AngularVelocity().size(); i++) {
for (size_t i = 0; i < newKernelRotation->AngularVelocity().size(); i++) {
ASSERT_DOUBLE_EQ(newKernelRotation->AngularVelocity()[i],
originalRotation->AngularVelocity()[i]);
}
......
......@@ -38,7 +38,7 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitDefault) {
std::vector<double> lats = {9.928502, 9.928502, 10.434859, 10.434859, 9.928502};
geos::geom::CoordinateArraySequence coordArray = geos::geom::CoordinateArraySequence(*(boundary->getCoordinates()));
for (int i = 0; i < coordArray.getSize(); i++) {
for (size_t i = 0; i < coordArray.getSize(); i++) {
EXPECT_NEAR(lons[i], coordArray.getAt(i).x, 1e-6);
EXPECT_NEAR(lats[i], coordArray.getAt(i).y, 1e-6);
}
......@@ -60,7 +60,7 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitLincSinc) {
std::vector<double> lats = {9.928500, 9.928500, 10.434861, 10.434861, 9.928500};
geos::geom::CoordinateArraySequence coordArray = geos::geom::CoordinateArraySequence(*(boundary->getCoordinates()));
for (int i = 0; i < coordArray.getSize(); i++) {
for (size_t i = 0; i < coordArray.getSize(); i++) {
EXPECT_NEAR(lons[i], coordArray.getAt(i).x, 1e-6);
EXPECT_NEAR(lats[i], coordArray.getAt(i).y, 1e-6);
}
......@@ -82,7 +82,7 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitVertices) {
std::vector<double> lats = {9.928456, 9.928456, 10.434903, 10.434903, 9.928456};
geos::geom::CoordinateArraySequence coordArray = geos::geom::CoordinateArraySequence(*(boundary->getCoordinates()));
for (int i = 0; i < coordArray.getSize(); i++) {
for (size_t i = 0; i < coordArray.getSize(); i++) {
EXPECT_NEAR(lons[i], coordArray.getAt(i).x, 1e-6);
EXPECT_NEAR(lats[i], coordArray.getAt(i).y, 1e-6);
}
......@@ -104,7 +104,7 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitCamera) {
std::vector<double> lats = {9.924583, 9.924583, 10.329275, 10.329275, 9.924583};
geos::geom::CoordinateArraySequence coordArray = geos::geom::CoordinateArraySequence(*(boundary->getCoordinates()));
for (int i = 0; i < coordArray.getSize(); i++) {
for (size_t i = 0; i < coordArray.getSize(); i++) {
EXPECT_NEAR(lons[i], coordArray.getAt(i).x, 1e-6);
EXPECT_NEAR(lats[i], coordArray.getAt(i).y, 1e-6);
}
......@@ -126,7 +126,7 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitTestXY) {
std::vector<double> lats = {9.928502, 9.928502, 10.434859, 10.434859, 9.928502};
geos::geom::CoordinateArraySequence coordArray = geos::geom::CoordinateArraySequence(*(boundary->getCoordinates()));
for (int i = 0; i < coordArray.getSize(); i++) {
for (size_t i = 0; i < coordArray.getSize(); i++) {
EXPECT_NEAR(lons[i], coordArray.getAt(i).x, 1e-6);
EXPECT_NEAR(lats[i], coordArray.getAt(i).y, 1e-6);
}
......@@ -154,7 +154,7 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitPrecision) {
std::vector<double> lats = {9.928502, 9.928502, 10.434859, 10.434859, 9.928502};
geos::geom::CoordinateArraySequence coordArray = geos::geom::CoordinateArraySequence(*(boundary->getCoordinates()));
for (int i = 0; i < coordArray.getSize(); i++) {
for (size_t i = 0; i < coordArray.getSize(); i++) {
EXPECT_NEAR(lons[i], coordArray.getAt(i).x, 1e-6);
EXPECT_NEAR(lats[i], coordArray.getAt(i).y, 1e-6);
}
......
......@@ -82,7 +82,7 @@ TEST_F(ApolloNetwork, FunctionalTestJigsawApollo) {
EXPECT_EQ(numRows-3, points.length());
ControlPoint* outputPoint;
ControlPoint* outputPoint = nullptr;
for (int i=3; i < numRows; i++) {
csvLine = line.getRow(i);
EXPECT_NO_THROW({
......@@ -174,10 +174,10 @@ TEST_F(ApolloNetwork, FunctionalTestJigsawApollo) {
ControlMeasure* measure;
for (int i=3; i < numRows; i++) {
csvLine = line.getRow(i);
EXPECT_NO_THROW({
ASSERT_NO_THROW({
outputPoint = outputNet.GetPoint(csvLine[0]);
}) << "Point in residuals.csv is not present in output network.";
EXPECT_NO_THROW({
ASSERT_NO_THROW({
measure = outputPoint->GetMeasure(csvLine[2]);
}) << "Point in residuals.csv is not present in output network.";
// Compare sample, line, residuals
......
......@@ -52,10 +52,8 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterDefault) {
newKernelCube.reopen("rw");
Camera *newCamera = nullptr;
try {
newCamera = newKernelCube.camera();
newKernelCube.camera();
} catch(IException &e) {
FAIL() << "Unable to generate camera with new spk kernel: " << e.toString().toStdString().c_str() << std::endl;
}
......@@ -111,10 +109,8 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterFromlist) {
newKernelCube.reopen("rw");
Camera *newCamera = nullptr;
try {
newCamera = newKernelCube.camera();
newKernelCube.camera();
} catch(IException &e) {
FAIL() << "Unable to generate camera with new spk kernel: " << e.toString().toStdString().c_str() << std::endl;
}
......
......@@ -431,13 +431,13 @@ void comparePvlKeywords(PvlKeyword pvlKeyword1, PvlKeyword pvlKeyword2)
EXPECT_TRUE(PvlKeyword::stringEqual(pvlKeyword1.name(), pvlKeyword2.name()));
ASSERT_EQ(pvlKeyword1.comments(), pvlKeyword2.comments());
for (unsigned int comment = 0; comment < pvlKeyword1.comments(); comment++)
for (unsigned int comment = 0; comment < (unsigned int)pvlKeyword1.comments(); comment++)
{
EXPECT_TRUE(PvlKeyword::stringEqual(pvlKeyword1.comment(comment), pvlKeyword2.comment(comment)));
}
ASSERT_EQ(pvlKeyword1.size(), pvlKeyword2.size());
for (unsigned int value = 0; value < pvlKeyword1.size(); value++)
for (unsigned int value = 0; value < (unsigned int)pvlKeyword1.size(); value++)
{
EXPECT_TRUE(PvlKeyword::stringEqual(pvlKeyword1[value], pvlKeyword2[value]));
EXPECT_TRUE(PvlKeyword::stringEqual(pvlKeyword1.unit(value), pvlKeyword2.unit(value)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment