Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 30 additions & 27 deletions modules/hdf5_handler/gctp/src/gctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
static long outdat[MAXPROJ + 1]; /* output dataum array */
static long outzn[MAXPROJ + 1]; /* output zone array */
static double pdout[MAXPROJ + 1][15]; /* output projection parm array */
static long (*hfor_trans[MAXPROJ + 1])();/* forward function pointer array*/
static long (*hinv_trans[MAXPROJ + 1])();/* inverse function pointer array*/
static int (*hfor_trans[MAXPROJ + 1])(double, double, double *, double *);/* forward function pointer array*/
static int (*hinv_trans[MAXPROJ + 1])(double, double, double *, double *);/* inverse function pointer array*/

/* Table of unit codes as specified by state
laws as of 2/1/92 for NAD 1983 State Plane
Expand All @@ -71,39 +71,42 @@
*/

/* Added explicit return type. 6/5/23 */
#if 0
int
gctp(incoor,insys,inzone,inparm,inunit,indatum,ipr,efile,jpr,pfile,outcoor,
outsys,outzone,outparm,outunit,outdatum,fn27,fn83,iflg)

double *incoor; /* input coordinates */
long *insys; /* input projection code */
long *inzone; /* input zone number */
double *inparm; /* input projection parameter array */
long *inunit; /* input units */
long *indatum; /* input datum */
long *ipr; /* printout flag for error messages. 0=screen, 1=file,
#endif
int
gctp(

Check warning on line 80 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This function has 19 parameters, which is greater than the 7 authorized.

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXI&open=AZ1CEWx9WRgqseTcZbXI&pullRequest=1287

Check failure on line 80 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 99 to the 25 allowed.

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXH&open=AZ1CEWx9WRgqseTcZbXH&pullRequest=1287
double *incoor, /* input coordinates */

Check warning on line 81 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "incoor" is "double *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXJ&open=AZ1CEWx9WRgqseTcZbXJ&pullRequest=1287
long *insys, /* input projection code */

Check warning on line 82 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "insys" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXK&open=AZ1CEWx9WRgqseTcZbXK&pullRequest=1287
long *inzone, /* input zone number */

Check warning on line 83 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "inzone" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXL&open=AZ1CEWx9WRgqseTcZbXL&pullRequest=1287
double *inparm, /* input projection parameter array */
long *inunit, /* input units */
long *indatum, /* input datum */

Check warning on line 86 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "indatum" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXM&open=AZ1CEWx9WRgqseTcZbXM&pullRequest=1287
long *ipr, /* printout flag for error messages. 0=screen, 1=file,

Check warning on line 87 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "ipr" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXN&open=AZ1CEWx9WRgqseTcZbXN&pullRequest=1287
2=both*/
char *efile; /* error file name */
long *jpr; /* printout flag for projection parameters 0=screen,
char *efile, /* error file name */
long *jpr, /* printout flag for projection parameters 0=screen,

Check warning on line 90 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "jpr" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXO&open=AZ1CEWx9WRgqseTcZbXO&pullRequest=1287
1=file, 2 = both*/
char *pfile; /* error file name */
double *outcoor; /* output coordinates */
long *outdatum; /* output datum */
long *outsys; /* output projection code */
long *outzone; /* output zone */
double *outparm; /* output projection array */
long *outunit; /* output units */
char fn27[]; /* file name of NAD 1927 parameter file */
char fn83[]; /* file name of NAD 1983 parameter file */
long *iflg; /* error flag */
char *pfile, /* error file name */
double *outcoor, /* output coordinates */
long *outsys, /* output projection code */

Check warning on line 94 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "outsys" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXP&open=AZ1CEWx9WRgqseTcZbXP&pullRequest=1287
long *outzone, /* output zone */

Check warning on line 95 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "outzone" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXQ&open=AZ1CEWx9WRgqseTcZbXQ&pullRequest=1287
double *outparm, /* output projection array */
long *outunit, /* output units */
long *outdatum, /* output datum */

