[Rcpp-commits] r3841 - pkg/Rcpp/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Oct 26 21:12:17 CEST 2012
Author: edd
Date: 2012-10-26 21:12:17 +0200 (Fri, 26 Oct 2012)
New Revision: 3841
Modified:
pkg/Rcpp/src/Datetime.cpp
Log:
somewhat invasise change defining a namespace R for the Rmath functions --
but which gives us clean access to R::Rf_dt etc for the various d/p/q/r functions
Modified: pkg/Rcpp/src/Datetime.cpp
===================================================================
--- pkg/Rcpp/src/Datetime.cpp 2012-10-26 03:00:49 UTC (rev 3840)
+++ pkg/Rcpp/src/Datetime.cpp 2012-10-26 19:12:17 UTC (rev 3841)
@@ -71,7 +71,7 @@
time_t t = static_cast<time_t>(floor(m_dt));
m_tm = *gmtime(&t); // this may need a Windows fix, re-check R's datetime.c
// m_us is fractional (micro)secs as diff. between (fractional) m_dt and m_tm
- m_us = static_cast<int>(::Rf_fround( (m_dt - t) * 1.0e6, 0.0));
+ m_us = static_cast<int>(R::Rf_fround( (m_dt - t) * 1.0e6, 0.0));
} else {
m_dt = NA_REAL; // NaN and Inf need it set
m_tm.tm_sec = m_tm.tm_min = m_tm.tm_hour = m_tm.tm_isdst = NA_INTEGER;
@@ -85,7 +85,7 @@
newdt.m_dt += offset;
time_t t = static_cast<time_t>(floor(newdt.m_dt));
newdt.m_tm = *gmtime(&t); // this may need a Windows fix, re-check R's dat
- newdt.m_us = static_cast<int>(::Rf_fround( (newdt.m_dt - t) * 1.0e6, 0.0));
+ newdt.m_us = static_cast<int>(R::Rf_fround( (newdt.m_dt - t) * 1.0e6, 0.0));
return newdt;
}
More information about the Rcpp-commits
mailing list