From ccae82ec36d9c5177e3fd24d8d04a1d4c5f7e1ab Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 1 Dec 2018 23:20:33 +0100 Subject: C API: rename parameter to reflect its output status --- src/c_api.cpp | 17 +++++++++-------- src/proj.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/c_api.cpp b/src/c_api.cpp index 30365297..7a991765 100644 --- a/src/c_api.cpp +++ b/src/c_api.cpp @@ -1596,8 +1596,8 @@ PJ_OBJ *proj_obj_get_target_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) { * @param obj Object of type CRS. Must not be NULL * @param auth_name Authority name, or NULL for all authorities * @param options Placeholder for future options. Should be set to NULL. - * @param confidence Output parameter. Pointer to an array of integers that will - * be allocated by the function and filled with the confidence values + * @param out_confidence Output parameter. Pointer to an array of integers that + * will be allocated by the function and filled with the confidence values * (0-100). There are as many elements in this array as * proj_obj_list_get_count() * returns on the return value of this function. *confidence should be @@ -1606,12 +1606,13 @@ PJ_OBJ *proj_obj_get_target_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) { */ PJ_OBJ_LIST *proj_obj_identify(PJ_CONTEXT *ctx, const PJ_OBJ *obj, const char *auth_name, - const char *const *options, int **confidence) { + const char *const *options, + int **out_confidence) { SANITIZE_CTX(ctx); assert(obj); (void)options; - if (confidence) { - *confidence = nullptr; + if (out_confidence) { + *out_confidence = nullptr; } auto ptr = obj->obj.get(); auto crs = dynamic_cast(ptr); @@ -1624,7 +1625,7 @@ PJ_OBJ_LIST *proj_obj_identify(PJ_CONTEXT *ctx, const PJ_OBJ *obj, auth_name ? auth_name : ""); auto res = crs->identify(factory); std::vector objects; - confidenceTemp = confidence ? new int[res.size()] : nullptr; + confidenceTemp = out_confidence ? new int[res.size()] : nullptr; size_t i = 0; for (const auto &pair : res) { objects.push_back(pair.first); @@ -1634,8 +1635,8 @@ PJ_OBJ_LIST *proj_obj_identify(PJ_CONTEXT *ctx, const PJ_OBJ *obj, } } auto ret = internal::make_unique(std::move(objects)); - if (confidence) { - *confidence = confidenceTemp; + if (out_confidence) { + *out_confidence = confidenceTemp; confidenceTemp = nullptr; } return ret.release(); diff --git a/src/proj.h b/src/proj.h index 18731328..c41a2770 100644 --- a/src/proj.h +++ b/src/proj.h @@ -658,7 +658,7 @@ PJ_OBJ_LIST PROJ_DLL *proj_obj_identify(PJ_CONTEXT *ctx, const PJ_OBJ* obj, const char *auth_name, const char* const *options, - int **confidence); + int **out_confidence); void PROJ_DLL proj_free_int_list(int* list); -- cgit v1.2.3