Check warning on line 98 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "outdatum" is "long *".

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXR&open=AZ1CEWx9WRgqseTcZbXR&pullRequest=1287
char fn27[], /* file name of NAD 1927 parameter file */
char fn83[], /* file name of NAD 1983 parameter file */
long *iflg) /* error flag */
{
double x; /* x coordinate */
double y; /* y coordinate */
double factor; /* conversion factor */
double lon; /* longitude */
double lat; /* latitude */
/*double temp; */ /* dummy variable */
double pakr2dm();
double pakr2dm(double ang);

Check warning on line 109 in modules/hdf5_handler/gctp/src/gctp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Move this function declaration outside of this block scope, or if the intent was to declare a variable, use a syntax that avoids the most vexing parse.

See more on https://sonarcloud.io/project/issues?id=opendap-bes-submodules&issues=AZ1CEWx9WRgqseTcZbXS&open=AZ1CEWx9WRgqseTcZbXS&pullRequest=1287
long i,j; /* loop counters */
long ininit_flag; /* input initilization flag */
long outinit_flag; /* output initilization flag */
Expand Down Expand Up @@ -254,10 +257,10 @@
dummy[0] = inparm[0];
dummy[1] = inparm[1];
}
hinv_init((int)*insys,(int)*inzone,dummy,(int)*indatum,fn27,fn83,&iflgval,(int *)hinv_trans);
hinv_init((int)*insys,(int)*inzone,dummy,(int)*indatum,fn27,fn83,&iflgval,hinv_trans);
}
else
hinv_init((int)*insys,(int)*inzone,inparm,(int)*indatum,fn27,fn83,&iflgval,(int *)hinv_trans);
hinv_init((int)*insys,(int)*inzone,inparm,(int)*indatum,fn27,fn83,&iflgval,hinv_trans);
*iflg=(long)iflgval;

if ((int)*iflg != 0)
Expand Down Expand Up @@ -316,10 +319,10 @@
dummy[0] = outparm[0];
dummy[1] = outparm[1];
}
hfor_init((int)*outsys,(int)*outzone,dummy,(int)*outdatum,fn27,fn83,&iflgval,(int *)hfor_trans);
hfor_init((int)*outsys,(int)*outzone,dummy,(int)*outdatum,fn27,fn83,&iflgval,hfor_trans);
}
else
hfor_init((int)*outsys,(int)*outzone,outparm,(int)*outdatum,fn27,fn83,&iflgval,(int *)hfor_trans);
hfor_init((int)*outsys,(int)*outzone,outparm,(int)*outdatum,fn27,fn83,&iflgval,hfor_trans);

*iflg=(long)iflgval;

Expand Down
1 change: 0 additions & 1 deletion modules/hdf5_handler/gctp/src/merfor.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ double false_east, /* x offset in meters */
double false_north) /* y offset in meters */
{
double temp; /* temporary variable */
double e0fn(),e1fn(),e2fn(),e3fn(); /* functions */

/* Place parameters in static storage for common use
-------------------------------------------------*/
Expand Down
1 change: 0 additions & 1 deletion modules/hdf5_handler/gctp/src/merinv.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ double false_east, /* x offset in meters */
double false_north) /* y offset in meters */
{
double temp; /* temporary variable */
double e0fn(),e1fn(),e2fn(),e3fn(); /* functions */

/* Place parameters in static storage for common use
-------------------------------------------------*/
Expand Down
1 change: 0 additions & 1 deletion modules/hdf5_handler/gctp/src/somfor.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ double sat_ratio) /* satellite ratio which specify the
long i;
double alf,e2c,e2s,one_es;
double dlam,fb,fa2,fa4,fc1,fc3,suma2,suma4,sumc1,sumc3,sumb;
double adjust_lon();

/* Assign satellite ratio to a global variable
------------------------------------------- */
Expand Down
Loading