From 2c93f5e18055126bfb229edb6b9272167eeaa133 Mon Sep 17 00:00:00 2001 From: Peter Kharchenko Date: Thu, 2 Jun 2016 04:34:35 -0400 Subject: [PATCH] fixes for R 3.3.0 --- DESCRIPTION | 4 ++-- src/bed2vector.cpp | 4 ++-- src/maqread.cpp | 4 ++-- src/peaks.cpp | 20 +++++++++++--------- src/wdl.cpp | 6 ++++-- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a3e1deb..46e9a94 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: spp Type: Package Title: some description -Version: 1.13 -Date: 2015-08-21 +Version: 1.14 +Date: 2016-06-02 Author: Peter K Depends: caTools Imports: Rsamtools diff --git a/src/bed2vector.cpp b/src/bed2vector.cpp index 8b242b3..63e9499 100644 --- a/src/bed2vector.cpp +++ b/src/bed2vector.cpp @@ -17,8 +17,8 @@ #endif extern "C" { -#include "R.h" -#include "Rmath.h" +//#include "R.h" +//#include "Rmath.h" #include "Rinternals.h" #include "Rdefines.h" // for getline diff --git a/src/maqread.cpp b/src/maqread.cpp index 2c1334a..896068f 100644 --- a/src/maqread.cpp +++ b/src/maqread.cpp @@ -12,8 +12,8 @@ #include extern "C" { -#include "R.h" -#include "Rmath.h" +//#include "R.h" +//#include "Rmath.h" #include "Rinternals.h" #include "Rdefines.h" #include "maqmap.h" diff --git a/src/peaks.cpp b/src/peaks.cpp index ace6855..37770d5 100644 --- a/src/peaks.cpp +++ b/src/peaks.cpp @@ -3,10 +3,12 @@ #include #include #include +#include +#include extern "C" { -#include "R.h" -#include "Rmath.h" +//#include "R.h" +//#include "Rmath.h" #include "Rinternals.h" #include "Rdefines.h" } @@ -108,14 +110,14 @@ extern "C" { for(int i=0;i=d[i] - while((abs(pos[k])+size) < d[i]) { k++; if(k==npos) { break; }; + while((std::abs(pos[k])+size) < d[i]) { k++; if(k==npos) { break; }; #ifdef DEBUG Rprintf("advancing k to %d\n",k); #endif } if(k==npos) { break; }; // increment i until d[i]>=pos[k]-size - while((abs(pos[k])-size) > d[i]) { i++; if(i==nd) { break; } + while((std::abs(pos[k])-size) > d[i]) { i++; if(i==nd) { break; } #ifdef DEBUG Rprintf("advancing i to %d\n",i); #endif @@ -124,14 +126,14 @@ extern "C" { int l=k; - while((l0) { x.push_back(pd); @@ -698,9 +700,9 @@ extern "C" { // update flags int f=flags[i]; if(f>0) { - s[abs(f)-1]++; + s[std::abs(f)-1]++; } else { - s[abs(f)-1]--; + s[std::abs(f)-1]--; } if(max_val!=0 && val[i]*max_val > mval*max_val) { mval=val[i]; } diff --git a/src/wdl.cpp b/src/wdl.cpp index 02a2f31..18a2258 100644 --- a/src/wdl.cpp +++ b/src/wdl.cpp @@ -3,10 +3,12 @@ #include #include #include +#include +#include extern "C" { -#include "R.h" -#include "Rmath.h" +//#include "R.h" +//#include "Rmath.h" #include "Rinternals.h" #include "Rdefines.h" }