Skip to content

Commit

Permalink
Make a few more functions that accept a 'PJ*' to actually acccept a '…
Browse files Browse the repository at this point in the history
…const PJ*'
  • Loading branch information
rouault committed Mar 9, 2024
1 parent ca6d011 commit 7bda4e1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
22 changes: 10 additions & 12 deletions src/iso19111/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3457,7 +3457,7 @@ PJ *proj_create_geographic_crs(PJ_CONTEXT *ctx, const char *crs_name,
double prime_meridian_offset,
const char *pm_angular_units,
double pm_angular_units_conv,
PJ *ellipsoidal_cs) {
const PJ *ellipsoidal_cs) {

SANITIZE_CTX(ctx);
auto cs = std::dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->iso_obj);
Expand Down Expand Up @@ -3496,8 +3496,8 @@ PJ *proj_create_geographic_crs(PJ_CONTEXT *ctx, const char *crs_name,
* proj_destroy(), or NULL in case of error.
*/
PJ *proj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx, const char *crs_name,
PJ *datum_or_datum_ensemble,
PJ *ellipsoidal_cs) {
const PJ *datum_or_datum_ensemble,
const PJ *ellipsoidal_cs) {

SANITIZE_CTX(ctx);
if (datum_or_datum_ensemble == nullptr) {
Expand Down Expand Up @@ -3811,7 +3811,7 @@ PJ *proj_create_vertical_crs_ex(
* proj_destroy(), or NULL in case of error.
*/
PJ *proj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
PJ *horiz_crs, PJ *vert_crs) {
const PJ *horiz_crs, const PJ *vert_crs) {

SANITIZE_CTX(ctx);
if (!horiz_crs || !vert_crs) {
Expand Down Expand Up @@ -4517,14 +4517,12 @@ PJ *proj_create_conversion(PJ_CONTEXT *ctx, const char *name,
* proj_destroy(), or NULL in case of error.
*/

PJ *proj_create_transformation(PJ_CONTEXT *ctx, const char *name,
const char *auth_name, const char *code,
PJ *source_crs, PJ *target_crs,
PJ *interpolation_crs, const char *method_name,
const char *method_auth_name,
const char *method_code, int param_count,
const PJ_PARAM_DESCRIPTION *params,
double accuracy) {
PJ *proj_create_transformation(
PJ_CONTEXT *ctx, const char *name, const char *auth_name, const char *code,
const PJ *source_crs, const PJ *target_crs, const PJ *interpolation_crs,
const char *method_name, const char *method_auth_name,
const char *method_code, int param_count,
const PJ_PARAM_DESCRIPTION *params, double accuracy) {
SANITIZE_CTX(ctx);
if (!source_crs || !target_crs) {
proj_context_errno_set(ctx, PROJ_ERR_OTHER_API_MISUSE);
Expand Down
2 changes: 1 addition & 1 deletion src/pr_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pj_pr_list(PJ *P) {
/* +init= calls and +datum= definitions would be expanded. */
/************************************************************************/

char *pj_get_def(PJ *P, int options)
char *pj_get_def(const PJ *P, int options)

{
paralist *t;
Expand Down
15 changes: 8 additions & 7 deletions src/proj.h
Original file line number Diff line number Diff line change
Expand Up @@ -1643,12 +1643,13 @@ PJ PROJ_DLL *proj_create_geographic_crs(
PJ_CONTEXT *ctx, const char *crs_name, const char *datum_name,
const char *ellps_name, double semi_major_metre, double inv_flattening,
const char *prime_meridian_name, double prime_meridian_offset,
const char *pm_angular_units, double pm_units_conv, PJ *ellipsoidal_cs);
const char *pm_angular_units, double pm_units_conv,
const PJ *ellipsoidal_cs);

PJ PROJ_DLL *proj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
const char *crs_name,
PJ *datum_or_datum_ensemble,
PJ *ellipsoidal_cs);
PJ PROJ_DLL *
proj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx, const char *crs_name,
const PJ *datum_or_datum_ensemble,
const PJ *ellipsoidal_cs);

PJ PROJ_DLL *proj_create_geocentric_crs(
PJ_CONTEXT *ctx, const char *crs_name, const char *datum_name,
Expand Down Expand Up @@ -1721,7 +1722,7 @@ PJ PROJ_DLL *proj_create_vertical_crs_ex(
const char *const *options);

PJ PROJ_DLL *proj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
PJ *horiz_crs, PJ *vert_crs);
const PJ *horiz_crs, const PJ *vert_crs);

PJ PROJ_DLL *proj_create_conversion(PJ_CONTEXT *ctx, const char *name,
const char *auth_name, const char *code,
Expand All @@ -1732,7 +1733,7 @@ PJ PROJ_DLL *proj_create_conversion(PJ_CONTEXT *ctx, const char *name,

PJ PROJ_DLL *proj_create_transformation(
PJ_CONTEXT *ctx, const char *name, const char *auth_name, const char *code,
PJ *source_crs, PJ *target_crs, PJ *interpolation_crs,
const PJ *source_crs, const PJ *target_crs, const PJ *interpolation_crs,
const char *method_name, const char *method_auth_name,
const char *method_code, int param_count,
const PJ_PARAM_DESCRIPTION *params, double accuracy);
Expand Down
2 changes: 1 addition & 1 deletion src/proj_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ PJ_LPZ pj_inv3d(PJ_XYZ, PJ *);

void pj_clear_initcache(void);
void PROJ_DLL pj_pr_list(PJ *); /* used by proj.cpp */
char *pj_get_def(PJ *, int);
char *pj_get_def(const PJ *, int);
int pj_has_inverse(PJ *);

char *pj_strdup(const char *str);
Expand Down

0 comments on commit 7bda4e1

Please sign in to comment.