From 1ab6aca64894ac6f68282f3b868737ff17508345 Mon Sep 17 00:00:00 2001 From: Michael Kane Date: Fri, 1 May 2026 11:56:16 -0400 Subject: [PATCH] Fix build and R CMD check warnings; bump to 4.0.4 - Drop deprecated Rcpp:::LdFlags() from src/Makevars and src/Makevars.win (no longer needed since 2013; Rcpp is linked automatically via LinkingTo). - Cast .size() results to int in Rprintf calls in Params.h and Graph.h to match %d format specifier. - Remove orphan %0.2f format specifier in Cbcpgraph.cpp Rprintf with no matching argument. - Add .claude and build-artifact patterns to .Rbuildignore. Co-Authored-By: Claude Opus 4.7 (1M context) --- .Rbuildignore | 3 +++ DESCRIPTION | 4 ++-- src/Cbcpgraph.cpp | 2 +- src/Graph.h | 4 ++-- src/Makevars | 2 +- src/Makevars.win | 2 +- src/Params.h | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 91114bf..ab089e6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,5 @@ ^.*\.Rproj$ ^\.Rproj\.user$ +^\.claude$ +^bcp_.*\.tar\.gz$ +^bcp\.Rcheck$ diff --git a/DESCRIPTION b/DESCRIPTION index 28be19d..263e7d1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: bcp Type: Package Title: Bayesian Analysis of Change Point Problems -Version: 4.0.3 -Date: 2018-08-13 +Version: 4.0.4 +Date: 2026-05-01 Author: Xiaofei Wang, Chandra Erdman, and John W. Emerson Maintainer: Xiaofei Wang Depends: diff --git a/src/Cbcpgraph.cpp b/src/Cbcpgraph.cpp index 303e9ff..eb89f57 100755 --- a/src/Cbcpgraph.cpp +++ b/src/Cbcpgraph.cpp @@ -55,7 +55,7 @@ void recomputeVals(Graph &graph, Partition &components, GraphParams ¶ms) } W[i] -= B[i]; - Rprintf("Recomputed: i:%d, W: %0.2f, B: %0.2f, size: %d, %0.2f\n", i, W[i], B[i], + Rprintf("Recomputed: i:%d, W: %0.2f, B: %0.2f, size: %d\n", i, W[i], B[i], components[i].size); } } diff --git a/src/Graph.h b/src/Graph.h index c39c5bc..fc19e5b 100644 --- a/src/Graph.h +++ b/src/Graph.h @@ -183,8 +183,8 @@ class Graph // other functions void print(bool all = false) { - Rprintf("overall mean:%0.2f, overall ysq:%0.2f, num pixels: %d\n", - mean, sumysq, nodes.size()); + Rprintf("overall mean:%0.2f, overall ysq:%0.2f, num pixels: %d\n", + mean, sumysq, (int)nodes.size()); if (all) { for (int i = 0; i < nodes.size(); i++) { diff --git a/src/Makevars b/src/Makevars index 6961fc9..d711999 100755 --- a/src/Makevars +++ b/src/Makevars @@ -1,2 +1,2 @@ ## Use the R_HOME indirection to support installations of multiple R version -PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) +PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) diff --git a/src/Makevars.win b/src/Makevars.win index 23d51b8..40c8dcf 100755 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,4 +1,4 @@ ## Use the R_HOME indirection to support installations of multiple R version -PKG_LIBS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()") $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) +PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) diff --git a/src/Params.h b/src/Params.h index 12b98b8..cd35cb0 100644 --- a/src/Params.h +++ b/src/Params.h @@ -119,7 +119,7 @@ class GraphParams: public Params { Rprintf("multivariate: alpha=%0.2f, d=%0.2f w:%0.2f kk:%d\n", p0, d, w[0], kk); } else { // regression since multiple predictors - Rprintf("regression: alpha=%0.2f, d=%0.2f w.size:%d kk:%d\n", p0, d, w.size(), kk); + Rprintf("regression: alpha=%0.2f, d=%0.2f w.size:%d kk:%d\n", p0, d, (int)w.size(), kk); } }