From noreply at r-forge.r-project.org Thu Apr 6 11:28:35 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 6 Apr 2017 11:28:35 +0200 (CEST) Subject: [Dplr-commits] r1063 - in pkg/dplR: . src Message-ID: <20170406092836.0190818785F@r-forge.r-project.org> Author: mvkorpel Date: 2017-04-06 11:28:35 +0200 (Thu, 06 Apr 2017) New Revision: 1063 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION pkg/dplR/src/redfit.c Log: Probably suppressed pointer protection alert reported by Tomas Kalibera. Will try to run the rchk tool on the new version later today. Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-28 10:17:37 UTC (rev 1062) +++ pkg/dplR/ChangeLog 2017-04-06 09:28:35 UTC (rev 1063) @@ -51,6 +51,13 @@ - Technical changes to facilitate the implematation of sfrcs(). +File: src/redfit.c +---------------- + +- Fixed a pointer protection alert reported by rchk / Tomas + Kalibera. Seemed like a false alarm, but the code is slightly + cleaner as a result of the change. + * CHANGES IN dplR VERSION 1.6.5 File: combine.rwl.R Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-28 10:17:37 UTC (rev 1062) +++ pkg/dplR/DESCRIPTION 2017-04-06 09:28:35 UTC (rev 1063) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-28 +Date: 2017-04-06 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph", "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko", "Korpela", role = c("aut", "trl")), person("Franco", "Biondi", Modified: pkg/dplR/src/redfit.c =================================================================== --- pkg/dplR/src/redfit.c 2017-02-28 10:17:37 UTC (rev 1062) +++ pkg/dplR/src/redfit.c 2017-04-06 09:28:35 UTC (rev 1063) @@ -102,10 +102,10 @@ PROTECT(lmres = eval(lmcall, R_EmptyEnv)); /* dplR: get residuals from the list given by lm.fit(x, y) */ - lmnames = getAttrib(lmres, R_NamesSymbol); PROTECT(tmp = ncall = allocList(2)); SET_TYPEOF(ncall, LANGSXP); SETCAR(tmp, lengthfun); tmp = CDR(tmp); + lmnames = getAttrib(lmres, R_NamesSymbol); SETCAR(tmp, lmnames); PROTECT_WITH_INDEX(sn = eval(ncall, R_BaseEnv), &ipx); REPROTECT(sn = coerceVector(sn, REALSXP), ipx); From noreply at r-forge.r-project.org Mon Apr 24 09:59:32 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 24 Apr 2017 09:59:32 +0200 (CEST) Subject: [Dplr-commits] r1064 - in pkg/dplR: . R Message-ID: <20170424075933.0AF3E1885DD@r-forge.r-project.org> Author: mvkorpel Date: 2017-04-24 09:59:32 +0200 (Mon, 24 Apr 2017) New Revision: 1064 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION pkg/dplR/R/helpers.R pkg/dplR/R/rasterPlot.R pkg/dplR/R/read.tucson.R Log: Robustness against the rare missing tempdir() See R-admin manual section 5 and recent discussion on R-devel list Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-04-06 09:28:35 UTC (rev 1063) +++ pkg/dplR/ChangeLog 2017-04-24 07:59:32 UTC (rev 1064) @@ -6,6 +6,8 @@ - Internal helper fix.names() is more robust when working in the C locale. +- Added internal helper function check.tempdir() + File: latexify.R ---------------- @@ -18,6 +20,13 @@ - In rasterPlot(Cairo = TRUE, ...), added a version check for the Cairo package +- Check if temporary directory is missing before use + +File: read.tucson.R +---------------- + +- Check if temporary directory is missing before use + File: DESCRIPTION ---------------- Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-04-06 09:28:35 UTC (rev 1063) +++ pkg/dplR/DESCRIPTION 2017-04-24 07:59:32 UTC (rev 1064) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-04-06 +Date: 2017-04-24 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph", "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko", "Korpela", role = c("aut", "trl")), person("Franco", "Biondi", Modified: pkg/dplR/R/helpers.R =================================================================== --- pkg/dplR/R/helpers.R 2017-04-06 09:28:35 UTC (rev 1063) +++ pkg/dplR/R/helpers.R 2017-04-24 07:59:32 UTC (rev 1064) @@ -1,3 +1,11 @@ +### Try to create directory named by tempdir() if it has gone missing +check.tempdir <- function() { + td <- tempdir() + if (!file.exists(td)) { + dir.create(td) + } +} + ### Checks that all arguments are TRUE or FALSE check.flags <- function(...) { flag.bad <- vapply(list(...), Modified: pkg/dplR/R/rasterPlot.R =================================================================== --- pkg/dplR/R/rasterPlot.R 2017-04-06 09:28:35 UTC (rev 1063) +++ pkg/dplR/R/rasterPlot.R 2017-04-24 07:59:32 UTC (rev 1064) @@ -134,6 +134,7 @@ cairoType <- "raster" cairoFile <- "" } else { + check.tempdir() cairoType <- "png" cairoFile <- fname } @@ -141,9 +142,11 @@ units = "in", dpi = res, bg = bg, type = cairoType, file = cairoFile, ...) } else if (missing(antialias)) { + check.tempdir() png(fname, width = pngWidthHeight[1], height = pngWidthHeight[2], units = "in", res = res, bg = bg, ...) } else { + check.tempdir() png(fname, width = pngWidthHeight[1], height = pngWidthHeight[2], units = "in", res = res, bg = bg, antialias = antialias, ...) } Modified: pkg/dplR/R/read.tucson.R =================================================================== --- pkg/dplR/R/read.tucson.R 2017-04-06 09:28:35 UTC (rev 1063) +++ pkg/dplR/R/read.tucson.R 2017-04-24 07:59:32 UTC (rev 1064) @@ -121,6 +121,7 @@ ## Temporary file for 'goodLines'. Reading from this file is ## faster than making a textConnection to 'goodLines'. tf <- tempfile() + check.tempdir() tfcon <- file(tf, encoding="UTF-8") on.exit(close(tfcon)) on.exit(unlink(tf), add=TRUE) From noreply at r-forge.r-project.org Tue Apr 25 11:57:26 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 25 Apr 2017 11:57:26 +0200 (CEST) Subject: [Dplr-commits] r1065 - in pkg/dplR: . R Message-ID: <20170425095726.4DFDB188D6A@r-forge.r-project.org> Author: mvkorpel Date: 2017-04-25 11:57:25 +0200 (Tue, 25 Apr 2017) New Revision: 1065 Modified: pkg/dplR/DESCRIPTION pkg/dplR/R/helpers.R Log: When recreating temporary directory, try to set mode "0700"... which should be the mode of the initial tempdir (made by mkdtemp). Does not apply to Windows. Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-04-24 07:59:32 UTC (rev 1064) +++ pkg/dplR/DESCRIPTION 2017-04-25 09:57:25 UTC (rev 1065) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-04-24 +Date: 2017-04-25 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph", "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko", "Korpela", role = c("aut", "trl")), person("Franco", "Biondi", Modified: pkg/dplR/R/helpers.R =================================================================== --- pkg/dplR/R/helpers.R 2017-04-24 07:59:32 UTC (rev 1064) +++ pkg/dplR/R/helpers.R 2017-04-25 09:57:25 UTC (rev 1065) @@ -2,7 +2,7 @@ check.tempdir <- function() { td <- tempdir() if (!file.exists(td)) { - dir.create(td) + dir.create(td, mode = "0700") } }