From 0f0a2304a4c7175b45561b0514c0099bb42919e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Thu, 8 Aug 2024 11:11:41 +0200 Subject: [PATCH] Avoid STRING_PTR We only need STRING_PTR_RO. --- src/lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.c b/src/lib.c index 9d7ee49d..469a4da7 100644 --- a/src/lib.c +++ b/src/lib.c @@ -33,7 +33,7 @@ static R_INLINE int hash_string(char *str, int strlen) { struct hash_table { SEXP nms; - SEXP *nmsptr; + const SEXP *nmsptr; SEXP cols; int *tab; int tablen; @@ -45,7 +45,7 @@ struct hash_table { static void hash_create(struct hash_table *table, SEXP nms, SEXP cols, SEXP tab, int max_cols, int npkgs) { table->nms = nms; - table->nmsptr = STRING_PTR(nms); + table->nmsptr = STRING_PTR_RO(nms); table->cols = cols; table->tab = INTEGER(tab); table->tablen = LENGTH(tab);