[Rcpp-commits] r4263 - in pkg/RcppCNPy: . inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 20 03:12:15 CET 2013


Author: edd
Date: 2013-02-20 03:12:14 +0100 (Wed, 20 Feb 2013)
New Revision: 4263

Modified:
   pkg/RcppCNPy/ChangeLog
   pkg/RcppCNPy/DESCRIPTION
   pkg/RcppCNPy/inst/NEWS.Rd
   pkg/RcppCNPy/src/cnpy.cpp
   pkg/RcppCNPy/src/cnpy.h
Log:
add R_NO_REMAP to avoid clashes when length() etc are redefined
suppress one noisy message from g++ in pedantic mode


Modified: pkg/RcppCNPy/ChangeLog
===================================================================
--- pkg/RcppCNPy/ChangeLog	2013-02-19 15:36:57 UTC (rev 4262)
+++ pkg/RcppCNPy/ChangeLog	2013-02-20 02:12:14 UTC (rev 4263)
@@ -1,3 +1,11 @@
+2013-02-19  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/cnpy.h: Define R_NO_REMAP before including Rinternals to not
+	define length(), error(), ... but rather Rf_length(), Rf_error()
+
+	* src/cnpy.cpp: Add a bogus unused variable at the never-reached end
+	of code (after an error exit) to silence the pedantic mode of g++ 
+
 2012-07-30  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Version 0.2.0

Modified: pkg/RcppCNPy/DESCRIPTION
===================================================================
--- pkg/RcppCNPy/DESCRIPTION	2013-02-19 15:36:57 UTC (rev 4262)
+++ pkg/RcppCNPy/DESCRIPTION	2013-02-20 02:12:14 UTC (rev 4263)
@@ -1,7 +1,7 @@
 Package: RcppCNPy
 Type: Package
 Title: Rcpp bindings for NumPy files
-Version: 0.2.0
+Version: 0.2.0.1
 Date: $Date$
 Author: Dirk Eddelbuettel
 Maintainer: Dirk Eddelbuettel <edd at debian.org>

Modified: pkg/RcppCNPy/inst/NEWS.Rd
===================================================================
--- pkg/RcppCNPy/inst/NEWS.Rd	2013-02-19 15:36:57 UTC (rev 4262)
+++ pkg/RcppCNPy/inst/NEWS.Rd	2013-02-20 02:12:14 UTC (rev 4263)
@@ -2,6 +2,13 @@
 \title{News for Package \pkg{RcppCNPy}}
 \newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
 
+\section{Changes in version 0.2.1 (2013-02-19)}{
+  \itemize{
+    \item Ensure that inclusion of \code{Rinternal.h} does not affect
+    other headers by adding RF_NO_REMAP
+  }
+}
+
 \section{Changes in version 0.2.0 (2012-07-30)}{
   \itemize{
     \item Support for writing of \code{gzip}-ed \code{npy} files has

Modified: pkg/RcppCNPy/src/cnpy.cpp
===================================================================
--- pkg/RcppCNPy/src/cnpy.cpp	2013-02-19 15:36:57 UTC (rev 4262)
+++ pkg/RcppCNPy/src/cnpy.cpp	2013-02-20 02:12:14 UTC (rev 4263)
@@ -231,6 +231,8 @@
     fclose(fp);
     Rf_error("npz_load: Error! Variable name %s not found in %s!\n",varname.c_str(),fname.c_str());
     // never reached -- not satisfying -Wall -pedantic 
+    NpyArray unused;
+    return unused;
 }
 
 cnpy::NpyArray cnpy::npy_load(std::string fname) {

Modified: pkg/RcppCNPy/src/cnpy.h
===================================================================
--- pkg/RcppCNPy/src/cnpy.h	2013-02-19 15:36:57 UTC (rev 4262)
+++ pkg/RcppCNPy/src/cnpy.h	2013-02-20 02:12:14 UTC (rev 4263)
@@ -22,6 +22,8 @@
 #ifdef RCPP_HAS_LONG_LONG_TYPES
 #include <cstdint>		// for std::int64_t, needs c++11 switch
 #endif
+
+#define R_NO_REMAP
 #include <Rinternals.h>      	// for Rf_error
 
 namespace cnpy {



More information about the Rcpp-commits mailing list