Skip to content

Commit 22f461d

Browse files
more cpp11
1 parent 0e29efd commit 22f461d

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/Makevars

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
PKG_CPPFLAGS = -IlibBigWig
2-
PKG_LIBS = libBigWig/libBigWig.a
1+
PKG_CPPFLAGS = -Wpointer-arith
2+
PKG_LIBS = libBigWig.a
3+
4+
LIBBIGWIG_SOURCE_DIR=libbigwig
5+
LIBBIGWIG_MAKEFILE=libbigwig/Makefile
6+
7+
# libbigwig:
8+
# cd "${LIBBIGWIG_SOURCE_DIR}" && $(MAKE) -f "${LIBBIGWIG_MAKEFILE}"
9+
10+
# all: libbigwig

src/bigwig.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ writable::data_frame read_bigwig_impl(std::string bwfname, std::string chrom, in
1818
bwf = bwOpen(&bwfile[0], NULL, &mode) ;
1919

2020
if (!bwf)
21-
stop("Failed to open file: %s\n", bwfname) ;
21+
stop("Failed to open file: %s\n", bwfname.c_str()) ;
2222

2323
std::vector<std::string> chroms ;
2424
std::vector<int> starts ;
@@ -42,7 +42,7 @@ writable::data_frame read_bigwig_impl(std::string bwfname, std::string chrom, in
4242
intervals = bwGetValues(bwf, cur_chrom, start, end, 0) ;
4343

4444
if (!intervals)
45-
stop("Failed to retreived intervals for %s\n", chrom) ;
45+
stop("Failed to retreived intervals for %s\n", chrom.c_str()) ;
4646

4747
int nint = intervals->l ;
4848
for(int i=0; i<nint; ++i) {

src/cpp11.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <R_ext/Visibility.h>
77

88
// bigwig.cpp
9-
cpp11::writable::data_frame read_bigwig_impl(std::string bwfname, std::string chrom, int start, int end);
9+
writable::data_frame read_bigwig_impl(std::string bwfname, std::string chrom, int start, int end);
1010
extern "C" SEXP _cpp11bigwig_read_bigwig_impl(SEXP bwfname, SEXP chrom, SEXP start, SEXP end) {
1111
BEGIN_CPP11
1212
return cpp11::as_sexp(read_bigwig_impl(cpp11::as_cpp<cpp11::decay_t<std::string>>(bwfname), cpp11::as_cpp<cpp11::decay_t<std::string>>(chrom), cpp11::as_cpp<cpp11::decay_t<int>>(start), cpp11::as_cpp<cpp11::decay_t<int>>(end)));

0 commit comments

Comments
 (0)