Skip to content

Commit

Permalink
calling it Rf_length
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Sep 23, 2024
1 parent a60166e commit 340e569
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/init.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#include "QuadCensus.h"
#include <stdexcept>
#define R_NO_REMAP
#include <R.h>
#include <R_ext/Rdynload.h>
#include <Rdefines.h>
#include <Rinternals.h>
#include <stdlib.h> // for NULL

#include <fstream>
#include <stdexcept>

#include <stdlib.h> // for NULL
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
#include "QuadCensus.h"

using namespace std;
using namespace oaqc;
Expand Down Expand Up @@ -85,7 +89,7 @@ static void write_results(SEXP& a_value, SEXP& a_names, unsigned int& sIndex,

extern "C" SEXP entry(SEXP a_n, SEXP a_edges, SEXP a_freqFlag, SEXP a_file) {
const unsigned int n = INTEGER(a_n)[0];
const unsigned int m = length(a_edges) / 2;
const unsigned int m = Rf_length(a_edges) / 2;
const int* edges = INTEGER(a_edges);
string filePrefix(CHAR(STRING_ELT(a_file, 0)));
const bool wNonIndFreq = LOGICAL(a_freqFlag)[0];
Expand Down

0 comments on commit 340e569

Please sign in to comment.