Skip to content

Commit

Permalink
Merge pull request #4208 from seanm/misc-warnings
Browse files Browse the repository at this point in the history
Fixed misc warnings
  • Loading branch information
rouault authored Jul 31, 2024
2 parents 79b4f28 + 9e8cdb7 commit 6400b75
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/datums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include "proj.h"

#define PJ_DATUMS_
#include "proj_internal.h"

/*
Expand Down
2 changes: 1 addition & 1 deletion src/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// proj_config.h must be included before testing HAVE_LIBDL
#include "proj_config.h"

#if defined(HAVE_LIBDL) && !defined(_GNU_SOURCE)
#if defined(__CYGWIN__) && defined(HAVE_LIBDL) && !defined(_GNU_SOURCE)
// Required for dladdr() on Cygwin
#define _GNU_SOURCE
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/grids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstring>

NS_PROJ_START

Expand Down Expand Up @@ -1363,8 +1364,6 @@ class GTiffVGridShiftSet : public VerticalShiftGridSet {
}
};

#endif // TIFF_ENABLED

// ---------------------------------------------------------------------------

template <class GridType, class GenericGridType>
Expand Down Expand Up @@ -1429,7 +1428,6 @@ insertIntoHierarchy(PJ_CONTEXT *ctx, std::unique_ptr<GridType> &&grid,
topGrids.emplace_back(std::move(grid));
}

#ifdef TIFF_ENABLED
// ---------------------------------------------------------------------------

class GTiffVGrid : public VerticalShiftGrid {
Expand Down Expand Up @@ -1857,7 +1855,9 @@ NTv1Grid *NTv1Grid::open(PJ_CONTEXT *ctx, std::unique_ptr<File> fp,
swap_words(header + 104, sizeof(double), 1);
}

if (*((int *)(header + 8)) != 12) {
int recordCount;
memcpy(&recordCount, header + 8, sizeof(recordCount));
if (recordCount != 12) {
pj_log(ctx, PJ_LOG_ERROR,
_("NTv1 grid shift file has wrong record count, corrupt?"));
proj_context_errno_set(ctx,
Expand Down
4 changes: 0 additions & 4 deletions test/unit/test_coordinates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ struct ObjectKeeper {
PJ *m_obj = nullptr;
explicit ObjectKeeper(PJ *obj) : m_obj(obj) {}
~ObjectKeeper() { proj_destroy(m_obj); }
void clear() {
proj_destroy(m_obj);
m_obj = nullptr;
}

ObjectKeeper(const ObjectKeeper &) = delete;
ObjectKeeper &operator=(const ObjectKeeper &) = delete;
Expand Down
9 changes: 0 additions & 9 deletions test/unit/test_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2153,15 +2153,6 @@ class FactoryWithTmpDatabase : public ::testing::Test {
}
}

bool get_table(const char *sql, sqlite3 *db = nullptr) {
sqlite3_free_table(m_papszResult);
m_papszResult = nullptr;
m_nRows = 0;
m_nCols = 0;
return sqlite3_get_table(db ? db : m_ctxt, sql, &m_papszResult,
&m_nRows, &m_nCols, nullptr) == SQLITE_OK;
}

bool execute(const std::string &sql) {
return sqlite3_exec(m_ctxt, sql.c_str(), nullptr, nullptr, nullptr) ==
SQLITE_OK;
Expand Down

0 comments on commit 6400b75

Please sign in to comment.