diff --git a/src/Makefile.am b/src/Makefile.am
index 3017766..7dc2855 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,6 +26,7 @@
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+AM_CFLAGS = -Wall -Wimplicit-function-declaration
if USE_MODEL
FFTSOURCE = fft.c
PATTERNSOURCE = pattern.c
diff --git a/src/wcs/Makefile.am b/src/wcs/Makefile.am
index c78afe1..b8f7956 100644
--- a/src/wcs/Makefile.am
+++ b/src/wcs/Makefile.am
@@ -25,10 +25,11 @@
# along with AstrOmatic software.
# If not, see .
#
-# Last modified: 10/10/2010
+# Last modified: 2025-01-22 (added -Wall)
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+AM_CFLAGS= -Wall
noinst_LIBRARIES = libwcs_c.a
libwcs_c_a_SOURCES = cel.c lin.c poly.c proj.c sph.c tnx.c wcs.c \
wcstrig.c \
diff --git a/src/wcs/cel.c b/src/wcs/cel.c
index 5db23c9..de1ae5c 100644
--- a/src/wcs/cel.c
+++ b/src/wcs/cel.c
@@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 18/04/2012
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -308,12 +308,7 @@ const char *celrev_errmsg[] = {
"Invalid value of (x,y)"};
-int celset(pcode, cel, prj)
-
-const char pcode[4];
-struct celprm *cel;
-struct prjprm *prj;
-
+int celset(const char pcode[4], struct celprm *cel, struct prjprm *prj)
{
int dophip;
const double tol = 1.0e-10;
@@ -565,15 +560,8 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int celfwd(pcode, lng, lat, cel, phi, theta, prj, x, y)
-
-const char pcode[4];
-const double lng, lat;
-struct celprm *cel;
-double *phi, *theta;
-struct prjprm *prj;
-double *x, *y;
-
+int celfwd(const char pcode[4], const double lng, const double lat, struct celprm *cel,
+ double *phi, double *theta, struct prjprm *prj, double *x, double *y)
{
int err;
@@ -594,15 +582,8 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int celrev(pcode, x, y, prj, phi, theta, cel, lng, lat)
-
-const char pcode[4];
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-struct celprm *cel;
-double *lng, *lat;
-
+int celrev(const char pcode[4], const double x, const double y, struct prjprm *prj,
+ double *phi, double *theta, struct celprm *cel, double * lng, double *lat)
{
int err;
diff --git a/src/wcs/cel.h b/src/wcs/cel.h
index 9061f93..395a062 100644
--- a/src/wcs/cel.h
+++ b/src/wcs/cel.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* cel.h
*
@@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 11/04/2012
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -58,9 +59,6 @@
* $Id: cel.h,v 1.1.1.1 2012/04/11 16:33:26 bertin Exp $
*===========================================================================*/
-#ifndef WCSLIB_CEL
-#define WCSLIB_CEL
-
#include "proj.h"
#ifdef __cplusplus
@@ -115,5 +113,3 @@ extern const char *celrev_errmsg[];
#ifdef __cplusplus
}
#endif
-
-#endif /* WCSLIB_CEL */
diff --git a/src/wcs/lin.c b/src/wcs/lin.c
index d036db7..9a97bb1 100644
--- a/src/wcs/lin.c
+++ b/src/wcs/lin.c
@@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -198,10 +198,7 @@ const char *linrev_errmsg[] = {
"Memory allocation error",
"PC matrix is singular"};
-int linset(lin)
-
-struct linprm *lin;
-
+int linset(struct linprm *lin)
{
int i, ij, j, mem, n;
@@ -235,12 +232,7 @@ struct linprm *lin;
/*--------------------------------------------------------------------------*/
-int linfwd(imgcrd, lin, pixcrd)
-
-const double imgcrd[];
-struct linprm *lin;
-double pixcrd[];
-
+int linfwd(const double imgcrd[], struct linprm *lin, double pixcrd[])
{
int i, ij, j, n;
@@ -266,12 +258,7 @@ double pixcrd[];
/*--------------------------------------------------------------------------*/
-int linrev(pixcrd, lin, imgcrd)
-
-const double pixcrd[];
-struct linprm *lin;
-double imgcrd[];
-
+int linrev(const double pixcrd[], struct linprm *lin, double imgcrd[])
{
int i, ij, j, n;
double temp;
@@ -298,12 +285,7 @@ double imgcrd[];
/*--------------------------------------------------------------------------*/
-int matinv(n, mat, inv)
-
-const int n;
-const double mat[];
-double inv[];
-
+int matinv(const int n, const double mat[], double inv[])
{
register int i, ij, ik, j, k, kj, pj;
int itemp, mem, *mxl, *lxm, pivot;
diff --git a/src/wcs/lin.h b/src/wcs/lin.h
index 2d3f937..4b1954b 100644
--- a/src/wcs/lin.h
+++ b/src/wcs/lin.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* lin.h
*
@@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -58,9 +59,6 @@
* $Id: lin.h,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*===========================================================================*/
-#ifndef WCSLIB_LIN
-#define WCSLIB_LIN
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -101,5 +99,3 @@ extern const char *linrev_errmsg[];
#ifdef __cplusplus
};
#endif
-
-#endif /* WCSLIB_LIN */
diff --git a/src/wcs/poly.c b/src/wcs/poly.c
index 6ce965c..cf58b1a 100644
--- a/src/wcs/poly.c
+++ b/src/wcs/poly.c
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 20/11/2012
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -481,15 +481,16 @@ int poly_fit(polystruct *poly, double *x, double *y, double *w, int ndata,
coeff = poly->coeff;
for (j=ncoeff; j--;)
*(coeff++) = *(betat++);
-/*
+#if 0
poly_addcste(poly, offset);
-*/
+#endif
free(beta);
return info;
}
+#if 0
/****** poly_addcste *********************************************************
PROTO void poly_addcste(polystruct *poly, double *cste)
PURPOSE Modify matrix coefficients to mimick the effect of adding a cst to
@@ -572,6 +573,7 @@ void poly_addcste(polystruct *poly, double *cste)
return;
}
+#endif /* 0 */
/****** poly_solve ************************************************************
diff --git a/src/wcs/poly.h b/src/wcs/poly.h
index af839a0..b840622 100644
--- a/src/wcs/poly.h
+++ b/src/wcs/poly.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* poly.h
*
@@ -23,13 +24,10 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 20/11/2012
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#ifndef _POLY_H_
-#define _POLY_H_
-
/*--------------------------------- constants -------------------------------*/
#define POLY_MAXDIM 4 /* Max dimensionality of polynom */
@@ -68,8 +66,11 @@ extern int cholsolve(double *a, double *b, int n),
*poly_powers(polystruct *poly),
poly_solve(double *a, double *b, int n);
-extern void poly_addcste(polystruct *poly, double *cste),
- poly_end(polystruct *poly);
+#if 0
+ /* not used */
+extern void poly_addcste(polystruct *poly, double *cste);
+#endif
+extern void poly_end(polystruct *poly);
extern double *poly_deortho(polystruct *poly, double *datain,
double *dataout),
@@ -77,6 +78,3 @@ extern double *poly_deortho(polystruct *poly, double *datain,
double *dataout);
extern void poly_initortho(polystruct *poly, double *data,
int ndata);
-
-#endif
-
diff --git a/src/wcs/proj.c b/src/wcs/proj.c
index 2f39aff..98e144e 100644
--- a/src/wcs/proj.c
+++ b/src/wcs/proj.c
@@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*============================================================================
@@ -272,10 +272,7 @@ const char *prjrev_errmsg[] = {
* -1/mu for |mu| >= 1.
*===========================================================================*/
-int azpset(prj)
-
-struct prjprm *prj;
-
+int azpset(struct prjprm * prj)
{
if (prj->r0 == 0.0) prj->r0 = R2D;
@@ -302,12 +299,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int azpfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int azpfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double r, s, sthe;
@@ -335,12 +327,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int azprev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int azprev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double r, rho, s;
const double tol = 1.0e-13;
@@ -377,10 +364,7 @@ double *phi, *theta;
* prj->r0 r0; reset to 180/pi if 0.
*===========================================================================*/
-int tanset(prj)
-
-struct prjprm *prj;
-
+int tanset(struct prjprm *prj)
{
int k;
@@ -403,12 +387,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int tanfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int tanfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double r, s, xp[2];
@@ -434,12 +413,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int tanrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int tanrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double xp,yp, rp;
@@ -480,10 +454,7 @@ double *phi, *theta;
* prj->w[4] alpha**2 + beta**2 - 1
*===========================================================================*/
-int sinset(prj)
-
-struct prjprm *prj;
-
+int sinset(struct prjprm * prj)
{
if (prj->r0 == 0.0) prj->r0 = R2D;
@@ -504,12 +475,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int sinfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int sinfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double cphi, cthe, sphi, t, z;
@@ -555,12 +521,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int sinrev (x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int sinrev (const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
const double tol = 1.0e-13;
double a, b, c, d, r2, sth, sth1, sth2, sxy, x0, xp, y0, yp, z;
@@ -651,10 +612,7 @@ double *phi, *theta;
* prj->w[1] 1/(2*r0)
*===========================================================================*/
-int stgset(prj)
-
-struct prjprm *prj;
-
+int stgset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -671,12 +629,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int stgfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int stgfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double r, s;
@@ -698,12 +651,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int stgrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int stgrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double r;
@@ -731,10 +679,7 @@ double *phi, *theta;
* prj->w[1] (180/pi)/r0
*===========================================================================*/
-int arcset(prj)
-
-struct prjprm *prj;
-
+int arcset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -752,12 +697,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int arcfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int arcfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double r;
@@ -774,12 +714,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int arcrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int arcrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double r;
@@ -811,10 +746,7 @@ double *phi, *theta;
* prj->w[1] Radius of the first point of inflection (N > 2).
*===========================================================================*/
-int zpnset(prj)
-
-struct prjprm *prj;
-
+int zpnset(struct prjprm *prj)
{
int i, j, k;
double d, d1, d2, r, zd, zd1, zd2;
@@ -893,12 +825,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int zpnfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int zpnfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
int j;
double r, s;
@@ -926,12 +853,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int zpnrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int zpnrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
int i, j, k;
double a, b, c, d, lambda, r, r1, r2, rt, zd, zd1, zd2;
@@ -1047,10 +969,7 @@ double *phi, *theta;
* prj->w[1] 1/(2*r0)
*===========================================================================*/
-int zeaset(prj)
-
-struct prjprm *prj;
-
+int zeaset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -1068,12 +987,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int zeafwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int zeafwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double r;
@@ -1090,12 +1004,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int zearev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int zearev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double r, s;
const double tol = 1.0e-12;
@@ -1144,10 +1053,7 @@ double *phi, *theta;
* prj->w[6] (180/pi)/prj->w[2]
*===========================================================================*/
-int airset(prj)
-
-struct prjprm *prj;
-
+int airset(struct prjprm *prj)
{
const double tol = 1.0e-4;
double cxi;
@@ -1178,12 +1084,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int airfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int airfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double cxi, r, txi, xi;
@@ -1214,12 +1115,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int airrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int airrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
int j;
double cxi, lambda, r, r1, r2, rt, txi, x1, x2, xi;
@@ -1305,10 +1201,7 @@ double *phi, *theta;
* prj->w[3] 1/(r0*(mu + lambda))
*===========================================================================*/
-int cypset(prj)
-
-struct prjprm *prj;
-
+int cypset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -1349,12 +1242,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int cypfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int cypfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double s;
@@ -1375,12 +1263,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int cyprev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int cyprev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double eta;
@@ -1408,10 +1291,7 @@ double *phi, *theta;
* prj->w[1] (180/pi)/r0
*===========================================================================*/
-int carset(prj)
-
-struct prjprm *prj;
-
+int carset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
@@ -1430,12 +1310,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int carfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int carfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
if (prj->flag != PRJSET) {
if (carset(prj)) return 1;
@@ -1449,12 +1324,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int carrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int carrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
if (prj->flag != PRJSET) {
if (carset(prj)) return 1;
@@ -1479,10 +1349,7 @@ double *phi, *theta;
* prj->w[1] (180/pi)/r0
*===========================================================================*/
-int merset(prj)
-
-struct prjprm *prj;
-
+int merset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -1500,12 +1367,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int merfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int merfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
if (prj->flag != PRJSET) {
if (merset(prj)) return 1;
@@ -1523,12 +1385,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int merrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int merrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
if (prj->flag != PRJSET) {
if (merset(prj)) return 1;
@@ -1559,10 +1416,7 @@ double *phi, *theta;
* prj->w[3] lambda/r0
*===========================================================================*/
-int ceaset(prj)
-
-struct prjprm *prj;
-
+int ceaset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -1590,12 +1444,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int ceafwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int ceafwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
if (prj->flag != PRJSET) {
if (ceaset(prj)) return 1;
@@ -1609,12 +1458,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int cearev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int cearev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double s;
const double tol = 1.0e-13;
@@ -1659,10 +1503,7 @@ double *phi, *theta;
* prj->w[5] cot(sigma)
*===========================================================================*/
-int copset(prj)
-
-struct prjprm *prj;
-
+int copset(struct prjprm *prj)
{
if (prj->r0 == 0.0) prj->r0 = R2D;
@@ -1694,12 +1535,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int copfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int copfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double a, r, s, t;
@@ -1728,12 +1564,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int coprev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int coprev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double a, dy, r;
@@ -1773,10 +1604,7 @@ double *phi, *theta;
* prj->w[3] Y0 + sigma
*===========================================================================*/
-int codset(prj)
-
-struct prjprm *prj;
-
+int codset(struct prjprm *prj)
{
if (prj->r0 == 0.0) prj->r0 = R2D;
@@ -1801,12 +1629,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int codfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int codfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double a, r;
@@ -1825,12 +1648,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int codrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int codrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double a, dy, r;
@@ -1875,10 +1693,7 @@ double *phi, *theta;
* prj->w[8] chi*sqrt(psi + 2C)
*===========================================================================*/
-int coeset(prj)
-
-struct prjprm *prj;
-
+int coeset(struct prjprm *prj)
{
double theta1, theta2;
@@ -1910,12 +1725,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int coefwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int coefwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double a, r;
@@ -1938,12 +1748,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int coerev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int coerev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double a, dy, r, w;
const double tol = 1.0e-12;
@@ -2002,10 +1807,7 @@ double *phi, *theta;
* prj->w[4] 1/psi
*===========================================================================*/
-int cooset(prj)
-
-struct prjprm *prj;
-
+int cooset(struct prjprm * prj)
{
double cos1, cos2, tan1, tan2, theta1, theta2;
@@ -2044,12 +1846,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int coofwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int coofwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double a, r;
@@ -2076,12 +1873,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int coorev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int coorev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double a, dy, r;
@@ -2125,10 +1917,7 @@ double *phi, *theta;
* prj->w[2] Y0 = r0*cot(theta1) + theta1*pi/180)
*===========================================================================*/
-int bonset(prj)
-
-struct prjprm *prj;
-
+int bonset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -2146,12 +1935,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int bonfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int bonfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double a, r;
@@ -2175,12 +1959,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int bonrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int bonrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double a, dy, costhe, r;
@@ -2224,10 +2003,7 @@ double *phi, *theta;
* prj->w[2] 2*r0
*===========================================================================*/
-int pcoset(prj)
-
-struct prjprm *prj;
-
+int pcoset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -2247,12 +2023,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int pcofwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int pcofwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double a, costhe, cotthe, sinthe;
@@ -2278,12 +2049,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int pcorev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int pcorev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
int j;
double f, fneg, fpos, lambda, tanthe, theneg, thepos, w, xp, xx, ymthe, yp;
@@ -2369,10 +2135,7 @@ double *phi, *theta;
* prj->w[1] (180/pi)/r0
*===========================================================================*/
-int glsset(prj)
-
-struct prjprm *prj;
-
+int glsset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -2390,12 +2153,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int glsfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int glsfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
if (prj->flag != PRJSET) {
if (glsset(prj)) return 1;
@@ -2409,12 +2167,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int glsrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int glsrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double w;
@@ -2444,10 +2197,7 @@ double *phi, *theta;
* prj->w[3] 1/(pi*r0)
*===========================================================================*/
-int parset(prj)
-
-struct prjprm *prj;
-
+int parset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -2469,12 +2219,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int parfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int parfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double s;
@@ -2491,12 +2236,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int parrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int parrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double s, t;
@@ -2536,10 +2276,7 @@ double *phi, *theta;
* prj->w[3] 1/(2*r0)
*===========================================================================*/
-int aitset(prj)
-
-struct prjprm *prj;
-
+int aitset(struct prjprm *prj)
{
if (prj->r0 == 0.0) prj->r0 = R2D;
@@ -2555,12 +2292,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int aitfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int aitfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double costhe, w;
@@ -2578,12 +2310,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int aitrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int aitrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double s, u, xp, yp, z;
const double tol = 1.0e-13;
@@ -2633,10 +2360,7 @@ double *phi, *theta;
* prj->w[3] 90/r0
*===========================================================================*/
-int molset(prj)
-
-struct prjprm *prj;
-
+int molset(struct prjprm *prj)
{
if (prj->r0 == 0.0) prj->r0 = R2D;
@@ -2653,12 +2377,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int molfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int molfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
int j;
double alpha, resid, u, v, v0, v1;
@@ -2701,12 +2420,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int molrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int molrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double s, y0, z;
const double tol = 1.0e-12;
@@ -2763,10 +2477,7 @@ double *phi, *theta;
* prj->w[1] (4/pi)/r0
*===========================================================================*/
-int cscset(prj)
-
-struct prjprm *prj;
-
+int cscset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -2784,12 +2495,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int cscfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int cscfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
int face;
double costhe, eta, l, m, n, rho, xi;
@@ -2915,12 +2621,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int cscrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int cscrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
int face;
double l, m, n;
@@ -3063,10 +2764,7 @@ double *phi, *theta;
* prj->w[1] (4/pi)/r0
*===========================================================================*/
-int qscset(prj)
-
-struct prjprm *prj;
-
+int qscset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -3084,12 +2782,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int qscfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int qscfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
int face;
double chi, costhe, eta, l, m, n, p, psi, rho, rhu, t, x0, xf, xi, y0, yf;
@@ -3257,12 +2950,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int qscrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int qscrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
int direct, face;
double chi, l, m, n, psi, rho, rhu, xf, yf, w;
@@ -3434,10 +3122,7 @@ double *phi, *theta;
* prj->w[1] (4/pi)/r0
*===========================================================================*/
-int tscset(prj)
-
-struct prjprm *prj;
-
+int tscset(struct prjprm *prj)
{
if (prj->r0 == 0.0) {
prj->r0 = R2D;
@@ -3455,12 +3140,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int tscfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int tscfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
int face;
double costhe, l, m, n, rho, x0, xf, y0, yf;
@@ -3551,12 +3231,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int tscrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int tscrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double l, m, n, xf, yf;
@@ -3634,10 +3309,7 @@ double *phi, *theta;
* prj->r0 r0; reset to 180/pi if 0.
*===========================================================================*/
-int tnxset(prj)
-
-struct prjprm *prj;
-
+int tnxset(struct prjprm *prj)
{
if (prj->r0 == 0.0) prj->r0 = R2D;
@@ -3652,12 +3324,7 @@ struct prjprm *prj;
/*--------------------------------------------------------------------------*/
-int tnxfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
+int tnxfwd(const double phi, const double theta, struct prjprm *prj, double *x, double *y)
{
double r, s, xp[2];
@@ -3683,12 +3350,7 @@ double *x, *y;
/*--------------------------------------------------------------------------*/
-int tnxrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
+int tnxrev(const double x, const double y, struct prjprm *prj, double *phi, double *theta)
{
double rp,xp,yp;
@@ -3851,4 +3513,3 @@ int raw_to_pv(struct prjprm *prj, double x, double y, double *xo, double *yo)
return 0;
}
-
diff --git a/src/wcs/proj.h b/src/wcs/proj.h
index a3caad7..31cae27 100644
--- a/src/wcs/proj.h
+++ b/src/wcs/proj.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* proj.h
*
@@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -59,9 +60,6 @@
* $Id: proj.h,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*===========================================================================*/
-#ifndef WCSLIB_PROJ
-#define WCSLIB_PROJ
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -186,15 +184,15 @@ struct prjprm {
int tscset(), tscfwd(), tscrev();
int tnxset(), tnxfwd(), tnxrev();
#endif
-/*
+
+#if 0
extern const char *prjset_errmsg[];
extern const char *prjfwd_errmsg[];
extern const char *prjrev_errmsg[];
-*/
+#endif
+
#define PRJSET 137
#ifdef __cplusplus
};
#endif
-
-#endif /* WCSLIB_PROJ */
diff --git a/src/wcs/sph.c b/src/wcs/sph.c
index f31b0c5..eeaeaa2 100644
--- a/src/wcs/sph.c
+++ b/src/wcs/sph.c
@@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*============================================================================
@@ -140,11 +140,7 @@
const double tol = 1.0e-5;
-int sphfwd (lng, lat, eul, phi, theta)
-
-const double lat, lng, eul[5];
-double *phi, *theta;
-
+int sphfwd (const double lng, const double lat, const double eul[5], double *phi, double *theta)
{
double coslat, coslng, dlng, dphi, sinlat, sinlng, x, y, z;
@@ -197,11 +193,7 @@ double *phi, *theta;
/*-----------------------------------------------------------------------*/
-int sphrev (phi, theta, eul, lng, lat)
-
-const double phi, theta, eul[5];
-double *lng, *lat;
-
+int sphrev (const double phi, const double theta, const double eul[5], double *lng, double *lat)
{
double cosphi, costhe, dlng, dphi, sinphi, sinthe, x, y, z;
diff --git a/src/wcs/sph.h b/src/wcs/sph.h
index ef91e35..50740a5 100644
--- a/src/wcs/sph.h
+++ b/src/wcs/sph.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* sph.h
*
@@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -58,9 +59,6 @@
* $Id: sph.h,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*===========================================================================*/
-#ifndef WCSLIB_SPH
-#define WCSLIB_SPH
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -79,5 +77,3 @@ extern "C" {
#ifdef __cplusplus
}
#endif
-
-#endif /* WCSLIB_SPH */
diff --git a/src/wcs/tnx.c b/src/wcs/tnx.c
index a712194..161c146 100644
--- a/src/wcs/tnx.c
+++ b/src/wcs/tnx.c
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
diff --git a/src/wcs/tnx.h b/src/wcs/tnx.h
index 8143a9e..7b20c2e 100644
--- a/src/wcs/tnx.h
+++ b/src/wcs/tnx.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* tnx.h
*
@@ -23,13 +24,10 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#ifndef _TNX_H_
-#define _TNX_H_
-
/*-------------------------------- macros -----------------------------------*/
#define TNX_MAXCHARS 2048 /* Maximum FITS "WAT" string length */
@@ -68,6 +66,3 @@ tnxaxisstruct *copy_tnxaxis(tnxaxisstruct *axis),
double raw_to_tnxaxis(tnxaxisstruct *axis, double x, double y);
void free_tnxaxis(tnxaxisstruct *axis);
-
-#endif
-
diff --git a/src/wcs/wcs.c b/src/wcs/wcs.c
index 5ead8f3..8f6fcf9 100644
--- a/src/wcs/wcs.c
+++ b/src/wcs/wcs.c
@@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -453,12 +453,7 @@ const char *wcsmix_errmsg[] = {
#define wcs_signbit(X) ((X) < 0.0 ? 1 : 0)
-int wcsset (naxis, ctype, wcs)
-
-const int naxis;
-const char ctype[][9];
-struct wcsprm *wcs;
-
+int wcsset (const int naxis, const char ctype[][9], struct wcsprm *wcs)
{
int j, k, *ndx;
char requir[9];
@@ -553,20 +548,9 @@ struct wcsprm *wcs;
/*--------------------------------------------------------------------------*/
-int wcsfwd(ctype, wcs, world, crval, cel, phi, theta, prj, imgcrd, lin,
- pixcrd)
-
-const char ctype[][9];
-struct wcsprm* wcs;
-const double world[];
-const double crval[];
-struct celprm *cel;
-double *phi, *theta;
-struct prjprm *prj;
-double imgcrd[];
-struct linprm *lin;
-double pixcrd[];
-
+int wcsfwd(const char ctype[][9], struct wcsprm* wcs, const double world[],
+ const double crval[], struct celprm *cel, double * phi, double * theta, struct prjprm *prj,
+ double imgcrd[], struct linprm *lin, double pixcrd[])
{
int err, j;
double offset;
@@ -642,20 +626,9 @@ double pixcrd[];
/*--------------------------------------------------------------------------*/
-int wcsrev(ctype, wcs, pixcrd, lin, imgcrd, prj, phi, theta, crval, cel,
- world)
-
-const char ctype[][9];
-struct wcsprm *wcs;
-const double pixcrd[];
-struct linprm *lin;
-double imgcrd[];
-struct prjprm *prj;
-double *phi, *theta;
-const double crval[];
-struct celprm *cel;
-double world[];
-
+int wcsrev(const char ctype[][9], struct wcsprm *wcs, const double pixcrd[],
+ struct linprm *lin, double imgcrd[], struct prjprm *prj, double *phi, double *theta,
+ const double crval[], struct celprm *cel, double world[])
{
int err, face, j;
double offset;
@@ -741,23 +714,10 @@ double world[];
/*--------------------------------------------------------------------------*/
-int wcsmix(ctype, wcs, mixpix, mixcel, vspan, vstep, viter, world, crval, cel,
- phi, theta, prj, imgcrd, lin, pixcrd)
-
-const char ctype[][9];
-struct wcsprm *wcs;
-const int mixpix, mixcel;
-const double vspan[2], vstep;
-int viter;
-double world[];
-const double crval[];
-struct celprm *cel;
-double *phi, *theta;
-struct prjprm *prj;
-double imgcrd[];
-struct linprm *lin;
-double pixcrd[];
-
+int wcsmix(const char ctype[][9], struct wcsprm *wcs, const int mixpix, const int mixcel,
+ const double vspan[2], const double vstep, int viter, double world[], const double crval[],
+ struct celprm * cel, double *phi, double *theta, struct prjprm * prj,
+ double imgcrd[], struct linprm *lin, double pixcrd[])
{
const int niter = 60;
int crossed, err, istep, iter, j, k, nstep, retry;
diff --git a/src/wcs/wcs.h b/src/wcs/wcs.h
index 9f699ba..528c9a6 100644
--- a/src/wcs/wcs.h
+++ b/src/wcs/wcs.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* wcs.h
*
@@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -58,9 +59,6 @@
* $Id: wcs.h,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*===========================================================================*/
-#ifndef WCSLIB_WCS
-#define WCSLIB_WCS
-
#include "cel.h"
#include "lin.h"
@@ -136,5 +134,3 @@ extern const char *wcsmix_errmsg[];
#ifdef __cplusplus
};
#endif
-
-#endif /* WCSLIB_WCS */
diff --git a/src/wcs/wcsmath.h b/src/wcs/wcsmath.h
index 299040c..078cc68 100644
--- a/src/wcs/wcsmath.h
+++ b/src/wcs/wcsmath.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* wcsmath.h
*
@@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -58,9 +59,6 @@
* $Id: wcsmath.h,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*===========================================================================*/
-#ifndef WCSLIB_MATH
-#define WCSLIB_MATH
-
#ifdef PI
#undef PI
#endif
@@ -86,5 +84,3 @@
#define R2D (180.0/PI)
#define SQRT2 1.4142135623730950488
#define SQRT2INV (1.0/SQRT2)
-
-#endif /* WCSLIB_MATH */
diff --git a/src/wcs/wcstrig.c b/src/wcs/wcstrig.c
index 77fa053..6aa1fc0 100644
--- a/src/wcs/wcstrig.c
+++ b/src/wcs/wcstrig.c
@@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*============================================================================
@@ -81,10 +81,7 @@ const double r2d = 180.0 / PI;
#ifndef HAVE_MATHIMF_H
-double wcs_cosd(angle)
-
-const double angle;
-
+double wcs_cosd(const double angle)
{
double resid;
@@ -104,10 +101,7 @@ const double angle;
/*--------------------------------------------------------------------------*/
-double wcs_sind(angle)
-
-const double angle;
-
+double wcs_sind(const double angle)
{
double resid;
@@ -127,10 +121,7 @@ const double angle;
/*--------------------------------------------------------------------------*/
-double wcs_tand(angle)
-
-const double angle;
-
+double wcs_tand(const double angle)
{
double resid;
@@ -148,10 +139,7 @@ const double angle;
/*--------------------------------------------------------------------------*/
-double wcs_acosd(v)
-
-const double v;
-
+double wcs_acosd(const double v)
{
if (v >= 1.0) {
if (v-1.0 < WCSTRIG_TOL) return 0.0;
@@ -166,10 +154,7 @@ const double v;
/*--------------------------------------------------------------------------*/
-double wcs_asind(v)
-
-const double v;
-
+double wcs_asind(const double v)
{
if (v <= -1.0) {
if (v+1.0 > -WCSTRIG_TOL) return -90.0;
@@ -184,10 +169,7 @@ const double v;
/*--------------------------------------------------------------------------*/
-double wcs_atand(v)
-
-const double v;
-
+double wcs_atand(const double v)
{
if (v == -1.0) {
return -45.0;
@@ -202,10 +184,7 @@ const double v;
/*--------------------------------------------------------------------------*/
-double wcs_atan2d(y, x)
-
-const double x, y;
-
+double wcs_atan2d(const double y, const double x)
{
if (y == 0.0) {
if (x >= 0.0) {
diff --git a/src/wcs/wcstrig.h b/src/wcs/wcstrig.h
index 33b4389..84f6f47 100644
--- a/src/wcs/wcstrig.h
+++ b/src/wcs/wcstrig.h
@@ -1,3 +1,4 @@
+#pragma once
/*
* wcstrig.h
*
@@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see .
*
-* Last modified: 10/10/2010
+* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
@@ -57,9 +58,6 @@
* Author: Mark Calabretta, Australia Telescope National Facility
* $Id: wcstrig.h,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*===========================================================================*/
-#ifndef WCSLIB_TRIG
-#define WCSLIB_TRIG
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -100,9 +98,7 @@ extern "C" {
/* Domain tolerance for asin and acos functions. */
#define WCSTRIG_TOL 1e-10
-#endif /* TRIGD */
#ifdef __cplusplus
};
-
-#endif /* WCSLIB_TRIG */
+#endif