New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in-place update of R extension spatial-7.3-14.tar.gz #17233
Comments
Unfortunately a bunch of code changes this time, though it seems harmless enough (assuming it still actually builds): diff -ru spatial/DESCRIPTION spatial_new/DESCRIPTION
--- spatial/DESCRIPTION 2021-05-03 09:03:08.000000000 +0000
+++ spatial_new/DESCRIPTION 2023-01-23 07:10:14.000000000 +0000
@@ -1,7 +1,7 @@
Package: spatial
Priority: recommended
Version: 7.3-14
-Date: 2021-04-17
+Date: 2023-01-23
Depends: R (>= 3.0.0), graphics, stats, utils
Suggests: MASS
Authors@R: c(person("Brian", "Ripley", role = c("aut", "cre", "cph"),
@@ -15,10 +15,10 @@
License: GPL-2 | GPL-3
URL: http://www.stats.ox.ac.uk/pub/MASS4/
NeedsCompilation: yes
-Packaged: 2021-05-03 08:31:23 UTC; ripley
+Packaged: 2023-01-23 06:55:04 UTC; ripley
Author: Brian Ripley [aut, cre, cph],
Roger Bivand [ctb],
William Venables [cph]
Maintainer: Brian Ripley <ripley@stats.ox.ac.uk>
Repository: CRAN
-Date/Publication: 2021-05-03 09:03:08 UTC
+Date/Publication: 2023-01-23 07:10:14 UTC
diff -ru spatial/MD5 spatial_new/MD5
--- spatial/MD5 2021-05-03 09:03:08.000000000 +0000
+++ spatial_new/MD5 2023-01-23 07:10:14.000000000 +0000
@@ -1,4 +1,4 @@
-d91f6a5f05ebf19140902ba4d9eccc46 *DESCRIPTION
+bae80697c4707f36b0d52666e9a92c88 *DESCRIPTION
9d3ab186ed88fca8f9806d8bb4a4fd56 *LICENCE.note
9669a5ba859da001694e764789a4ce73 *NAMESPACE
e917fff38af0195c39197a553712ebd5 *R/kr.R
@@ -65,7 +65,7 @@
10c1ade8e7d014160bbf63b5b6793f0b *po/R-pl.po
014071cd6f6328d8528a29eb7d4a3b6c *po/R-spatial.pot
3951be1f52409800ec73d9786f1f1c25 *src/init.c
-0d8b51911ae2af1c97850551a14fb8dd *src/krc.c
-cb5dbb445d8c7f8150e6ef4216b18278 *src/pps.c
-df5b3ef820841dc1b4fa04fd07291e84 *src/spatial.h
+1c3d61d8127c14767e3b807448ce6819 *src/krc.c
+7915f2384c1510474cc6b72b7548d859 *src/pps.c
+7418be8b11ecd38cca04ed1424dfbc3a *src/spatial.h
f756289c2e9a28b1f56db491dadd2f22 *tests/Examples/spatial-Ex.Rout.save
diff -ru spatial/src/krc.c spatial_new/src/krc.c
--- spatial/src/krc.c 2016-04-21 09:07:15.000000000 +0000
+++ spatial_new/src/krc.c 2022-05-29 09:00:47.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * spatial/src/krc.c by W. N. Venables and B. D. Ripley Copyright (C) 1994-2016
+ * spatial/src/krc.c by W. N. Venables and B. D. Ripley Copyright (C) 1994-2022
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,29 +29,29 @@
/* defines gls ls fmat frset alset valn pred prvar correlogram variogram */
static void dscale(double, double, double *, double *);
-static void cholcov(double *, double *, double *, int, Sint *);
+static void cholcov(double *, double *, double *, int, int *);
static void householder(double *, double *, double *, double *,
- int, int, Sint *);
-static void chols(int, double *, double *, Sint *);
+ int, int, int *);
+static void chols(int, double *, double *, int *);
static void solv(double *, double *, int, double *, double *);
static void fsolv(double *, double *, int, double *);
static void bsolv(double *, double *, int, double *);
static void house_rhs(double *, double *, double *, int, int,
double *, double *);
-static double val(double, double, double *, Sint *);
+static double val(double, double, double *, int *);
static double *alph1 = NULL;
static double xl1, xu1, yl1, yu1;
void
-VR_alset(Sfloat *alph, Sint *nalph)
+VR_alset(double *alph, int *nalph)
{
int i;
if (alph1 != NULL)
- alph1 = Realloc(alph1, *nalph, double);
+ alph1 = R_Realloc(alph1, *nalph, double);
else
- alph1 = Calloc(*nalph, double);
+ alph1 = R_Calloc(*nalph, double);
for (i = 0; i < *nalph; ++i)
alph1[i] = alph[i];
}
@@ -88,13 +88,13 @@
}
void
-VR_gls(double *x, double *y, double *z, Sint *n, Sint *np,
- Sint *npar, double *f, double *l, double *r, double *bz,
- double *wz, double *yy, double *w, Sint *ifail, double *l1f)
+VR_gls(double *x, double *y, double *z, int *n, int *np,
+ int *npar, double *f, double *l, double *r, double *bz,
+ double *wz, double *yy, double *w, int *ifail, double *l1f)
{
double b[28];
- Sint i, j;
- Sint i1;
+ int i, j;
+ int i1;
double *w1, *w2;
double *lf, *nu;
@@ -116,10 +116,10 @@
of the covariance matrix */
- lf = Calloc(*n * *npar, double);
- nu = Calloc(*n * *npar, double);
- w1 = Calloc(*n, double);
- w2 = Calloc(*n, double);
+ lf = R_Calloc(*n * *npar, double);
+ nu = R_Calloc(*n * *npar, double);
+ w1 = R_Calloc(*n, double);
+ w2 = R_Calloc(*n, double);
cholcov(x, y, l, *n, ifail);
if (*ifail > 0)
return;
@@ -146,19 +146,19 @@
wz[i] = z[i] - val(x[i], y[i], bz, np);
solv(yy, wz, *n, l, l);
fsolv(w, wz, *n, l);
- Free(lf);
- Free(nu);
- Free(w1);
- Free(w2);
+ R_Free(lf);
+ R_Free(nu);
+ R_Free(w1);
+ R_Free(w2);
}
void
-VR_ls(double *x, double *y, double *z, Sint *n, Sint *np,
- Sint *npar, double *f, double *r, double *bz, double *wz,
- Sint *ifail)
+VR_ls(double *x, double *y, double *z, int *n, int *np,
+ int *npar, double *f, double *r, double *bz, double *wz,
+ int *ifail)
{
double b[28];
- Sint i, j, k;
+ int i, j, k;
double *fw, *nu;
/* Least squares estimation of parameters of spatial regression for
@@ -170,8 +170,8 @@
i.e. the decomposition of F.
Copy F matrix to FW for use in householder */
- fw = Calloc(*n * *npar, double);
- nu = Calloc(*n * *npar, double);
+ fw = R_Calloc(*n * *npar, double);
+ nu = R_Calloc(*n * *npar, double);
k = 0;
for (i = 1; i <= *npar; ++i)
for (j = 1; j <= *n; ++j) {
@@ -184,13 +184,13 @@
house_rhs(nu, b, r, *n, *npar, z, bz);
for (i = 0; i < *n; ++i)
wz[i] = z[i] - val(x[i], y[i], bz, np);
- Free(fw);
- Free(nu);
+ R_Free(fw);
+ R_Free(nu);
}
/* -------------------------------------------------------------------- */
void
-VR_fmat(double *f, double *x, double *y, Sint *n, Sint *np)
+VR_fmat(double *f, double *x, double *y, int *n, int *np)
{
int i, j, k, k1;
double *xs, *ys;
@@ -198,8 +198,8 @@
/* FMAT evaluates the 'regression' matrix F (scaled to [-1,+1]x[-1,+1] to
avoid excessively large or small values) */
- xs = Calloc(*n, double);
- ys = Calloc(*n, double);
+ xs = R_Calloc(*n, double);
+ ys = R_Calloc(*n, double);
for (i = 0; i < *n; ++i)
dscale(x[i], y[i], &xs[i], &ys[i]);
k1 = 0;
@@ -207,12 +207,12 @@
for (j = 0; j <= *np - i; ++j)
for (k = 0; k < *n; ++k)
f[k1++] = powi(xs[k], j) * powi(ys[k], i);
- Free(xs);
- Free(ys);
+ R_Free(xs);
+ R_Free(ys);
}
static void
-cholcov(double *x, double *y, double *l, int n, Sint *ifail)
+cholcov(double *x, double *y, double *l, int n, int *ifail)
{
int i, j;
static double *w;
@@ -221,7 +221,7 @@
/* Finds the Cholesky factor of the covariance matrix */
- w = Calloc(n * (n + 1) / 2, double);
+ w = R_Calloc(n * (n + 1) / 2, double);
i1 = 0;
for (i = 0; i < n; ++i)
for (j = 0; j <= i; ++j) {
@@ -231,7 +231,7 @@
}
cov(n * (n + 1) / 2, w, 0);
chols(n, w, l, ifail);
- Free(w);
+ R_Free(w);
}
/* ---------------------------------------------------------------------- */
@@ -239,7 +239,7 @@
static void
householder(double *f, double *nu, double *b, double *r, int n,
- int m, Sint *ifail)
+ int m, int *ifail)
{
int i, j, k;
double c1, c2;
@@ -305,7 +305,7 @@
in NU and B the same operations can be performed on any rhs vector Z to
give least squares estimates beta. */
- w = Calloc(n, double);
+ w = R_Calloc(n, double);
for (i = 0; i < n; ++i)
w[i] = z[i];
for (k = 0; k < m; ++k) {
@@ -318,11 +318,11 @@
w[i] -= sum * nu[i + k1];
}
bsolv(beta, w, m, r);
- Free(w);
+ R_Free(w);
}
static void
-chols(int n, double *a, double *l, Sint *ifail)
+chols(int n, double *a, double *l, int *ifail)
{
double eps = 1e-9;
@@ -435,14 +435,14 @@
/* Solves Ax = y where A = LU */
- w = Calloc(n, double);
+ w = R_Calloc(n, double);
fsolv(w, y, n, l);
bsolv(x, w, n, u);
- Free(w);
+ R_Free(w);
}
void
-VR_frset(Sfloat *xl, Sfloat *xu, Sfloat *yl, Sfloat *yu)
+VR_frset(double *xl, double *xu, double *yl, double *yu)
{
xl1 = *xl;
yl1 = *yl;
@@ -467,7 +467,7 @@
/* VARIANCE/COVARIANCE,PREDICTION AND STANDARD ERROR ROUTINES */
static double
-val(double xp, double yp, double *beta, Sint *np)
+val(double xp, double yp, double *beta, int *np)
{
int i, j, i1;
double xs, ys, sum;
@@ -484,7 +484,7 @@
}
void
-VR_valn(double *z, double *x, double *y, Sint *n, double *beta, Sint *np)
+VR_valn(double *z, double *x, double *y, int *n, double *beta, int *np)
{
int i, j, i1;
int it;
@@ -507,7 +507,7 @@
void
VR_krpred(double *z, double *xs, double *ys, double *x, double *y,
- Sint *npt, Sint *n, double *yy)
+ int *npt, int *n, double *yy)
{
double *d;
int i;
@@ -518,7 +518,7 @@
/* Gives value of interpolator at the point (XP,YP) */
- d = Calloc(*n, double);
+ d = R_Calloc(*n, double);
for (it = 0; it < *npt; ++it) {
xp = xs[it];
yp = ys[it];
@@ -534,13 +534,13 @@
}
z[it] = sum;
}
- Free(d);
+ R_Free(d);
}
void
-VR_prvar(double *z, double *xp, double *yp, Sint *npt,
- double *x, double *y, double *l, double *r, Sint *n,
- Sint *np, Sint *npar, double *l1f)
+VR_prvar(double *z, double *xp, double *yp, int *npt,
+ double *x, double *y, double *l, double *r, int *n,
+ int *np, int *npar, double *l1f)
{
int i, j, k, i1, k1, it;
@@ -550,8 +550,8 @@
/* Evaluates prediction variance at (XP,YP) */
- w1 = Calloc(*n, double);
- w2 = Calloc(*n, double);
+ w1 = R_Calloc(*n, double);
+ w2 = R_Calloc(*n, double);
for (it = 0; it < *npt; ++it) {
for (i = 0; i < *n; ++i) {
xd = x[i] - xp[it];
@@ -580,8 +580,8 @@
sum += w2[i] * w2[i];
z[it] = sum1 + sum;
}
- Free(w1);
- Free(w2);
+ R_Free(w1);
+ R_Free(w2);
}
@@ -589,8 +589,8 @@
/* CORRELOGRAM AND VARIOGRAM ROUTINES */
void
-VR_correlogram(Sfloat *xp, Sfloat *yp, Sint *nint, double *x,
- double *y, double *z, Sint *n, Sint *cnt)
+VR_correlogram(double *xp, double *yp, int *nint, double *x,
+ double *y, double *z, int *n, int *cnt)
{
double xd, yd, d, sc, zb, xm, var, sum;
int i, j, i1, ibin;
@@ -602,8 +602,8 @@
for the NINT intervals based on the NCP observations in each interval.
XM defines the upper limit on the x axis. */
- cp = Calloc(*nint + 1, double);
- ncp = Calloc(*nint + 1, int);
+ cp = R_Calloc(*nint + 1, double);
+ ncp = R_Calloc(*nint + 1, int);
zb = 0.0;
for (i = 0; i < *n; ++i) {
zb += z[i];
@@ -650,13 +650,13 @@
}
}
*nint = i1;
- Free(cp);
- Free(ncp);
+ R_Free(cp);
+ R_Free(ncp);
}
void
-VR_variogram(Sfloat *xp, Sfloat *yp, Sint *nint, double *x,
- double *y, double *z, Sint *n, Sint *cnt)
+VR_variogram(double *xp, double *yp, int *nint, double *x,
+ double *y, double *z, int *n, int *cnt)
{
double xd, yd, d, sc, xm;
@@ -669,8 +669,8 @@
in each interval.
*/
- sv = Calloc(*nint + 1, double);
- nsv = Calloc(*nint + 1, int);
+ sv = R_Calloc(*nint + 1, double);
+ nsv = R_Calloc(*nint + 1, int);
for (i = 0; i < *nint; ++i) {
nsv[i] = 0;
sv[i] = 0.0;
@@ -706,6 +706,6 @@
}
}
*nint = i1;
- Free(sv);
- Free(nsv);
+ R_Free(sv);
+ R_Free(nsv);
}
diff -ru spatial/src/pps.c spatial_new/src/pps.c
--- spatial/src/pps.c 2016-04-21 09:07:15.000000000 +0000
+++ spatial_new/src/pps.c 2022-05-29 09:00:35.000000000 +0000
@@ -32,7 +32,7 @@
# define min(a,b) ((a) < (b) ? (a) : (b))
#endif
-static Sfloat xl0, yl0, xu0, yu0;
+static double xl0, yl0, xu0, yu0;
static void
@@ -44,7 +44,7 @@
void
-VR_ppset(Sfloat *area)
+VR_ppset(double *area)
{
xl0 = *area++;
xu0 = *area++;
@@ -54,9 +54,9 @@
}
void
-VR_ppget(Sfloat *xx)
+VR_ppget(double *xx)
{
- Sfloat *z = xx;
+ double *z = xx;
testinit();
*z++ = xl0;
@@ -65,10 +65,10 @@
*z++ = yu0;
}
-static Sfloat
-edge(Sfloat x, Sfloat y, Sfloat a)
+static double
+edge(double x, double y, double a)
{
- Sfloat b, c, c1, c2, r[6], w;
+ double b, c, c1, c2, r[6], w;
int i;
w = x - xl0;
@@ -99,11 +99,11 @@
}
void
-VR_sp_pp2(Sfloat *x, Sfloat *y, Sint *npt, Sint *k,
- Sfloat *h, Sfloat *dmin, Sfloat *lm, Sfloat *fs)
+VR_sp_pp2(double *x, double *y, int *npt, int *k,
+ double *h, double *dmin, double *lm, double *fs)
{
int n = *npt, kk = *k, k1, i, j, ib;
- Sfloat ax, ay, xi, yi, sarea, g, dm, alm;
+ double ax, ay, xi, yi, sarea, g, dm, alm;
double a, x1, y1, rr, fss = *fs, fs1, s1;
testinit();
@@ -147,10 +147,10 @@
}
void
-VR_pdata(Sint *npt, Sfloat *x, Sfloat *y)
+VR_pdata(int *npt, double *x, double *y)
{
int i;
- Sfloat ax, ay;
+ double ax, ay;
testinit();
ax = xu0 - xl0;
@@ -165,11 +165,11 @@
void
-VR_simpat(Sint *npt, Sfloat *x, Sfloat *y, Sfloat *c,
- Sfloat *r, Sint *init)
+VR_simpat(int *npt, double *x, double *y, double *c,
+ double *r, int *init)
{
int i, attempts = 0, id, j, mm, n = *npt;
- Sfloat cc, rr, ax, ay, d, x1, y1, u;
+ double cc, rr, ax, ay, d, x1, y1, u;
testinit();
cc = *c;
@@ -209,10 +209,10 @@
}
void
-VR_simmat(Sint *npt, Sfloat *x, Sfloat *y, Sfloat *r)
+VR_simmat(int *npt, double *x, double *y, double *r)
{
int i, icnt, attempts = 0, j, n = *npt;
- Sfloat x1, y1, rr, ax, ay;
+ double x1, y1, rr, ax, ay;
testinit();
RANDIN;
@@ -242,10 +242,10 @@
}
void
-VR_plike(Sfloat *x, Sfloat *y, Sint *npt, Sfloat *c,
- Sfloat *r, Sint *ng, Sfloat *target, Sfloat *res)
+VR_plike(double *x, double *y, int *npt, double *c,
+ double *r, int *ng, double *target, double *res)
{
- Sfloat ar, rr, suma = 0, sumb = 0, xi, yi, x1, y1, c1, cc = *c;
+ double ar, rr, suma = 0, sumb = 0, xi, yi, x1, y1, c1, cc = *c;
int ic, i1, i2, j, n = *npt, g = *ng;
testinit();
diff -ru spatial/src/spatial.h spatial_new/src/spatial.h
--- spatial/src/spatial.h 2012-05-15 23:17:49.000000000 +0000
+++ spatial_new/src/spatial.h 2022-05-29 09:01:49.000000000 +0000
@@ -1,63 +1,63 @@
void
-VR_alset(Sfloat *alph, Sint *nalph);
+VR_alset(double *alph, int *nalph);
void
-VR_gls(double *x, double *y, double *z, Sint *n, Sint *np,
- Sint *npar, double *f, double *l, double *r, double *bz,
- double *wz, double *yy, double *w, Sint *ifail, double *l1f);
+VR_gls(double *x, double *y, double *z, int *n, int *np,
+ int *npar, double *f, double *l, double *r, double *bz,
+ double *wz, double *yy, double *w, int *ifail, double *l1f);
void
-VR_ls(double *x, double *y, double *z, Sint *n, Sint *np,
- Sint *npar, double *f, double *r, double *bz, double *wz,
- Sint *ifail);
+VR_ls(double *x, double *y, double *z, int *n, int *np,
+ int *npar, double *f, double *r, double *bz, double *wz,
+ int *ifail);
void
-VR_fmat(double *f, double *x, double *y, Sint *n, Sint *np);
+VR_fmat(double *f, double *x, double *y, int *n, int *np);
void
-VR_frset(Sfloat *xl, Sfloat *xu, Sfloat *yl, Sfloat *yu);
+VR_frset(double *xl, double *xu, double *yl, double *yu);
void
-VR_valn(double *z, double *x, double *y, Sint *n, double *beta, Sint *np);
+VR_valn(double *z, double *x, double *y, int *n, double *beta, int *np);
void
VR_krpred(double *z, double *xs, double *ys, double *x, double *y,
- Sint *npt, Sint *n, double *yy);
+ int *npt, int *n, double *yy);
void
-VR_prvar(double *z, double *xp, double *yp, Sint *npt,
- double *x, double *y, double *l, double *r, Sint *n,
- Sint *np, Sint *npar, double *l1f);
+VR_prvar(double *z, double *xp, double *yp, int *npt,
+ double *x, double *y, double *l, double *r, int *n,
+ int *np, int *npar, double *l1f);
void
-VR_correlogram(Sfloat *xp, Sfloat *yp, Sint *nint, double *x,
- double *y, double *z, Sint *n, Sint *cnt);
+VR_correlogram(double *xp, double *yp, int *nint, double *x,
+ double *y, double *z, int *n, int *cnt);
void
-VR_variogram(Sfloat *xp, Sfloat *yp, Sint *nint, double *x,
- double *y, double *z, Sint *n, Sint *cnt);
+VR_variogram(double *xp, double *yp, int *nint, double *x,
+ double *y, double *z, int *n, int *cnt);
void
-VR_ppset(Sfloat *area);
+VR_ppset(double *area);
void
-VR_ppget(Sfloat *xx);
+VR_ppget(double *xx);
void
-VR_sp_pp2(Sfloat *x, Sfloat *y, Sint *npt, Sint *k,
- Sfloat *h, Sfloat *dmin, Sfloat *lm, Sfloat *fs);
+VR_sp_pp2(double *x, double *y, int *npt, int *k,
+ double *h, double *dmin, double *lm, double *fs);
void
-VR_pdata(Sint *npt, Sfloat *x, Sfloat *y);
+VR_pdata(int *npt, double *x, double *y);
void
-VR_simpat(Sint *npt, Sfloat *x, Sfloat *y, Sfloat *c,
- Sfloat *r, Sint *init);
+VR_simpat(int *npt, double *x, double *y, double *c,
+ double *r, int *init);
void
-VR_simmat(Sint *npt, Sfloat *x, Sfloat *y, Sfloat *r);
+VR_simmat(int *npt, double *x, double *y, double *r);
void
-VR_plike(Sfloat *x, Sfloat *y, Sint *npt, Sfloat *c,
- Sfloat *r, Sint *ng, Sfloat *target, Sfloat *res);
+VR_plike(double *x, double *y, int *npt, double *c,
+ double *r, int *ng, double *target, double *res);
|
Since there's actual code changes, there's not much we can do other than fixing the checksum? We should also reach out to the package authors and ask them WTF is going on here though, to at least point out to them that this is bad practice... |
Although there are actual code changes, they actually look benign, basically just replacing the use of |
While checking this, I noticed that the source tarball for |
The R 4.1 extension "spatial-7.3-14.tar.gz" has been changed and needs a new checksum 0c42df479c1a202dfc678f223e924b1adde5822a9902a3d71fd5f2ff36c4b83b applied to R-4.1.0-foss-2021a.eb.
I was able to change a local copy of the .eb, so the installation is ongoing. I have not tested the changes.
Kenny
The text was updated successfully, but these errors were encountered: