aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-08-19 16:31:27 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-08-19 16:31:27 +0200
commit2b3475c853b37b1485e92ef8cf78b02fb0db6142 (patch)
treed2f24a0c787de856ceb3eede89e64c5441412c01
parent846455f9585a7a44af5fb6d019fc76c5612c9d84 (diff)
downloadPROJ-2b3475c853b37b1485e92ef8cf78b02fb0db6142.tar.gz
PROJ-2b3475c853b37b1485e92ef8cf78b02fb0db6142.zip
Code reformatting
-rw-r--r--include/proj/internal/io_internal.hpp2
-rw-r--r--src/filemanager.cpp3
-rw-r--r--src/iso19111/c_api.cpp16
-rw-r--r--src/networkfilemanager.cpp12
-rw-r--r--test/unit/test_c_api.cpp15
5 files changed, 22 insertions, 26 deletions
diff --git a/include/proj/internal/io_internal.hpp b/include/proj/internal/io_internal.hpp
index 31dd70df..8f1c3d68 100644
--- a/include/proj/internal/io_internal.hpp
+++ b/include/proj/internal/io_internal.hpp
@@ -191,7 +191,7 @@ struct projCppContext {
explicit projCppContext(PJ_CONTEXT *ctx, const char *dbPath = nullptr,
const std::vector<std::string> &auxDbPaths = {});
- projCppContext* clone(PJ_CONTEXT *ctx) const;
+ projCppContext *clone(PJ_CONTEXT *ctx) const;
// cppcheck-suppress functionStatic
inline const std::string &getDbPath() const { return dbPath_; }
diff --git a/src/filemanager.cpp b/src/filemanager.cpp
index db0aa2ee..e6a9ed95 100644
--- a/src/filemanager.cpp
+++ b/src/filemanager.cpp
@@ -1986,7 +1986,6 @@ void pj_set_searchpath(int count, const char **path) {
const_cast<const char *const *>(path));
}
-
/************************************************************************/
/* proj_context_set_ca_bundle_path() */
/************************************************************************/
@@ -2012,7 +2011,7 @@ void proj_context_set_ca_bundle_path(PJ_CONTEXT *ctx, const char *path) {
if (!ctx)
return;
try {
- ctx->set_ca_bundle_path(path != nullptr ? path : "");
+ ctx->set_ca_bundle_path(path != nullptr ? path : "");
} catch (const std::exception &) {
}
}
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index 6e07e54c..2e968985 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -125,12 +125,9 @@ projCppContext::toVector(const char *const *auxDbPaths) {
// ---------------------------------------------------------------------------
-projCppContext* projCppContext::clone(PJ_CONTEXT *ctx) const {
- projCppContext* newContext = new projCppContext(
- ctx,
- getDbPath().c_str(),
- getAuxDbPaths()
- );
+projCppContext *projCppContext::clone(PJ_CONTEXT *ctx) const {
+ projCppContext *newContext =
+ new projCppContext(ctx, getDbPath().c_str(), getAuxDbPaths());
newContext->setAutoCloseDb(getAutoCloseDb());
return newContext;
}
@@ -815,8 +812,8 @@ int PROJ_DLL proj_grid_get_info_from_database(
if (!db_context->lookForGridInfo(
grid_name, false, ctx->get_cpp_context()->lastGridFullName_,
ctx->get_cpp_context()->lastGridPackageName_,
- ctx->get_cpp_context()->lastGridUrl_, direct_download, open_license,
- available)) {
+ ctx->get_cpp_context()->lastGridUrl_, direct_download,
+ open_license, available)) {
ctx->safeAutoCloseDbIfNeeded();
return false;
}
@@ -824,7 +821,8 @@ int PROJ_DLL proj_grid_get_info_from_database(
if (out_full_name)
*out_full_name = ctx->get_cpp_context()->lastGridFullName_.c_str();
if (out_package_name)
- *out_package_name = ctx->get_cpp_context()->lastGridPackageName_.c_str();
+ *out_package_name =
+ ctx->get_cpp_context()->lastGridPackageName_.c_str();
if (out_url)
*out_url = ctx->get_cpp_context()->lastGridUrl_.c_str();
if (out_direct_download)
diff --git a/src/networkfilemanager.cpp b/src/networkfilemanager.cpp
index 7587bb72..f6521ed2 100644
--- a/src/networkfilemanager.cpp
+++ b/src/networkfilemanager.cpp
@@ -1522,7 +1522,8 @@ struct CurlFileHandle {
CurlFileHandle(const CurlFileHandle &) = delete;
CurlFileHandle &operator=(const CurlFileHandle &) = delete;
- explicit CurlFileHandle(const char *url, CURL *handle, const char *ca_bundle_path);
+ explicit CurlFileHandle(const char *url, CURL *handle,
+ const char *ca_bundle_path);
~CurlFileHandle();
static PROJ_NETWORK_HANDLE *
@@ -1594,7 +1595,8 @@ static std::string GetExecutableName() {
// ---------------------------------------------------------------------------
-CurlFileHandle::CurlFileHandle(const char *url, CURL *handle, const char *ca_bundle_path)
+CurlFileHandle::CurlFileHandle(const char *url, CURL *handle,
+ const char *ca_bundle_path)
: m_url(url), m_handle(handle) {
curl_easy_setopt(handle, CURLOPT_URL, m_url.c_str());
@@ -1699,9 +1701,9 @@ PROJ_NETWORK_HANDLE *CurlFileHandle::open(PJ_CONTEXT *ctx, const char *url,
if (!hCurlHandle)
return nullptr;
- auto file =
- std::unique_ptr<CurlFileHandle>(new CurlFileHandle(
- url, hCurlHandle, ctx->ca_bundle_path.empty() ? nullptr : ctx->ca_bundle_path.c_str()));
+ auto file = std::unique_ptr<CurlFileHandle>(new CurlFileHandle(
+ url, hCurlHandle,
+ ctx->ca_bundle_path.empty() ? nullptr : ctx->ca_bundle_path.c_str()));
double oldDelay = MIN_RETRY_DELAY_MS;
std::string headers;
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index 8c9c3dd1..9fe486b7 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -134,15 +134,13 @@ class CApi : public ::testing::Test {
struct PjContextKeeper {
PJ_CONTEXT *m_ctxt = nullptr;
- explicit PjContextKeeper(PJ_CONTEXT *ctxt)
- : m_ctxt(ctxt) {}
+ explicit PjContextKeeper(PJ_CONTEXT *ctxt) : m_ctxt(ctxt) {}
~PjContextKeeper() { proj_context_destroy(m_ctxt); }
PjContextKeeper(const PjContextKeeper &) = delete;
PjContextKeeper &operator=(const PjContextKeeper &) = delete;
};
-
struct ContextKeeper {
PJ_OPERATION_FACTORY_CONTEXT *m_op_ctxt = nullptr;
explicit ContextKeeper(PJ_OPERATION_FACTORY_CONTEXT *op_ctxt)
@@ -4071,9 +4069,8 @@ TEST_F(CApi, proj_context_clone) {
if (!tempdir) {
tempdir = "/tmp";
}
- std::string tmp_filename(
- std::string(tempdir) +
- "/test_proj_context_set_autoclose_database.db");
+ std::string tmp_filename(std::string(tempdir) +
+ "/test_proj_context_set_autoclose_database.db");
f = fopen(tmp_filename.c_str(), "wb");
if (!f) {
std::cerr << "Cannot create " << tmp_filename << std::endl;
@@ -4083,14 +4080,14 @@ TEST_F(CApi, proj_context_clone) {
fclose(f);
auto c_default_path = proj_context_get_database_path(nullptr);
- std::string default_path(c_default_path ? c_default_path: "");
+ std::string default_path(c_default_path ? c_default_path : "");
EXPECT_TRUE(proj_context_set_database_path(nullptr, tmp_filename.c_str(),
nullptr, nullptr));
PJ_CONTEXT *new_ctx = proj_context_create();
EXPECT_TRUE(proj_context_set_database_path(
- nullptr, default_path.empty() ? nullptr : default_path.c_str(),
- nullptr, nullptr));
+ nullptr, default_path.empty() ? nullptr : default_path.c_str(), nullptr,
+ nullptr));
EXPECT_NE(new_ctx, nullptr);
PjContextKeeper keeper_ctxt(new_ctx);