Skip to content

Commit

Permalink
Use STRING_PTR_RO(), STRING_PTR() is not part of the API
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Jun 20, 2024
1 parent 5572ed6 commit 5f033eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ static int _diff(const void *a, int aoff, int n,
int *buf, int bufsize);

struct _chr_data {
SEXP* aptr;
SEXP* bptr;
const SEXP* aptr;
const SEXP* bptr;
};

static int _cmp_chr(int a, int b, void *context) {
Expand All @@ -85,8 +85,8 @@ SEXP clic_diff_chr(SEXP old, SEXP new, SEXP max) {
int sn;

struct _chr_data data;
data.aptr = STRING_PTR(old);
data.bptr = STRING_PTR(new);
data.aptr = STRING_PTR_RO(old);
data.bptr = STRING_PTR_RO(new);

int out = _diff(old, 0, l_old, new, 0, l_new, _cmp_chr, &data,
dmax, ses, &sn, buf, bufsize);
Expand Down

0 comments on commit 5f033eb

Please sign in to comment.